From 97a05c4456d22adf30921bd40367bcb99d464a78 Mon Sep 17 00:00:00 2001 From: teutat3s Date: Wed, 6 Mar 2024 18:47:05 +0100 Subject: [PATCH] fix: improve ble.sh build --- overlays/blesh.nix | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/overlays/blesh.nix b/overlays/blesh.nix index f29c29ec..a26034ed 100644 --- a/overlays/blesh.nix +++ b/overlays/blesh.nix @@ -3,17 +3,33 @@ final: prev: { inherit (prev.sources.blesh-nvfetcher) version src; dontBuild = false; - buildInputs = [prev.git]; + buildInputs = [ + prev.gitMinimal + ]; + patchPhase = '' substituteInPlace GNUmakefile \ --replace "git submodule update --init --recursive" "" ''; - nativeCheckInputs = oldAttrs.nativeCheckInputs ++ [prev.busybox]; + + installFlags = [ + "PREFIX=$(out)" + ]; installPhase = '' - runHook preInstall + source $stdenv/setup + installPhase + ''; - mkdir -p "$out/share/blesh/lib" + postInstall = '' + mkdir -p "$out/bin" + cat <"$out/bin/blesh-share" + #!${prev.runtimeShell} + # Run this script to find the ble.sh shared folder + # where all the shell scripts are living. + echo "$out/share/blesh" + EOF + chmod +x "$out/bin/blesh-share" cat <"$out/share/blesh/lib/_package.sh" _ble_base_package_type=nix @@ -23,10 +39,6 @@ final: prev: { return 1 } EOF - - make install INSDIR=$out/share/blesh - - runHook postInstall ''; }); }