From 05159343ea28f3024b68e2c22fb7acf6d75823ec Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Tue, 23 Dec 2025 13:05:57 +0100 Subject: [PATCH] lua5_5: init at 5.5.0 --- .../interpreters/lua-5/5.5.darwin.patch | 52 +++++++++++++++++++ .../interpreters/lua-5/default.nix | 15 ++++++ .../interpreters/lua-5/interpreter.nix | 2 +- pkgs/top-level/all-packages.nix | 3 ++ 4 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/interpreters/lua-5/5.5.darwin.patch diff --git a/pkgs/development/interpreters/lua-5/5.5.darwin.patch b/pkgs/development/interpreters/lua-5/5.5.darwin.patch new file mode 100644 index 000000000000..33ce03cf8bbb --- /dev/null +++ b/pkgs/development/interpreters/lua-5/5.5.darwin.patch @@ -0,0 +1,52 @@ +diff --git a/Makefile b/Makefile +index 388fa17..ce17b93 100644 +--- a/Makefile ++++ b/Makefile +@@ -41,7 +41,7 @@ PLATS= guess aix bsd c89 freebsd generic ios linux macosx mingw posix solaris + # 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.${pkgversion}.dylib + TO_MAN= lua.1 luac.1 + + # Lua version and release. +@@ -60,6 +60,9 @@ install: dummy + 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.${pkgversion}.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) +diff --git a/src/Makefile b/src/Makefile +index acf33e0..42a5435 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -32,7 +32,7 @@ CMCFLAGS= + + PLATS= guess aix bsd c89 freebsd generic ios linux macosx mingw posix solaris + +-LUA_A= liblua.a ++LUA_A= liblua.${pkgversion}.a + 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) +@@ -59,9 +59,14 @@ a: $(ALL_A) + $(LUA_A): $(BASE_O) + $(AR) $@ $(BASE_O) + $(RANLIB) $@ ++ $(CC) -dynamiclib -install_name $(out)/lib/liblua.${pkgversion}.dylib \ ++ -compatibility_version ${pkgversion} -current_version ${pkgversion} \ ++ -o liblua.${pkgversion}.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.${pkgversion} $(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 fd6ed6d800e1..1147893e5e43 100644 --- a/pkgs/development/interpreters/lua-5/default.nix +++ b/pkgs/development/interpreters/lua-5/default.nix @@ -102,6 +102,21 @@ let in rec { + lua5_5 = callPackage ./interpreter.nix { + self = lua5_5; + version = "5.5.0"; + hash = "sha256-V8zDK7vQBcq3W8xSREBSU1r2kXiduiuQFtXFBkDWiz0="; + makeWrapper = makeBinaryWrapper; + inherit passthruFun; + + patches = lib.optional stdenv.hostPlatform.isDarwin ./5.5.darwin.patch; + }; + + lua5_5_compat = lua5_5.override { + self = lua5_5_compat; + compat = true; + }; + lua5_4 = callPackage ./interpreter.nix { self = lua5_4; version = "5.4.7"; diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix index 7142370b89f6..05272e980b4f 100644 --- a/pkgs/development/interpreters/lua-5/interpreter.nix +++ b/pkgs/development/interpreters/lua-5/interpreter.nix @@ -33,7 +33,7 @@ stdenv.mkDerivation ( plat = if (stdenv.hostPlatform.isLinux && lib.versionOlder self.luaversion "5.4") then "linux" - else if (stdenv.hostPlatform.isLinux && lib.versionAtLeast self.luaversion "5.4") then + else if (stdenv.hostPlatform.isLinux && self.luaversion == "5.4") then "linux-readline" else if stdenv.hostPlatform.isDarwin then "macosx" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7b4a03b9e304..caa6ddda2309 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5460,6 +5460,8 @@ with pkgs; lua5_3_compat lua5_4 lua5_4_compat + lua5_5 + lua5_5_compat luajit_2_1 luajit_2_0 luajit_openresty @@ -5472,6 +5474,7 @@ with pkgs; lua52Packages = recurseIntoAttrs lua5_2.pkgs; lua53Packages = recurseIntoAttrs lua5_3.pkgs; lua54Packages = recurseIntoAttrs lua5_4.pkgs; + lua55Packages = recurseIntoAttrs lua5_5.pkgs; luajitPackages = recurseIntoAttrs luajit.pkgs; luaPackages = lua52Packages;