about summary refs log tree commit diff
path: root/pkgs/by-name/ha
diff options
context:
space:
mode:
authorGustavo Coutinho de Souza <dev@onemoresuza.mailer.me>2024-01-14 22:51:05 -0300
committerGustavo Coutinho de Souza <dev@onemoresuza.mailer.me>2024-01-14 23:05:58 -0300
commitea74836d9a54861661f635431fee7f2c5a02243e (patch)
tree398a2df97daf4ff351839384b80e7b94178376dd /pkgs/by-name/ha
parent87b9bf8ea4bf9f961376e44a2c9d5ea9a5cf9207 (diff)
downloadnixlib-ea74836d9a54861661f635431fee7f2c5a02243e.tar
nixlib-ea74836d9a54861661f635431fee7f2c5a02243e.tar.gz
nixlib-ea74836d9a54861661f635431fee7f2c5a02243e.tar.bz2
nixlib-ea74836d9a54861661f635431fee7f2c5a02243e.tar.lz
nixlib-ea74836d9a54861661f635431fee7f2c5a02243e.tar.xz
nixlib-ea74836d9a54861661f635431fee7f2c5a02243e.tar.zst
nixlib-ea74836d9a54861661f635431fee7f2c5a02243e.zip
haredo: wrap program with a shell
The program relies on the presence of a shell, specifically `sh`, on its
PATH[1].

Also set `enableParallelChecking` to true, which can speed up the build
proccess significantly, specially when using emulated native compilation
through `binfmt`.

[1]: https://git.sr.ht/~autumnull/haredo/tree/34136cfca3500935643f8c39eca3748047f3a829/item/src/haredo.ha#L282
Diffstat (limited to 'pkgs/by-name/ha')
-rw-r--r--pkgs/by-name/ha/haredo/package.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/by-name/ha/haredo/package.nix b/pkgs/by-name/ha/haredo/package.nix
index 277250170e5d..e31ae96c7832 100644
--- a/pkgs/by-name/ha/haredo/package.nix
+++ b/pkgs/by-name/ha/haredo/package.nix
@@ -4,6 +4,8 @@
 , hare
 , scdoc
 , nix-update-script
+, makeWrapper
+, bash
 }:
 stdenv.mkDerivation (finalAttrs: {
   pname = "haredo";
@@ -20,9 +22,16 @@ stdenv.mkDerivation (finalAttrs: {
 
   nativeBuildInputs = [
     hare
+    makeWrapper
     scdoc
   ];
 
+  enableParallelChecking = true;
+
+  doCheck = true;
+
+  dontConfigure = true;
+
   preBuild = ''
     HARECACHE="$(mktemp -d --tmpdir harecache.XXXXXXXX)"
     export HARECACHE
@@ -40,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: {
   checkPhase = ''
     runHook preCheck
 
-    ./bin/haredo test
+    ./bin/haredo ''${enableParallelChecking:+-j$NIX_BUILD_CORES} test
 
     runHook postCheck
   '';
@@ -53,8 +62,10 @@ stdenv.mkDerivation (finalAttrs: {
     runHook postInstall
   '';
 
-  dontConfigure = true;
-  doCheck = true;
+  postFixup = ''
+    wrapProgram $out/bin/haredo \
+      --prefix PATH : "${lib.makeBinPath [bash]}"
+  '';
 
   setupHook = ./setup-hook.sh;