at 23.11-beta 74 lines 2.4 kB view raw
1{ lib, stdenv, fetchurl 2, fetchpatch 3, autoreconfHook 4, perl 5, ps 6, python3Packages 7, bashInteractive 8}: 9 10stdenv.mkDerivation rec { 11 pname = "bash-completion"; 12 version = "2.11"; 13 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 18 src = fetchurl { 19 url = "https://github.com/scop/${pname}/releases/download/${version}/${pname}-${version}.tar.xz"; 20 sha256 = "1b0iz7da1sgifx1a5wdyx1kxbzys53v0kyk8nhxfipllmm5qka3k"; 21 }; 22 23 strictDeps = true; 24 nativeBuildInputs = [ autoreconfHook ]; 25 26 # tests are super flaky unfortunately, and regularly break. 27 # let's disable them for now. 28 doCheck = false; 29 nativeCheckInputs = [ 30 # perl is assumed by perldoc completion 31 perl 32 # ps assumed to exist by gdb, killall, pgrep, pidof, 33 # pkill, pwdx, renice, and reptyr completions 34 ps 35 python3Packages.pexpect 36 python3Packages.pytest 37 bashInteractive 38 ]; 39 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 47 checkPhase = '' 48 pytest . \ 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 61 ''; 62 63 prePatch = lib.optionalString stdenv.isDarwin '' 64 sed -i -e 's/readlink -f/readlink/g' bash_completion completions/* 65 ''; 66 67 meta = with lib; { 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 ]; 73 }; 74}