lol

haredo: remove shell wrapper overhead

There's only three mentions of `sh` in the source code, being only two
of them command calls; thus, is very trivial to patch them directly.

+29 -5
+20
pkgs/by-name/ha/haredo/001-use-nix-store-sh.patch
···
··· 1 + diff --git a/src/haredo.ha b/src/haredo.ha 2 + index c2e56e6..304c9ad 100644 3 + --- a/src/haredo.ha 4 + +++ b/src/haredo.ha 5 + @@ -280,12 +280,12 @@ fn try_do( 6 + const tmpfilepath = strings::concat(ctx.tmpdir, "/", tmpfilename); 7 + 8 + const cmd = if (ctx.verbose) { 9 + - fmt::errorln("* sh -ev", dopaths.do, dopaths.target, 10 + + fmt::errorln("* @bash@/bin/sh -ev", dopaths.do, dopaths.target, 11 + dopaths.basename, tmpfilepath)?; 12 + - yield exec::cmd("sh", "-ev", dopaths.do, dopaths.target, 13 + + yield exec::cmd("@bash@/bin/sh", "-ev", dopaths.do, dopaths.target, 14 + dopaths.basename, tmpfilepath)?; 15 + } else { 16 + - yield exec::cmd("sh", "-e", dopaths.do, dopaths.target, 17 + + yield exec::cmd("@bash@/bin/sh", "-e", dopaths.do, dopaths.target, 18 + dopaths.basename, tmpfilepath)?; 19 + }; 20 +
+9 -5
pkgs/by-name/ha/haredo/package.nix
··· 7 nix-update-script, 8 makeWrapper, 9 bash, 10 }: 11 stdenv.mkDerivation (finalAttrs: { 12 pname = "haredo"; ··· 23 rev = finalAttrs.version; 24 hash = "sha256-gpui5FVRw3NKyx0AB/4kqdolrl5vkDudPOgjHc/IE4U="; 25 }; 26 27 nativeBuildInputs = [ 28 hare ··· 64 ./bootstrap.sh install 65 66 runHook postInstall 67 - ''; 68 - 69 - postFixup = '' 70 - wrapProgram $out/bin/haredo \ 71 - --prefix PATH : "${lib.makeBinPath [ bash ]}" 72 ''; 73 74 setupHook = ./setup-hook.sh;
··· 7 nix-update-script, 8 makeWrapper, 9 bash, 10 + substituteAll, 11 }: 12 stdenv.mkDerivation (finalAttrs: { 13 pname = "haredo"; ··· 24 rev = finalAttrs.version; 25 hash = "sha256-gpui5FVRw3NKyx0AB/4kqdolrl5vkDudPOgjHc/IE4U="; 26 }; 27 + 28 + patches = [ 29 + # Use nix store's bash instead of sh. `@bash@/bin/sh` is used, since haredo expects a posix shell. 30 + (substituteAll { 31 + src = ./001-use-nix-store-sh.patch; 32 + inherit bash; 33 + }) 34 + ]; 35 36 nativeBuildInputs = [ 37 hare ··· 73 ./bootstrap.sh install 74 75 runHook postInstall 76 ''; 77 78 setupHook = ./setup-hook.sh;