summary refs log tree commit diff
path: root/pkgs/shells
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2019-12-02 04:12:17 +0100
committerNiklas Hambüchen <mail@nh2.me>2019-12-02 04:20:08 +0100
commit0a854379c43a257de5fba04a35703134d1faa291 (patch)
tree245e44d877f8bae63e56f9bb8040ab5bff6ccafe /pkgs/shells
parentbb1013511e1e5edcf314df8321acf2f3c536df0d (diff)
downloadnixpkgs-0a854379c43a257de5fba04a35703134d1faa291.tar
nixpkgs-0a854379c43a257de5fba04a35703134d1faa291.tar.gz
nixpkgs-0a854379c43a257de5fba04a35703134d1faa291.tar.bz2
nixpkgs-0a854379c43a257de5fba04a35703134d1faa291.tar.lz
nixpkgs-0a854379c43a257de5fba04a35703134d1faa291.tar.xz
nixpkgs-0a854379c43a257de5fba04a35703134d1faa291.tar.zst
nixpkgs-0a854379c43a257de5fba04a35703134d1faa291.zip
bash-completion: Fix tests with musl.
Fixes test error

    self = <test_iconv.TestIconv object at 0x7ffff52f3410>
    completion = <CompletionResult []>

        @pytest.mark.complete("iconv -")
        def test_1(self, completion):
    >       assert completion
    E       assert <CompletionResult []>

    ../t/test_iconv.py:7: AssertionError

by applying upstream commit not present in a newer release.
Diffstat (limited to 'pkgs/shells')
-rw-r--r--pkgs/shells/bash/bash-completion/default.nix12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/shells/bash/bash-completion/default.nix b/pkgs/shells/bash/bash-completion/default.nix
index fbc07c86494..fb9707c3224 100644
--- a/pkgs/shells/bash/bash-completion/default.nix
+++ b/pkgs/shells/bash/bash-completion/default.nix
@@ -1,4 +1,6 @@
 { stdenv, fetchFromGitHub
+, lib
+, fetchpatch
 , autoreconfHook
 , python3Packages
 , bashInteractive
@@ -6,6 +8,7 @@
 
 stdenv.mkDerivation rec {
   pname = "bash-completion";
+  # TODO: Remove musl patch below upon next release!
   version = "2.9";
 
   src = fetchFromGitHub {
@@ -26,6 +29,15 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch
+  ] ++ lib.optionals stdenv.hostPlatform.isMusl [
+    # TODO: Remove when https://github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393
+    #       is availabe in a release in nixpkgs. see https://github.com/scop/bash-completion/issues/312.
+    # Fixes a test failure with musl.
+    (fetchpatch {
+     url = "https://github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393.patch";
+     name = "bash-completion-musl-test_iconv-skip-option-completion-if-help-fails";
+     sha256 = "1l53d62zf01k625nzw3vcrxky93h7bzdpchgk4argxalrn17ckvb";
+    })
   ];
 
   # ignore ip_addresses because it tries to touch network