diff options
author | Matthieu Coudron <886074+teto@users.noreply.github.com> | 2024-03-06 22:01:08 +0100 |
---|---|---|
committer | Matthieu Coudron <886074+teto@users.noreply.github.com> | 2024-03-16 14:37:09 +0100 |
commit | 640cdcb814ce7476d002a306816ed9d88baaf4f3 (patch) | |
tree | de786392fdbe331fd011065b4df87edd03801aa6 /pkgs/development/interpreters/luajit | |
parent | b00700a4e41499fe4141d83c2a43ad6b1b91162c (diff) |
lua: smarter/more correct patching
In order to have the 'reset' LUA_PATH (aka `;;`) work, and for purity
reasons(removing /usr paths) we(I) decided to patch the lua interpreters default LUA_PATH.
Turns out the interpreters have different defaults and the patch was too
coarse.
There is smarter patching that can be done via LUA_ROOT.
Also luajit doesn't need patching at all since LUA_ROOT is set via the
build system.
Diffstat (limited to 'pkgs/development/interpreters/luajit')
-rw-r--r-- | pkgs/development/interpreters/luajit/default.nix | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index 211fa56e9119..15bcfee3a44c 100644 --- a/pkgs/development/interpreters/luajit/default.nix +++ b/pkgs/development/interpreters/luajit/default.nix @@ -62,7 +62,7 @@ let else buildPackages.stdenv; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "luajit"; inherit version src; @@ -75,15 +75,6 @@ stdenv.mkDerivation rec { # passed by nixpkgs CC wrapper is insufficient on its own substituteInPlace src/Makefile --replace "#CCDEBUG= -g" "CCDEBUG= -g" fi - - { - echo -e ' - #undef LUA_PATH_DEFAULT - #define LUA_PATH_DEFAULT "./share/lua/${luaversion}/?.lua;./?.lua;./?/init.lua" - #undef LUA_CPATH_DEFAULT - #define LUA_CPATH_DEFAULT "./lib/lua/${luaversion}/?.so;./?.so;./lib/lua/${luaversion}/loadall.so" - ' - } >> src/luaconf.h ''; dontConfigure = true; @@ -122,7 +113,8 @@ stdenv.mkDerivation rec { inputs' = lib.filterAttrs (n: v: ! lib.isDerivation v && n != "passthruFun") inputs; override = attr: let lua = attr.override (inputs' // { self = lua; }); in lua; in passthruFun rec { - inherit self luaversion packageOverrides luaAttr; + inherit self packageOverrides luaAttr; + inherit (finalAttrs) luaversion; executable = "lua"; luaOnBuildForBuild = override pkgsBuildBuild.${luaAttr}; luaOnBuildForHost = override pkgsBuildHost.${luaAttr}; @@ -142,4 +134,4 @@ stdenv.mkDerivation rec { ]; maintainers = with maintainers; [ thoughtpolice smironov vcunat lblasc ]; } // extraMeta; -} +}) |