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