diff options
author | Alexei Robyn <shados@shados.net> | 2019-08-21 23:03:11 +1000 |
---|---|---|
committer | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2019-09-01 17:42:20 +0200 |
commit | c62337d9c7ff70e9bdfe317388c4fa5d6202142a (patch) | |
tree | 4d1a9169d2b04723184e18f3b68d9e8e9c319310 /pkgs/top-level/lua-packages.nix | |
parent | 59d85b9910e8b76be9b2970bb268c6689bebc205 (diff) | |
download | nixpkgs-c62337d9c7ff70e9bdfe317388c4fa5d6202142a.tar nixpkgs-c62337d9c7ff70e9bdfe317388c4fa5d6202142a.tar.gz nixpkgs-c62337d9c7ff70e9bdfe317388c4fa5d6202142a.tar.bz2 nixpkgs-c62337d9c7ff70e9bdfe317388c4fa5d6202142a.tar.lz nixpkgs-c62337d9c7ff70e9bdfe317388c4fa5d6202142a.tar.xz nixpkgs-c62337d9c7ff70e9bdfe317388c4fa5d6202142a.tar.zst nixpkgs-c62337d9c7ff70e9bdfe317388c4fa5d6202142a.zip |
lua*Packages: Consolidate separate setup hooks together
- Lua packages now consistently use LUA_PATH/LUA_CPATH rather than a mix of those and NIX_LUA_PATH/NIX_LUA_CPATH - Lua libraries are now consistently only added to the search path variables if: 1) The library actually has a corresponding directory to search 2) The library is not already present in the search path This should help prevent the search paths from growing overly large - Fixed bugs in some path helpers - Changed the affected shell script indentation to 2 spaces; nixpkgs shell scripts are inconsistently split between 2 and 4 space indentation, but 2 matches better with the Nix expressions, so IMO it makes more sense
Diffstat (limited to 'pkgs/top-level/lua-packages.nix')
-rw-r--r-- | pkgs/top-level/lua-packages.nix | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index 2d34bdaabc0..c9e9305666e 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -64,17 +64,18 @@ in with self; { getLuaPathList = majorVersion: [ - "lib/lua/${majorVersion}/?.lua" "share/lua/${majorVersion}/?.lua" - "share/lua/${majorVersion}/?/init.lua" "lib/lua/${majorVersion}/?/init.lua" + "share/lua/${majorVersion}/?.lua" + "share/lua/${majorVersion}/?/init.lua" ]; getLuaCPathList = majorVersion: [ - "lib/lua/${majorVersion}/?.so" "share/lua/${majorVersion}/?.so" "share/lua/${majorVersion}/?/init.so" + "lib/lua/${majorVersion}/?.so" ]; # helper functions for dealing with LUA_PATH and LUA_CPATH - getPath = lib : type : "${lib}/lib/lua/${lua.luaversion}/?.${type};${lib}/share/lua/${lua.luaversion}/?.${type}"; - getLuaPath = lib : getPath lib "lua"; - getLuaCPath = lib : getPath lib "so"; + getPath = drv: pathListForVersion: + lib.concatMapStringsSep ";" (path: "${drv}/${path}") (pathListForVersion lua.luaversion); + getLuaPath = drv: getPath drv getLuaPathList; + getLuaCPath = drv: getPath drv getLuaCPathList; #define build lua package function buildLuaPackage = callPackage ../development/lua-modules/generic { |