1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/shells/bash/bash-completion/default.nix
Vladimír Čunát 89023c38fc
Recover the complicated situation after my bad merge
I made a mistake merge.  Reverting it in c778945806 undid the state
on master, but now I realize it crippled the git merge mechanism.
As the merge contained a mix of commits from `master..staging-next`
and other commits from `staging-next..staging`, it got the
`staging-next` branch into a state that was difficult to recover.

I reconstructed the "desired" state of staging-next tree by:
 - checking out the last commit of the problematic range: 4effe769e2
 - `git rebase -i --preserve-merges a8a018ddc0` - dropping the mistaken
   merge commit and its revert from that range (while keeping
   reapplication from 4effe769e2)
 - merging the last unaffected staging-next commit (803ca85c20)
 - fortunately no other commits have been pushed to staging-next yet
 - applying a diff on staging-next to get it into that state
2020-10-26 09:01:04 +01:00

72 lines
2.1 KiB
Nix

{ stdenv, fetchFromGitHub
, fetchpatch
, autoreconfHook
, perl
, ps
, python3Packages
, bashInteractive
}:
stdenv.mkDerivation rec {
pname = "bash-completion";
version = "2.11";
src = fetchFromGitHub {
owner = "scop";
repo = "bash-completion";
rev = version;
sha256 = "0m3brd5jx7w07h8vxvvcmbyrlnadrx6hra3cvx6grzv6rin89liv";
};
nativeBuildInputs = [ autoreconfHook ];
# tests are super flaky unfortunately, and regularily break.
# let's disable them for now.
doCheck = false;
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 = ''
pytest . \
${stdenv.lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) "--ignore=test/t/test_gcc.py"} \
--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
'';
prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
sed -i -e 's/readlink -f/readlink/g' bash_completion completions/*
'';
meta = with stdenv.lib; {
homepage = "https://github.com/scop/bash-completion";
description = "Programmable completion for the bash shell";
license = licenses.gpl2Plus;
platforms = platforms.unix;
maintainers = [ maintainers.peti maintainers.xfix ];
};
}