pinwheel: Add pants (called through nix-alien) to work module

This commit is contained in:
Alexander Heldt
2024-06-15 13:18:56 +02:00
parent 91af884431
commit d470650406
4 changed files with 178 additions and 7 deletions

View File

@@ -0,0 +1,39 @@
{
stdenv,
fetchurl,
writeShellScriptBin,
nix-alien,
...
}:
let
version = "0.11.0";
unpatched = stdenv.mkDerivation {
name = "scie-pants";
version = version;
sourceRoot = ".";
phases = [
"installPhase"
"patchPhase"
];
src = fetchurl {
url = "https://github.com/pantsbuild/scie-pants/releases/download/v${version}/scie-pants-linux-x86_64";
sha256 = "sha256-ifP5gjTdLMXyVSKda6pPBNNcnJZ0giuqikFBk7cXgHI=";
};
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp $src $out/bin/pants
chmod +x $out/bin/pants
runHook postInstall
'';
};
in
writeShellScriptBin "pants" ''
export LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH
${nix-alien}/bin/nix-alien ${unpatched}/bin/pants -- "$@"
''