diff --git a/pkgs/development/interpreters/emilua/default.nix b/pkgs/development/interpreters/emilua/default.nix index bdacb3a5c087..bb8b22069f86 100644 --- a/pkgs/development/interpreters/emilua/default.nix +++ b/pkgs/development/interpreters/emilua/default.nix @@ -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; diff --git a/pkgs/development/interpreters/emilua/setup-hook.sh b/pkgs/development/interpreters/emilua/setup-hook.sh new file mode 100644 index 000000000000..034b52796468 --- /dev/null +++ b/pkgs/development/interpreters/emilua/setup-hook.sh @@ -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