2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchpatch
|
|
|
|
, autoreconfHook
|
|
|
|
, perl
|
|
|
|
, ps
|
|
|
|
, python3Packages
|
|
|
|
, bashInteractive
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "bash-completion";
|
2020-11-06 00:33:48 +00:00
|
|
|
version = "2.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
# Using fetchurl because fetchGithub or fetchzip will have trouble on
|
|
|
|
# e.g. APFS filesystems (macOS) because of non UTF-8 characters in some of the
|
|
|
|
# test fixtures that are part of the repository.
|
|
|
|
# See discussion in https://github.com/NixOS/nixpkgs/issues/107768
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/scop/${pname}/releases/download/${version}/${pname}-${version}.tar.xz";
|
|
|
|
sha256 = "1b0iz7da1sgifx1a5wdyx1kxbzys53v0kyk8nhxfipllmm5qka3k";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
# tests are super flaky unfortunately, and regularily break.
|
|
|
|
# let's disable them for now.
|
|
|
|
doCheck = false;
|
2020-04-24 23:36:52 +00:00
|
|
|
checkInputs = [
|
|
|
|
# perl is assumed by perldoc completion
|
|
|
|
perl
|
|
|
|
# ps assumed to exist by gdb, killall, pgrep, pidof,
|
|
|
|
# pkill, pwdx, renice, and reptyr completions
|
|
|
|
ps
|
|
|
|
python3Packages.pexpect
|
|
|
|
python3Packages.pytest
|
|
|
|
bashInteractive
|
|
|
|
];
|
|
|
|
|
|
|
|
# - 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
|
|
|
|
checkPhase = ''
|
2020-07-18 16:06:22 +00:00
|
|
|
pytest . \
|
2022-08-12 12:06:08 +00:00
|
|
|
${lib.optionalString stdenv.hostPlatform.isAarch "--ignore=test/t/test_gcc.py"} \
|
2020-04-24 23:36:52 +00: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 \
|
|
|
|
--ignore=test/t/unit/test_unit_ip_addresses.py \
|
|
|
|
--ignore=test/t/test_ls.py \
|
|
|
|
--ignore=test/t/test_screen.py
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
prePatch = lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/scop/bash-completion";
|
|
|
|
description = "Programmable completion for the bash shell";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
2021-10-17 02:12:59 +00:00
|
|
|
maintainers = [ maintainers.xfix ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|