Commit f3d6b2eb authored by lucasew's avatar lucasew
Browse files

emilua: add setup hook that populates EMILUA_PATH



Signed-off-by: default avatarlucasew <lucas59356@gmail.com>
parent 278b2dfe
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;
+17 −0
Original line number Diff line number Diff line
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