mirror of
https://codeberg.org/spire/nix.git
synced 2026-06-03 18:04:10 +02:00
better sourcepawn.buildEnv
This commit is contained in:
parent
f1707cebd8
commit
6e4a4d1ead
1 changed files with 14 additions and 3 deletions
|
|
@ -4,6 +4,8 @@
|
||||||
ambuild,
|
ambuild,
|
||||||
python3Packages,
|
python3Packages,
|
||||||
buildEnv,
|
buildEnv,
|
||||||
|
writeShellScriptBin,
|
||||||
|
symlinkJoin
|
||||||
}: let
|
}: let
|
||||||
self = stdenv.mkDerivation rec {
|
self = stdenv.mkDerivation rec {
|
||||||
pname = "sourcepawn";
|
pname = "sourcepawn";
|
||||||
|
|
@ -39,11 +41,20 @@
|
||||||
cp spcomp/*/spcomp spshell/*/spshell verifier/*/verifier $out/bin
|
cp spcomp/*/spcomp spshell/*/spshell verifier/*/verifier $out/bin
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.buildEnv = imports:
|
passthru.buildEnv = imports: let
|
||||||
buildEnv {
|
unwrapped = symlinkJoin {
|
||||||
|
name = "sourcepawn-env-unwrapped";
|
||||||
|
paths = imports ++ [self];
|
||||||
|
postBuild = ''
|
||||||
|
mv $out/bin/spcomp{,.unwrapped}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
wrapped = writeShellScriptBin "spcomp" "exec -a $0 ${unwrapped}/bin/spcomp.unwrapped $@";
|
||||||
|
in symlinkJoin {
|
||||||
name = "sourcepawn-env";
|
name = "sourcepawn-env";
|
||||||
paths = imports ++ [self];
|
paths = [unwrapped wrapped];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
self
|
self
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue