2023-01-28 21:05:02 +00:00
|
|
|
final: prev: {
|
|
|
|
blesh = prev.blesh.overrideAttrs (oldAttrs: rec {
|
2023-02-24 19:15:45 +00:00
|
|
|
inherit (prev.sources.blesh-nvfetcher) version src;
|
2023-07-02 01:05:30 +00:00
|
|
|
|
2023-06-20 21:32:13 +00:00
|
|
|
dontBuild = false;
|
2024-03-06 17:47:05 +00:00
|
|
|
buildInputs = [ prev.gitMinimal ];
|
|
|
|
|
2023-06-20 21:32:13 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace GNUmakefile \
|
|
|
|
--replace "git submodule update --init --recursive" ""
|
|
|
|
'';
|
2024-03-06 17:47:05 +00:00
|
|
|
|
|
|
|
installFlags = [ "PREFIX=$(out)" ];
|
2023-06-20 21:32:13 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2024-03-06 17:47:05 +00:00
|
|
|
source $stdenv/setup
|
|
|
|
installPhase
|
|
|
|
'';
|
2023-06-20 21:32:13 +00:00
|
|
|
|
2024-03-06 17:47:05 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
cat <<EOF >"$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"
|
2023-06-20 21:32:13 +00:00
|
|
|
|
|
|
|
cat <<EOF >"$out/share/blesh/lib/_package.sh"
|
|
|
|
_ble_base_package_type=nix
|
|
|
|
|
|
|
|
function ble/base/package:nix/update {
|
|
|
|
echo "Ble.sh is installed by Nix. You can update it there." >&2
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
EOF
|
|
|
|
'';
|
2023-01-28 21:05:02 +00:00
|
|
|
});
|
|
|
|
}
|