@@ -1,4 +1,6 @@
11{ stdenv, fetchFromGitHub
2+, lib
3+, fetchpatch
24, autoreconfHook
35, python3Packages
46, bashInteractive
@@ -6,6 +8,7 @@
68
79stdenv.mkDerivation rec {
810 pname = "bash-completion";
11+ # TODO: Remove musl patch below upon next release!
912 version = "2.9";
1013
1114 src = fetchFromGitHub {
@@ -26,6 +29,15 @@ stdenv.mkDerivation rec {
2629
2730 patches = [
2831 ./0001-Revert-build-Do-cmake-pc-and-profile-variable-replac.patch
32+ ] ++ lib.optionals stdenv.hostPlatform.isMusl [
33+ # TODO: Remove when https://github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393
34+ # is availabe in a release in nixpkgs. see https://github.com/scop/bash-completion/issues/312.
35+ # Fixes a test failure with musl.
36+ (fetchpatch {
37+ url = "https://github.com/scop/bash-completion/commit/2cdac1b9f24df62a1fa80c1824ee8524c9b02393.patch";
38+ name = "bash-completion-musl-test_iconv-skip-option-completion-if-help-fails";
39+ sha256 = "1l53d62zf01k625nzw3vcrxky93h7bzdpchgk4argxalrn17ckvb";
40+ })
2941 ];
3042
3143 # ignore ip_addresses because it tries to touch network