From f650bb1f4d150c573c5361ab1e019cb57979da4b Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 28 Dec 2025 13:46:43 +0000 Subject: [PATCH] revert 91ce3613d7dd454fd83a4fb57eab9a9a37e189be revert Update package version to 5.5.0 --- pkg.info | 11 +--- source-files/liblua.patch | 47 --------------- source-files/lua-shared-library.patch | 83 +++++++++++++++++++++++++++ source-files/{lua.pc.in => lua.pc} | 4 +- source.sh | 17 ++++-- 5 files changed, 98 insertions(+), 64 deletions(-) delete mode 100644 source-files/liblua.patch create mode 100644 source-files/lua-shared-library.patch rename source-files/{lua.pc.in => lua.pc} (96%) diff --git a/pkg.info b/pkg.info index 73f7167..556cbfd 100644 --- a/pkg.info +++ b/pkg.info @@ -1,15 +1,8 @@ name: lua description: A powerful, efficient, lightweight, embeddable scripting language -version: 5.5.0 -revision: 1 +version: 5.4.8 url: https://www.lua.org/ license: MIT architecture: any +depends: ["readline"] type: source -depends: - - readline -downloads: - - url: https://www.lua.org/ftp/lua-${BPM_PKG_VERSION}.tar.gz - extract_to: ${BPM_SOURCE} - extract_strip_components: 1 - checksum: 57ccc32bbbd005cab75bcc52444052535af691789dba2b9016d5c50640d68b3d diff --git a/source-files/liblua.patch b/source-files/liblua.patch deleted file mode 100644 index a105244..0000000 --- a/source-files/liblua.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/Makefile b/Makefile -index 416f444..eeaff03 100644 ---- a/Makefile -+++ b/Makefile -@@ -52,7 +52,7 @@ R= $V.0 - all: $(PLAT) - - $(PLATS) help test clean: -- @cd src && $(MAKE) $@ -+ @cd src && $(MAKE) $@ V=$(V) R=$(R) - - install: dummy - cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) -diff --git a/src/Makefile b/src/Makefile -index 514593d..372a6dc 100644 ---- a/src/Makefile -+++ b/src/Makefile -@@ -33,6 +33,7 @@ CMCFLAGS= -Os - PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris - - LUA_A= liblua.a -+LUA_SO= liblua.so - 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) -@@ -44,7 +45,7 @@ LUAC_T= luac - LUAC_O= luac.o - - ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) --ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) -+ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) - ALL_A= $(LUA_A) - - # Targets start here. -@@ -60,6 +61,12 @@ $(LUA_A): $(BASE_O) - $(AR) $@ $(BASE_O) - $(RANLIB) $@ - -+$(LUA_SO): $(CORE_O) $(LIB_O) -+ $(CC) -shared -ldl -Wl,-soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) -+ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) -+ ln -sf $(LUA_SO).$(R) $(LUA_SO) -+ -+ - $(LUA_T): $(LUA_O) $(LUA_A) - $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - diff --git a/source-files/lua-shared-library.patch b/source-files/lua-shared-library.patch new file mode 100644 index 0000000..7e956fb --- /dev/null +++ b/source-files/lua-shared-library.patch @@ -0,0 +1,83 @@ +Submitted By: Xi Ruoyao +Date: 2022-09-16 +Initial Package Version: 5.4.4 +Upstream Status: Rejected +Origin: Arch Linux, with some modifications +Description: 2020-06-30 renodr: + Creates a shared liblua library, as well as + removes optimization since it causes SIGBUS errors, + and sets the search path to /usr from /usr/local. + The initial version of this patch was created by + Igor Zivkovic, before being rediffed for 5.4.0 by + myself with some modifications made. + 2022-09-16 xry111: + Remove an extra newline before $(MYLDFLAGS). + MYLDFLAGS is empty by default so it does not break + BLFS build, but it may break a custom build with + tuning or hardening. + +diff -Naurp lua-5.4.0.orig/Makefile lua-5.4.0/Makefile +--- lua-5.4.0.orig/Makefile 2020-04-15 07:55:07.000000000 -0500 ++++ lua-5.4.0/Makefile 2020-06-30 13:22:00.997938585 -0500 +@@ -52,7 +52,7 @@ R= $V.0 + all: $(PLAT) + + $(PLATS) help test clean: +- @cd src && $(MAKE) $@ ++ @cd src && $(MAKE) $@ V=$(V) R=$(R) + + install: dummy + cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) +diff -Naurp lua-5.4.0.orig/src/luaconf.h lua-5.4.0/src/luaconf.h +--- lua-5.4.0.orig/src/luaconf.h 2020-06-18 09:25:54.000000000 -0500 ++++ lua-5.4.0/src/luaconf.h 2020-06-30 13:24:59.294932289 -0500 +@@ -227,7 +227,7 @@ + + #else /* }{ */ + +-#define LUA_ROOT "/usr/local/" ++#define LUA_ROOT "/usr/" + #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" + #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" + +diff -Naurp lua-5.4.0.orig/src/Makefile lua-5.4.0/src/Makefile +--- lua-5.4.0.orig/src/Makefile 2020-04-15 08:00:29.000000000 -0500 ++++ lua-5.4.0/src/Makefile 2020-06-30 13:24:15.746933827 -0500 +@@ -7,7 +7,7 @@ + PLAT= guess + + CC= gcc -std=gnu99 +-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS) ++CFLAGS= -fPIC -O0 -Wall -Wextra -DLUA_COMPAT_5_3 -DLUA_COMPAT_5_2 -DLUA_COMPAT_5_1 $(SYSCFLAGS) $(MYCFLAGS) + LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) + LIBS= -lm $(SYSLIBS) $(MYLIBS) + +@@ -33,6 +33,7 @@ CMCFLAGS= -Os + PLATS= guess aix bsd c89 freebsd generic linux linux-readline macosx mingw posix solaris + + LUA_A= liblua.a ++LUA_SO= liblua.so + 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) +@@ -44,7 +45,7 @@ LUAC_T= luac + LUAC_O= luac.o + + ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O) +-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) ++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO) + ALL_A= $(LUA_A) + + # Targets start here. +@@ -60,6 +61,11 @@ $(LUA_A): $(BASE_O) + $(AR) $@ $(BASE_O) + $(RANLIB) $@ + ++$(LUA_SO): $(CORE_O) $(LIB_O) ++ $(CC) -shared -ldl -Wl,--soname,$(LUA_SO).$(V) -o $@.$(R) $? -lm $(MYLDFLAGS) ++ ln -sf $(LUA_SO).$(R) $(LUA_SO).$(V) ++ ln -sf $(LUA_SO).$(R) $(LUA_SO) ++ + $(LUA_T): $(LUA_O) $(LUA_A) + $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + diff --git a/source-files/lua.pc.in b/source-files/lua.pc similarity index 96% rename from source-files/lua.pc.in rename to source-files/lua.pc index 11a8ee7..86d4148 100644 --- a/source-files/lua.pc.in +++ b/source-files/lua.pc @@ -1,5 +1,5 @@ -V=%V -R=%R +V=5.4 +R=5.4.6 prefix=/usr INSTALL_BIN=${prefix}/bin diff --git a/source.sh b/source.sh index a1b2505..9777086 100644 --- a/source.sh +++ b/source.sh @@ -2,20 +2,25 @@ # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT +DOWNLOAD="https://www.lua.org/ftp/lua-${BPM_PKG_VERSION}.tar.gz" +FILENAME="${DOWNLOAD##*/}" + # The prepare function is executed in the root of the temp directory -# This function is used for putting downloaded files to the correct location or applying patches +# This function is used for downloading files and putting them into the correct location prepare() { + wget "$DOWNLOAD" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + cd "$BPM_SOURCE" - # Patch for compiling a shared library - patch -Np1 -i "$BPM_WORKDIR"/liblua.patch - # Create lua pkgconfig file - sed -e "s/%V/${BPM_PKG_VERSION%.*}/" -e "s/%R/${BPM_PKG_VERSION}/" "$BPM_WORKDIR"/lua.pc.in > lua.pc + patch -Np1 -i ../lua-shared-library.patch # Patch from BLFS + + mv ../lua.pc ./lua.pc } # The build function is executed in the source directory # This function is used to compile the source code build() { - make MYCFLAGS="$CFLAGS -fPIC" MYLDFALGS="$LDFLAGS" linux + make linux } # The check function is executed in the source directory