bashunit: init at 0.19.0 (#396063)

authored by Pol Dellaiera and committed by GitHub bb937293 591add26

+78
+78
pkgs/by-name/ba/bashunit/package.nix
···
··· 1 + { 2 + stdenvNoCC, 3 + lib, 4 + fetchFromGitHub, 5 + bash, 6 + which, 7 + versionCheckHook, 8 + coreutils, 9 + makeBinaryWrapper, 10 + nix-update-script, 11 + }: 12 + 13 + stdenvNoCC.mkDerivation (finalAttrs: { 14 + pname = "bashunit"; 15 + version = "0.19.0"; 16 + src = fetchFromGitHub { 17 + owner = "TypedDevs"; 18 + repo = "bashunit"; 19 + tag = finalAttrs.version; 20 + hash = "sha256-EoCCqESzmCW12AuAqA3qh2VcE8gyUPIGJEoCcZhMA/Y="; 21 + forceFetchGit = true; # needed to include the tests directory for the check phase 22 + }; 23 + 24 + nativeBuildInputs = [ makeBinaryWrapper ]; 25 + 26 + postConfigure = '' 27 + patchShebangs src tests build.sh bashunit 28 + substituteInPlace Makefile \ 29 + --replace-fail "SHELL=/bin/bash" "SHELL=${lib.getExe bash}" 30 + ''; 31 + 32 + buildPhase = '' 33 + runHook preBuild 34 + ./build.sh 35 + runHook postBuild 36 + ''; 37 + 38 + installPhase = '' 39 + runHook preInstall 40 + install -m755 -D bin/bashunit $out/bin/bashunit 41 + runHook postInstall 42 + ''; 43 + 44 + # some tests are currently broken on linux and it is not easy to disable them 45 + # reenable them after https://github.com/TypedDevs/bashunit/pull/397 has been merged 46 + doCheck = false; 47 + nativeCheckInputs = [ which ]; 48 + checkPhase = '' 49 + runHook preCheck 50 + make test 51 + runHook postCheck 52 + ''; 53 + 54 + postFixup = '' 55 + wrapProgram $out/bin/bashunit \ 56 + --prefix PATH : "${ 57 + lib.makeBinPath [ 58 + coreutils 59 + which 60 + ] 61 + }" 62 + ''; 63 + 64 + nativeInstallCheckInputs = [ versionCheckHook ]; 65 + doInstallCheck = true; 66 + versionCheckProgramArg = "--version"; 67 + 68 + passthru.updateScript = nix-update-script { }; 69 + 70 + meta = { 71 + description = "Simple testing framework for bash scripts"; 72 + homepage = "https://bashunit.typeddevs.com"; 73 + changelog = "https://github.com/TypedDevs/bashunit/releases/tag/${finalAttrs.version}"; 74 + license = lib.licenses.mit; 75 + maintainers = with lib.maintainers; [ tricktron ]; 76 + mainProgram = "bashunit"; 77 + }; 78 + })