diff options
author | Jonathan Ringer <jonringer117@gmail.com> | 2021-05-14 21:57:09 -0700 |
---|---|---|
committer | Jonathan Ringer <jonringer117@gmail.com> | 2021-05-14 21:57:09 -0700 |
commit | 0546e68ef7e7ecc794b3f1f5aa177bb0da71b54f (patch) | |
tree | afd406d270e8fcac8f850d5f92aeb0e26fb99143 /pkgs/development/interpreters/lua-5 | |
parent | c48eaa70e3d3954835efeeb1991f8c654dc65da7 (diff) | |
parent | 72948af15bf52f9111a42b3e9866b9c2d426ece9 (diff) |
Merge remote-tracking branch 'origin/master' into staging-next
Diffstat (limited to 'pkgs/development/interpreters/lua-5')
-rw-r--r-- | pkgs/development/interpreters/lua-5/5.4.darwin.patch | 48 | ||||
-rw-r--r-- | pkgs/development/interpreters/lua-5/default.nix | 6 |
2 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/lua-5/5.4.darwin.patch b/pkgs/development/interpreters/lua-5/5.4.darwin.patch new file mode 100644 index 000000000000..eb16ed9c6897 --- /dev/null +++ b/pkgs/development/interpreters/lua-5/5.4.darwin.patch @@ -0,0 +1,48 @@ +--- a/Makefile 2021-05-14 22:39:14.407200562 +0300 ++++ b/Makefile 2021-05-14 22:36:23.828513407 +0300 +@@ -41,7 +41,7 @@ + # What to install. + TO_BIN= lua luac + TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp +-TO_LIB= liblua.a ++TO_LIB= liblua.${version}.dylib + TO_MAN= lua.1 luac.1 + + # Lua version and release. +@@ -60,6 +60,8 @@ + cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) + cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) + cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) ++ ln -s -f liblua.${version}.dylib $(INSTALL_LIB)/liblua.${luaversion}.dylib ++ ln -s -f liblua.${luaversion}.dylib $(INSTALL_LIB)/liblua.dylib + + uninstall: + cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN) +--- a/src/Makefile 2021-05-14 22:35:38.575051882 +0300 ++++ b/src/Makefile 2021-05-14 22:35:33.584631206 +0300 +@@ -32,7 +32,7 @@ + + PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris + +-LUA_A= liblua.a ++LUA_A= liblua.${version}.dylib + CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o + LIB_O= lauxlib.o lbaselib.o lcorolib.o ldblib.o liolib.o lmathlib.o loadlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o linit.o + BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS) +@@ -57,11 +57,13 @@ + a: $(ALL_A) + + $(LUA_A): $(BASE_O) +- $(AR) $@ $(BASE_O) +- $(RANLIB) $@ ++ $(CC) -dynamiclib -install_name $(out)/lib/liblua.${version}.dylib \ ++ -compatibility_version ${version} -current_version ${version} \ ++ -o liblua.${version}.dylib $^ + + $(LUA_T): $(LUA_O) $(LUA_A) +- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) ++ $(CC) -fno-common $(MYLDFLAGS) \ ++ -o $@ $(LUA_O) $(LUA_A) -L. -llua.${version} $(LIBS) + + $(LUAC_T): $(LUAC_O) $(LUA_A) + $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix index ae5d76aa36c0..3f525e6d6f0d 100644 --- a/pkgs/development/interpreters/lua-5/default.nix +++ b/pkgs/development/interpreters/lua-5/default.nix @@ -5,6 +5,12 @@ rec { lua5_4 = callPackage ./interpreter.nix { sourceVersion = { major = "5"; minor = "4"; patch = "2"; }; hash = "0ksj5zpj74n0jkamy3di1p6l10v4gjnd2zjnb453qc6px6bhsmqi"; + + patches = if stdenv.isDarwin then [ ./5.4.darwin.patch ] else [ + # build lua as a shared library as well, MIT-licensed from + # https://github.com/archlinux/svntogit-packages/tree/packages/lua/trunk + ./liblua.so.patch + ]; }; lua5_4_compat = lua5_4.override({ |