1 { lib, stdenv, fetchurl
10 stdenv.mkDerivation rec {
11 pname = "bash-completion";
14 # Using fetchurl because fetchGithub or fetchzip will have trouble on
15 # e.g. APFS filesystems (macOS) because of non UTF-8 characters in some of the
16 # test fixtures that are part of the repository.
17 # See discussion in https://github.com/NixOS/nixpkgs/issues/107768
19 url = "https://github.com/scop/${pname}/releases/download/${version}/${pname}-${version}.tar.xz";
20 sha256 = "1b0iz7da1sgifx1a5wdyx1kxbzys53v0kyk8nhxfipllmm5qka3k";
24 nativeBuildInputs = [ autoreconfHook ];
26 # tests are super flaky unfortunately, and regularly break.
27 # let's disable them for now.
30 # perl is assumed by perldoc completion
32 # ps assumed to exist by gdb, killall, pgrep, pidof,
33 # pkill, pwdx, renice, and reptyr completions
35 python3Packages.pexpect
36 python3Packages.pytest
40 # - ignore test_gcc on ARM because it assumes -march=native
41 # - ignore test_chsh because it assumes /etc/shells exists
42 # - ignore test_ether_wake, test_ifdown, test_ifstat, test_ifup,
43 # test_iperf, test_iperf3, test_nethogs and ip_addresses
44 # because they try to touch network
45 # - ignore test_ls because impure logic
46 # - ignore test_screen because it assumes vt terminals exist
49 ${lib.optionalString stdenv.hostPlatform.isAarch "--ignore=test/t/test_gcc.py"} \
50 --ignore=test/t/test_chsh.py \
51 --ignore=test/t/test_ether_wake.py \
52 --ignore=test/t/test_ifdown.py \
53 --ignore=test/t/test_ifstat.py \
54 --ignore=test/t/test_ifup.py \
55 --ignore=test/t/test_iperf.py \
56 --ignore=test/t/test_iperf3.py \
57 --ignore=test/t/test_nethogs.py \
58 --ignore=test/t/unit/test_unit_ip_addresses.py \
59 --ignore=test/t/test_ls.py \
60 --ignore=test/t/test_screen.py
63 prePatch = lib.optionalString stdenv.isDarwin ''
64 sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*
68 homepage = "https://github.com/scop/bash-completion";
69 description = "Programmable completion for the bash shell";
70 license = licenses.gpl2Plus;
71 platforms = platforms.unix;
72 maintainers = [ maintainers.xfix ];