From aeb975d108367e61eb4c953ce95b0a9a7de65191 Mon Sep 17 00:00:00 2001 From: q66 Date: Tue, 30 Jun 2020 22:02:47 +0200 Subject: [PATCH] New package: lua54-5.4.0 --- common/shlibs | 1 + srcpkgs/lua54-devel | 1 + srcpkgs/lua54/files/lua.pc | 21 ++++++++ srcpkgs/lua54/patches/liblua.so.patch | 53 ++++++++++++++++++ srcpkgs/lua54/template | 77 +++++++++++++++++++++++++++ 5 files changed, 153 insertions(+) create mode 120000 srcpkgs/lua54-devel create mode 100644 srcpkgs/lua54/files/lua.pc create mode 100644 srcpkgs/lua54/patches/liblua.so.patch create mode 100644 srcpkgs/lua54/template diff --git a/common/shlibs b/common/shlibs index c44966c8ce..052526657d 100644 --- a/common/shlibs +++ b/common/shlibs @@ -868,6 +868,7 @@ libgsl.so.25 gsl-2.6_1 liblua5.1.so.5.1 lua51-5.1.5_1 liblua5.2.so.5.2 lua52-5.2.4_2 liblua5.3.so.5.3 lua53-5.3.5_4 +liblua5.4.so.5.4 lua54-5.4.0_1 libburn.so.4 libburn-0.7.2_1 libKF5Auth.so.5 kauth-5.26.0_1 libKF5AuthCore.so.5 kauth-5.56.0_1 diff --git a/srcpkgs/lua54-devel b/srcpkgs/lua54-devel new file mode 120000 index 0000000000..65c6b1e212 --- /dev/null +++ b/srcpkgs/lua54-devel @@ -0,0 +1 @@ +lua54 \ No newline at end of file diff --git a/srcpkgs/lua54/files/lua.pc b/srcpkgs/lua54/files/lua.pc new file mode 100644 index 0000000000..b05ba08151 --- /dev/null +++ b/srcpkgs/lua54/files/lua.pc @@ -0,0 +1,21 @@ +V=%VER% +R=%REL% + +prefix=/usr +INSTALL_BIN=${prefix}/bin +INSTALL_INC=${prefix}/include +INSTALL_LIB=${prefix}/lib +INSTALL_MAN=${prefix}/man/man1 +INSTALL_LMOD=${prefix}/share/lua/${V} +INSTALL_CMOD=${prefix}/lib/lua/${V} +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include/lua${V} + +Name: Lua +Description: An Extensible Extension Language +Version: ${R} +Requires: +Libs: -L${libdir} -llua${V} +Libs.private: -lm -ldl +Cflags: -I${includedir} diff --git a/srcpkgs/lua54/patches/liblua.so.patch b/srcpkgs/lua54/patches/liblua.so.patch new file mode 100644 index 0000000000..fbe7b39a4e --- /dev/null +++ b/srcpkgs/lua54/patches/liblua.so.patch @@ -0,0 +1,53 @@ +--- Makefile ++++ 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) +--- src/Makefile ++++ 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,11 @@ $(LUA_A): $(BASE_O) + $(AR) $@ $(BASE_O) + $(RANLIB) $@ + ++$(LUA_SO): $(BASE_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) + +--- src/luaconf.h ++++ src/luaconf.h +@@ -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 --git a/srcpkgs/lua54/template b/srcpkgs/lua54/template new file mode 100644 index 0000000000..a3792ec83b --- /dev/null +++ b/srcpkgs/lua54/template @@ -0,0 +1,77 @@ +# Template file for 'lua54' +pkgname=lua54 +version=5.4.0 +revision=1 +wrksrc=lua-${version} +makedepends="ncurses-devel readline-devel" +short_desc="Powerful, fast, lightweight, embeddable scripting language (5.4.x)" +maintainer="q66 " +license="MIT" +homepage="https://www.lua.org" +distfiles="https://www.lua.org/ftp/lua-${version}.tar.gz" +checksum=eac0836eb7219e421a96b7ee3692b93f0629e4cdb0c788432e3d10ce9ed47e28 + +alternatives=" + lua:lua:/usr/bin/lua5.4 + lua:luac:/usr/bin/luac5.4 + lua:lua.1:/usr/share/man/man1/lua5.4.1 + lua:luac.1:/usr/share/man/man1/luac5.4.1 + lua:lua:/usr/share/doc/lua5.4 +" + +do_build() { + sed -i src/Makefile -r \ + -e '/^LUA_(SO|A|T)=/ s;lua;lua5.4;' \ + -e '/^LUAC_T=/ s;luac;luac5.4;' + make MYCFLAGS="$CFLAGS -fPIC" MYLDFLAGS="$LDFLAGS" \ + CC="$CC" RANLIB="$RANLIB" \ + INSTALL_DATA="cp -d" LUA_SO=liblua5.4.so ${makejobs} linux-readline +} + +do_install() { + make INSTALL_DATA="cp -d" INSTALL_TOP="${DESTDIR}/usr" \ + TO_BIN="lua5.4 luac5.4" \ + TO_LIB="liblua5.4.a liblua5.4.so liblua5.4.so.${version%.*} liblua5.4.so.${version}" \ + INSTALL_INC="${DESTDIR}/usr/include/lua5.4" \ + INSTALL_MAN="${DESTDIR}/usr/share/man/man1" install + + sed ${FILESDIR}/lua.pc \ + -e "s;%VER%;${version%.*};g;s;%REL%;${version};g" \ + > lua5.4.pc + + vinstall lua5.4.pc 644 usr/lib/pkgconfig + + # Install the documentation + rm -f doc/*.1 + vmkdir usr/share/doc/lua5.4 + cp -R doc/* ${DESTDIR}/usr/share/doc/lua5.4 + + vlicense doc/readme.html + + # Rename man pages + mv ${DESTDIR}/usr/share/man/man1/lua{,5.4}.1 + mv ${DESTDIR}/usr/share/man/man1/luac{,5.4}.1 +} + +lua54-devel_package() { + depends="${makedepends} lua54>=${version}_${revision}" + short_desc+=" - development files" + alternatives=" + lua-devel:lua:/usr/include/lua5.4 + lua-devel:/usr/include/lua.h:/usr/include/lua5.4/lua.h + lua-devel:/usr/include/luaconf.h:/usr/include/lua5.4/luaconf.h + lua-devel:/usr/include/lua.hpp:/usr/include/lua5.4/lua.hpp + lua-devel:/usr/include/lualib.h:/usr/include/lua5.4/lualib.h + lua-devel:/usr/include/lauxlib.h:/usr/include/lua5.4/lauxlib.h + lua-devel:lua.pc:/usr/lib/pkgconfig/lua5.4.pc + lua-devel:liblua.a:/usr/lib/liblua5.4.a + lua-devel:liblua.so:/usr/lib/liblua5.4.so + " + pkg_install() { + vmove usr/include + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + vmove usr/lib/pkgconfig + vmove usr/share/doc + } +}