From cf493d784f07773841806a84ecf1dc06728599a1 Mon Sep 17 00:00:00 2001 From: binarycat Date: Wed, 6 Mar 2024 16:35:00 -0500 Subject: [PATCH 1/2] lua: change LUA_ROOT, not LUA_PATH_DEFAULT --- pkgs/development/interpreters/lua-5/interpreter.nix | 9 +-------- pkgs/development/interpreters/luajit/default.nix | 11 +---------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 4091fdd49e0e4..ec9da0cb11b50 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -62,14 +62,7 @@ stdenv.mkDerivation (finalAttrs: # we can't pass flags to the lua makefile because for portability, everything is hardcoded postPatch = '' - { - 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 + sed -e '/#define LUA_ROOT/c #define LUA_ROOT "${placeholder "out"}/"' -i src/luaconf.h '' + lib.optionalString (!stdenv.isDarwin && !staticOnly) '' # Add a target for a shared library to the Makefile. sed -e '1s/^/LUA_SO = liblua.so/' \ diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index 211fa56e91197..89691bf8b710b 100644 --- a/pkgs/development/interpreters/luajit/default.nix +++ b/pkgs/development/interpreters/luajit/default.nix @@ -75,16 +75,7 @@ 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; From a1c48698e6a73ff3a9f3908555c5404df4bc269e Mon Sep 17 00:00:00 2001 From: binarycat Date: Wed, 6 Mar 2024 16:55:15 -0500 Subject: [PATCH 2/2] lua: fix whitespace --- pkgs/development/interpreters/lua-5/interpreter.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index ec9da0cb11b50..6ff672c8d466f 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -62,7 +62,7 @@ stdenv.mkDerivation (finalAttrs: # we can't pass flags to the lua makefile because for portability, everything is hardcoded postPatch = '' - sed -e '/#define LUA_ROOT/c #define LUA_ROOT "${placeholder "out"}/"' -i src/luaconf.h + sed -e '/#define LUA_ROOT/c #define LUA_ROOT "${placeholder "out"}/"' -i src/luaconf.h '' + lib.optionalString (!stdenv.isDarwin && !staticOnly) '' # Add a target for a shared library to the Makefile. sed -e '1s/^/LUA_SO = liblua.so/' \