2019-08-14 02:57:46 +02:00
|
|
|
{ stdenv, fetchFromGitHub
|
2019-12-02 04:12:17 +01:00
|
|
|
, fetchpatch
|
2019-08-14 02:57:46 +02:00
|
|
|
, autoreconfHook
|
2020-04-06 17:01:06 +02:00
|
|
|
, perl
|
|
|
|
, ps
|
2019-08-14 02:57:46 +02:00
|
|
|
, python3Packages
|
|
|
|
, bashInteractive
|
|
|
|
}:
|
2011-07-22 00:02:01 +02:00
|
|
|
|
2013-04-10 17:39:03 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "bash-completion";
|
2020-04-06 17:01:06 +02:00
|
|
|
version = "2.10";
|
2011-07-22 00:02:01 +02:00
|
|
|
|
2019-08-14 02:57:46 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scop";
|
|
|
|
repo = "bash-completion";
|
|
|
|
rev = version;
|
2020-04-06 17:01:06 +02:00
|
|
|
sha256 = "047yjryy9d6hp18wkigbfrw9r0sm31inlsp8l28fhxg8ii032sgq";
|
2011-07-22 00:02:01 +02:00
|
|
|
};
|
|
|
|
|
2019-08-14 02:57:46 +02:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
2019-10-26 04:00:00 +02:00
|
|
|
doCheck = !stdenv.isDarwin;
|
2019-08-14 02:57:46 +02:00
|
|
|
checkInputs = [
|
2020-04-06 17:01:06 +02:00
|
|
|
# perl is assumed by perldoc completion
|
|
|
|
perl
|
|
|
|
# ps assumed to exist by gdb, killall, pgrep, pidof,
|
|
|
|
# pkill, pwdx, renice, and reptyr completions
|
|
|
|
ps
|
2019-08-14 02:57:46 +02:00
|
|
|
python3Packages.pexpect
|
|
|
|
python3Packages.pytest
|
|
|
|
bashInteractive
|
2020-05-07 15:47:05 +02:00
|
|
|
|
|
|
|
# use xdist to speed up the test run, just like upstream:
|
|
|
|
# https://github.com/scop/bash-completion/blob/009bf2228c68894629eb6fd17b3dc0f1f6d67615/test/requirements.txt#L4
|
|
|
|
python3Packages.pytest_xdist
|
2019-08-14 02:57:46 +02:00
|
|
|
];
|
|
|
|
|
2020-04-06 17:01:06 +02:00
|
|
|
# - ignore test_gcc on ARM because it assumes -march=native
|
|
|
|
# - ignore test_chsh because it assumes /etc/shells exists
|
|
|
|
# - ignore test_ether_wake, test_ifdown, test_ifstat, test_ifup,
|
|
|
|
# test_iperf, test_iperf3, test_nethogs and ip_addresses
|
|
|
|
# because they try to touch network
|
|
|
|
# - ignore test_ls because impure logic
|
|
|
|
# - ignore test_screen because it assumes vt terminals exist
|
2019-08-14 02:57:46 +02:00
|
|
|
checkPhase = ''
|
2020-05-07 15:47:05 +02:00
|
|
|
pytest -n $NIX_BUILD_CORES . \
|
2020-04-29 18:04:39 +02:00
|
|
|
${stdenv.lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) "--ignore=test/t/test_gcc.py"} \
|
2020-04-06 17:01:06 +02:00
|
|
|
--ignore=test/t/test_chsh.py \
|
|
|
|
--ignore=test/t/test_ether_wake.py \
|
|
|
|
--ignore=test/t/test_ifdown.py \
|
|
|
|
--ignore=test/t/test_ifstat.py \
|
|
|
|
--ignore=test/t/test_ifup.py \
|
|
|
|
--ignore=test/t/test_iperf.py \
|
|
|
|
--ignore=test/t/test_iperf3.py \
|
|
|
|
--ignore=test/t/test_nethogs.py \
|
2019-08-14 02:57:46 +02:00
|
|
|
--ignore=test/t/unit/test_unit_ip_addresses.py \
|
2020-04-06 17:01:06 +02:00
|
|
|
--ignore=test/t/test_ls.py \
|
|
|
|
--ignore=test/t/test_screen.py
|
2019-08-14 02:57:46 +02:00
|
|
|
'';
|
2011-07-22 00:02:01 +02:00
|
|
|
|
2017-02-10 21:42:12 +01:00
|
|
|
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*
|
|
|
|
'';
|
|
|
|
|
2016-09-28 17:45:45 +02:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/scop/bash-completion";
|
2011-07-22 00:02:01 +02:00
|
|
|
description = "Programmable completion for the bash shell";
|
2016-09-28 17:45:45 +02:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
2020-04-06 17:01:06 +02:00
|
|
|
maintainers = [ maintainers.peti maintainers.xfix ];
|
2011-07-22 00:02:01 +02:00
|
|
|
};
|
|
|
|
}
|