lol

Merge pull request #127425 from malbarbo/lua

authored by

Sandro and committed by
GitHub
f7ba1da3 be086cc6

+8 -6
-4
pkgs/development/interpreters/lua-5/default.nix
··· 19 19 20 20 patches = 21 21 lib.optionals stdenv.isDarwin [ ./5.2.darwin.patch ]; 22 - 23 - postBuild = lib.optionalString (!stdenv.isDarwin) '' 24 - ( cd src; make $makeFlags "''${makeFlagsArray[@]}" liblua.so ) 25 - ''; 26 22 }; 27 23 28 24 lua5_3_compat = lua5_3.override({
+8 -2
pkgs/development/interpreters/lua-5/interpreter.nix
··· 7 7 , patches ? [] 8 8 , postConfigure ? null 9 9 , postBuild ? null 10 + , staticOnly ? stdenv.hostPlatform.isStatic 10 11 }: 11 12 let 12 13 luaPackages = callPackage ../../lua-modules {lua=self; overrides=packageOverrides;}; ··· 38 39 39 40 inherit patches; 40 41 41 - postPatch = lib.optionalString (!stdenv.isDarwin) '' 42 + postPatch = lib.optionalString (!stdenv.isDarwin && !staticOnly) '' 42 43 # Add a target for a shared library to the Makefile. 43 44 sed -e '1s/^/LUA_SO = liblua.so/' \ 44 45 -e 's/ALL_T *= */&$(LUA_SO) /' \ ··· 56 57 "PLAT=${plat}" 57 58 "CC=${stdenv.cc.targetPrefix}cc" 58 59 "RANLIB=${stdenv.cc.targetPrefix}ranlib" 60 + # Lua links with readline wich depends on ncurses. For some reason when 61 + # building pkgsStatic.lua it fails because symbols from ncurses are not 62 + # found. Adding ncurses here fixes the problem. 63 + "MYLIBS=-lncurses" 59 64 ]; 60 65 61 66 configurePhase = '' ··· 66 71 makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.cc.targetPrefix}ar rcu'"}) 67 72 68 73 installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \ 69 - TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" else "liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}"}" ) 74 + TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" 75 + else ("liblua.a" + lib.optionalString (!staticOnly) " liblua.so liblua.so.${luaversion} liblua.so.${version}" )}" ) 70 76 71 77 runHook postConfigure 72 78 '';