diff options
Diffstat (limited to 'pkgs/development/interpreters/lua-5/wrap.sh')
-rw-r--r-- | pkgs/development/interpreters/lua-5/wrap.sh | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/pkgs/development/interpreters/lua-5/wrap.sh b/pkgs/development/interpreters/lua-5/wrap.sh index 7d59cf6095775..f6868e6faac56 100644 --- a/pkgs/development/interpreters/lua-5/wrap.sh +++ b/pkgs/development/interpreters/lua-5/wrap.sh @@ -9,24 +9,6 @@ wrapLuaPrograms() { wrapLuaProgramsIn "$out/bin" "$out $luaPath" } -# Builds environment variables like LUA_PATH and PATH walking through closure -# of dependencies. -buildLuaPath() { - local luaPath="$1" - local path - - # Create an empty table of paths (see doc on loadFromPropagatedInputs - # for how this is used). Build up the program_PATH and program_LUA_PATH - # variables. - declare -A luaPathsSeen=() - program_PATH= - luaPathsSeen["@lua@"]=1 - addToSearchPath program_PATH @lua@/bin - for path in $luaPath; do - addToLuaPath "$path" - done -} - # with an executable shell script which will set some environment variables # and then call into the original binary (which has been given a .wrapped suffix). # luaPath is a list of directories @@ -47,7 +29,6 @@ wrapLuaProgramsIn() { # Find all regular files in the output directory that are executable. find "$dir" -type f -perm -0100 -print0 | while read -d "" f; do # Rewrite "#! .../env lua" to "#! /nix/store/.../lua". - # Strip suffix, like "3" or "2.7m" -- we don't have any choice on which # Lua to use besides one with this hook anyway. if head -n1 "$f" | grep -q '#!.*/env.*\(lua\)'; then sed -i "$f" -e "1 s^.*/env[ ]*\(lua\)[^ ]*^#! @executable@^" @@ -73,28 +54,3 @@ wrapLuaProgramsIn() { done } - -# Adds the lib and bin directories to the LUA_PATH and PATH variables, -# respectively. Recurses on any paths declared in -# `propagated-native-build-inputs`, while avoiding duplicating paths by -# flagging the directories it has visited in `luaPathsSeen`. -loadFromPropagatedInputs() { - local dir="$1" - # Stop if we've already visited here. - if [ -n "${luaPathsSeen[$dir]}" ]; then - return - fi - luaPathsSeen[$dir]=1 - - addToLuaPath "$dir" - addToSearchPath program_PATH $dir/bin - - # Inspect the propagated inputs (if they exist) and recur on them. - local prop="$dir/nix-support/propagated-native-build-inputs" - if [ -e "$prop" ]; then - local new_path - for new_path in $(cat $prop); do - loadFromPropagatedInputs "$new_path" - done - fi -} |