bash-preexec: improve overridability (#441252)

authored by Ramses and committed by GitHub 1bdb7730 6d7ec06d

+18 -9
+18 -9
pkgs/by-name/ba/bash-preexec/package.nix
··· 15 src = fetchFromGitHub { 16 owner = "rcaloras"; 17 repo = "bash-preexec"; 18 - rev = version; 19 - sha256 = "sha256-4DzbeIiUX7iXy2CeSvRC2X+XnjVk+/UiMbM/dLHx7zU="; 20 }; 21 22 nativeCheckInputs = [ bats ]; ··· 26 dontBuild = true; 27 28 patchPhase = '' 29 # Needed since the tests expect that HISTCONTROL is set. 30 sed -i '/setup()/a HISTCONTROL=""' test/bash-preexec.bats 31 32 # Skip tests failing with Bats 1.5.0. 33 # See https://github.com/rcaloras/bash-preexec/issues/121 34 sed -i '/^@test.*IFS/,/^}/d' test/bash-preexec.bats 35 ''; 36 37 checkPhase = '' 38 bats test 39 ''; 40 41 installPhase = '' 42 - install -Dm755 $src/bash-preexec.sh $out/share/bash/bash-preexec.sh 43 ''; 44 45 - meta = with lib; { 46 description = "Preexec and precmd functions for Bash just like Zsh"; 47 - license = licenses.mit; 48 homepage = "https://github.com/rcaloras/bash-preexec"; 49 - maintainers = [ 50 - maintainers.hawkw 51 - maintainers.rycee 52 ]; 53 - platforms = platforms.unix; 54 }; 55 }
··· 15 src = fetchFromGitHub { 16 owner = "rcaloras"; 17 repo = "bash-preexec"; 18 + tag = version; 19 + hash = "sha256-4DzbeIiUX7iXy2CeSvRC2X+XnjVk+/UiMbM/dLHx7zU="; 20 }; 21 22 nativeCheckInputs = [ bats ]; ··· 26 dontBuild = true; 27 28 patchPhase = '' 29 + runHook prePatch 30 + 31 # Needed since the tests expect that HISTCONTROL is set. 32 sed -i '/setup()/a HISTCONTROL=""' test/bash-preexec.bats 33 34 # Skip tests failing with Bats 1.5.0. 35 # See https://github.com/rcaloras/bash-preexec/issues/121 36 sed -i '/^@test.*IFS/,/^}/d' test/bash-preexec.bats 37 + 38 + runHook postPatch 39 ''; 40 41 checkPhase = '' 42 + runHook preCheck 43 bats test 44 + runHook postCheck 45 ''; 46 47 installPhase = '' 48 + runHook preInstall 49 + install -Dm755 bash-preexec.sh $out/share/bash/bash-preexec.sh 50 + runHook postInstall 51 ''; 52 53 + meta = { 54 description = "Preexec and precmd functions for Bash just like Zsh"; 55 + license = lib.licenses.mit; 56 homepage = "https://github.com/rcaloras/bash-preexec"; 57 + changelog = "https://github.com/rcaloras/bash-preexec/releases/tag/${version}"; 58 + maintainers = with lib.maintainers; [ 59 + hawkw 60 + rycee 61 ]; 62 + platforms = lib.platforms.unix; 63 }; 64 }