nixpkgs/pkgs/shells/bash/bash-completion/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
2.4 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchurl
, fetchpatch
2019-08-14 01:57:46 +01:00
, autoreconfHook
2020-04-06 16:01:06 +01:00
, perl
, ps
2019-08-14 01:57:46 +01:00
, python3Packages
, bashInteractive
}:
2013-04-10 16:39:03 +01:00
stdenv.mkDerivation rec {
pname = "bash-completion";
version = "2.11";
# 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";
};
2019-08-14 01:57:46 +01:00
nativeBuildInputs = [ autoreconfHook ];
# tests are super flaky unfortunately, and regularily break.
# let's disable them for now.
doCheck = false;
2019-08-14 01:57:46 +01:00
checkInputs = [
2020-04-06 16:01:06 +01: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 01:57:46 +01:00
python3Packages.pexpect
python3Packages.pytest
bashInteractive
];
2020-04-06 16:01:06 +01: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 01:57:46 +01:00
checkPhase = ''
pytest . \
2021-01-15 06:28:56 +00:00
${lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) "--ignore=test/t/test_gcc.py"} \
2020-04-06 16:01:06 +01: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 01:57:46 +01:00
--ignore=test/t/unit/test_unit_ip_addresses.py \
2020-04-06 16:01:06 +01:00
--ignore=test/t/test_ls.py \
--ignore=test/t/test_screen.py
2019-08-14 01:57:46 +01:00
'';
2021-01-15 06:28:56 +00:00
prePatch = lib.optionalString stdenv.isDarwin ''
sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*
'';
meta = with 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.xfix ];
};
}