From 12fd773ff058755237ebafe5f1c0bdd36f385eb6 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 13 Aug 2019 17:57:46 -0700 Subject: [PATCH] bash-completion: 2.8 -> 2.9 --- pkgs/shells/bash/bash-completion/default.nix | 31 ++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/pkgs/shells/bash/bash-completion/default.nix b/pkgs/shells/bash/bash-completion/default.nix index 0476cbd1f3f7..d544114d2103 100644 --- a/pkgs/shells/bash/bash-completion/default.nix +++ b/pkgs/shells/bash/bash-completion/default.nix @@ -1,15 +1,36 @@ -{ stdenv, fetchurl }: +{ stdenv, fetchFromGitHub +, autoreconfHook +, python3Packages +, bashInteractive +}: stdenv.mkDerivation rec { pname = "bash-completion"; - version = "2.8"; + version = "2.9"; - src = fetchurl { - url = "https://github.com/scop/bash-completion/releases/download/${version}/${pname}-${version}.tar.xz"; - sha256 = "0kgmflrr1ga9wfk770vmakna3nj46ylb5ky9ipd0v2k9ymq5a7y0"; + src = fetchFromGitHub { + owner = "scop"; + repo = "bash-completion"; + rev = version; + sha256 = "1813r4jxfa2zgzm2ppjhrq62flfmxai8433pklxcrl4fp5wwx9yv"; }; + nativeBuildInputs = [ autoreconfHook ]; + doCheck = true; + checkInputs = [ + python3Packages.pexpect + python3Packages.pytest + bashInteractive + ]; + + # ignore ip_addresses because it tries to touch network + # ignore test_ls because impure logic + checkPhase = '' + pytest . \ + --ignore=test/t/unit/test_unit_ip_addresses.py \ + --ignore=test/t/test_ls.py + ''; prePatch = stdenv.lib.optionalString stdenv.isDarwin '' sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*