3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/shells/bash/bash-completion/default.nix

61 lines
1.8 KiB
Nix
Raw Normal View History

2019-08-14 01:57:46 +01:00
{ stdenv, fetchFromGitHub
, fetchpatch
2019-08-14 01:57:46 +01:00
, autoreconfHook
, python3Packages
, bashInteractive
}:
2013-04-10 16:39:03 +01:00
stdenv.mkDerivation rec {
pname = "bash-completion";
# TODO: Remove musl patch below upon next release!
2019-08-14 01:57:46 +01:00
version = "2.9";
2019-08-14 01:57:46 +01:00
src = fetchFromGitHub {
owner = "scop";
repo = "bash-completion";
rev = version;
sha256 = "1813r4jxfa2zgzm2ppjhrq62flfmxai8433pklxcrl4fp5wwx9yv";
};
2019-08-14 01:57:46 +01:00
nativeBuildInputs = [ autoreconfHook ];
doCheck = !stdenv.isDarwin;
2019-08-14 01:57:46 +01:00
checkInputs = [
python3Packages.pexpect
python3Packages.pytest
bashInteractive
];
patches = [
./0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch
# TODO: Remove when https://github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393
# is availabe in a release in nixpkgs. see https://github.com/scop/bash-completion/issues/312.
# Fixes a test failure with musl.
(fetchpatch {
url = "https://github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393.patch";
name = "bash-completion-musl-test_iconv-skip-option-completion-if-help-fails";
sha256 = "1l53d62zf01k625nzw3vcrxky93h7bzdpchgk4argxalrn17ckvb";
})
];
2019-08-14 01:57:46 +01:00
# 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/*
'';
2016-09-28 16:45:45 +01:00
meta = with stdenv.lib; {
homepage = https://github.com/scop/bash-completion;
description = "Programmable completion for the bash shell";
2016-09-28 16:45:45 +01:00
license = licenses.gpl2Plus;
platforms = platforms.unix;
maintainers = [ maintainers.peti ];
};
}