emilua: add setup hook that populates EMILUA_PATH

Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
lucasew 2024-09-05 17:16:58 -03:00
parent 278b2dfe71
commit f3d6b2ebef
2 changed files with 24 additions and 0 deletions

View File

@ -110,6 +110,13 @@ stdenv.mkDerivation (self: {
"--no-suite" "libpsx"
];
postInstall = ''
mkdir -p $out/nix-support
cp ${./setup-hook.sh} $out/nix-support/setup-hook
substituteInPlace $out/nix-support/setup-hook \
--replace @sitePackages@ "${self.passthru.sitePackages}"
'';
passthru = {
updateScript = gitUpdater {rev-prefix = "v";};
inherit boost;

View File

@ -0,0 +1,17 @@
addEmiluaPath() {
addToSearchPathWithCustomDelimiter : EMILUA_PATH $1/@sitePackages@
}
toEmiluaPath() {
local paths="$1"
local result=
for i in $paths; do
p="$i/@sitePackages@"
result="${result}${result:+:}$p"
done
echo $result
}
if [ -z "${dontAddEmiluaPath:-}" ]; then
addEnvHooks "$hostOffset" addEmiluaPath
fi