From 45aa3d127a1fe157580233759ebcafdee685c418 Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Sun, 9 Feb 2020 14:55:19 +0100 Subject: [PATCH] lua, bump version, add test (#4320) Disabled for now as it's still in beta fase --- dev-lang/lua/lua54-5.4.0~beta.recipe | 113 ++++++++++++++++++ .../lua/patches/lua-5.4.0~beta.gcc2.patchset | 37 ++++++ dev-lang/lua/patches/lua-5.4.0~beta.patchset | 112 +++++++++++++++++ 3 files changed, 262 insertions(+) create mode 100644 dev-lang/lua/lua54-5.4.0~beta.recipe create mode 100644 dev-lang/lua/patches/lua-5.4.0~beta.gcc2.patchset create mode 100644 dev-lang/lua/patches/lua-5.4.0~beta.patchset diff --git a/dev-lang/lua/lua54-5.4.0~beta.recipe b/dev-lang/lua/lua54-5.4.0~beta.recipe new file mode 100644 index 000000000..1590ba80c --- /dev/null +++ b/dev-lang/lua/lua54-5.4.0~beta.recipe @@ -0,0 +1,113 @@ +SUMMARY="A powerful, fast, light-weight, embeddable scripting language" +DESCRIPTION="Lua combines simple procedural syntax with powerful data \ +description constructs based on associative arrays and extensible semantics. \ +Lua is dynamically typed, runs by interpreting bytecode for a register-based \ +virtual machine, and has automatic memory management with incremental garbage \ +collection, making it ideal for configuration, scripting, and rapid \ +prototyping." +HOMEPAGE="https://www.lua.org/" +COPYRIGHT="1994-2019 Lua.org, PUC-Rio" +LICENSE="MIT" +REVISION="1" +SOURCE_URI="http://www.lua.org/work/lua-${portVersion/\~beta/-beta}.tar.gz" +CHECKSUM_SHA256="5eb2824bc08469be9d9282c7298f001830ea013179ad0ae8a50600332568ebb9" +SOURCE_DIR="lua-${portVersion/\~beta/-beta}" +PATCHES="lua-$portVersion.patchset" +if [ $effectiveTargetArchitecture = x86_gcc2 ]; then + PATCHES+=" + lua-$portVersion.gcc2.patchset + " +fi + +ARCHITECTURES="?x86_gcc2 ?x86_64" +SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86" + +libVersion="${portVersion%.*}" +libVersionCompat="$libVersion compat >= $libVersion" +luaInc="`echo ${libVersion} | tr -d '.'`" +luaVer="`echo $portVersion | cut -d~ -f1`" + +PROVIDES=" + lua54$secondaryArchSuffix = $portVersion + cmd:lua$secondaryArchSuffix = $portVersion + cmd:lua$libVersion$secondaryArchSuffix = $portVersion + cmd:luac$secondaryArchSuffix = $portVersion + cmd:luac$libVersion$secondaryArchSuffix = $portVersion + lib:liblua$secondaryArchSuffix = $libVersionCompat + " +REQUIRES=" + haiku$secondaryArchSuffix + " + +PROVIDES_devel=" + lua54${secondaryArchSuffix}_devel = $portVersion + devel:liblua$secondaryArchSuffix = $libVersionCompat + " +REQUIRES_devel=" + lua54$secondaryArchSuffix == $portVersion base + " +CONFLICTS_devel=" + lua${secondaryArchSuffix}_devel + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + " +BUILD_PREREQUIRES=" + cmd:gcc$secondaryArchSuffix + cmd:make + " + +BUILD() +{ + make haiku MYCFLAGS="-DLUA_ROOT='\"$prefix/\"' -DLUA_LDIR='\"$dataDir/lua/$libVersion/\"'" \ + LUA_T="lua$libVersion" LUAC_T="luac$libVersion" LUA_SO="liblua.so.$libVersion" +} + +INSTALL() +{ + make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir/man1" \ + INSTALL_INC="$includeDir/lua$luaInc" INSTALL_LMOD="$dataDir/lua/$libVersion" \ + INSTALL_LIB="$libDir" INSTALL_BIN="$binDir" TO_BIN="lua$libVersion luac$libVersion" \ + TO_LIB="liblua.a liblua.so.$libVersion" + + ln -s lua$libVersion $binDir/lua + ln -s luac$libVersion $binDir/luac + ln -s liblua.so.$libVersion $libDir/liblua.so + + rm -r $dataDir #empty directory + rm -r $prefix/lib/lua #empty directory + + mkdir -p $developLibDir/pkgconfig + cat > $developLibDir/pkgconfig/lua.pc << EOF +V=$libVersion +R=$luaVer + +INSTALL_BIN=$binDir +INSTALL_INC=$includeDir +INSTALL_LIB=$libDir +INSTALL_MAN=$manDir +INSTALL_LMOD=${dataDir}/lua/\${V} +INSTALL_CMOD=${libDir}/lua/\${V} +exec_prefix=$prefix +libdir=$libDir +includedir=$includeDir + +Name: Lua +Description: An Extensible Extension Language +Version: \${R} +Requires: +Libs: -L\${libdir} -llua +Cflags: -I\${includedir}/lua$luaInc +EOF + + ln -s $developLibDir/pkgconfig/lua.pc $developLibDir/pkgconfig/lua$libVersion.pc + + prepareInstalledDevelLib liblua + packageEntries devel $developDir +} + +TEST() +{ + src/lua$libVersion -v +} diff --git a/dev-lang/lua/patches/lua-5.4.0~beta.gcc2.patchset b/dev-lang/lua/patches/lua-5.4.0~beta.gcc2.patchset new file mode 100644 index 000000000..ccfb3fd67 --- /dev/null +++ b/dev-lang/lua/patches/lua-5.4.0~beta.gcc2.patchset @@ -0,0 +1,37 @@ +From 0fe2f71f6eb7fb099b4ad950b50e2f27d919ea67 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Tue, 11 Aug 2015 17:13:15 +0000 +Subject: gcc2 patch + + +diff --git a/src/Makefile b/src/Makefile +index d0c4194..f5491cf 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -6,8 +6,8 @@ + # Your platform. See PLATS for possible values. + PLAT= none + +-CC= gcc -std=gnu99 +-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS) ++CC= gcc ++CFLAGS= -O2 -Wall -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS) + LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS) + LIBS= -lm $(SYSLIBS) $(MYLIBS) + +diff --git a/src/llimits.h b/src/llimits.h +index 2b52c83..ddbc51a 100644 +--- a/src/llimits.h ++++ b/src/llimits.h +@@ -146,7 +146,7 @@ typedef LUAI_UACINT l_uacInt; + */ + #if !defined(likely) + +-#if defined(__GNUC__) ++#if defined(__GNUC__) > 3 + #define likely(x) (__builtin_expect(((x) != 0), 1)) + #define unlikely(x) (__builtin_expect(((x) != 0), 0)) + #else +-- +2.23.0 + diff --git a/dev-lang/lua/patches/lua-5.4.0~beta.patchset b/dev-lang/lua/patches/lua-5.4.0~beta.patchset new file mode 100644 index 000000000..0ac0d52ce --- /dev/null +++ b/dev-lang/lua/patches/lua-5.4.0~beta.patchset @@ -0,0 +1,112 @@ +From cb6d6fae1c5deb2efa132697cdd9cf00d727d129 Mon Sep 17 00:00:00 2001 +From: Jerome Duval +Date: Mon, 5 May 2014 15:59:15 +0000 +Subject: import patch from 5.2.1 + + +diff --git a/Makefile b/Makefile +index 8460e80..79f2e6d 100644 +--- a/Makefile ++++ b/Makefile +@@ -36,12 +36,12 @@ RM= rm -f + # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= + + # Convenience platforms targets. +-PLATS= aix bsd c89 freebsd generic guess linux linux-readline macosx mingw posix solaris ++PLATS= aix bsd c89 freebsd generic guess haiku linux linux-readline 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.a liblusa.so + TO_MAN= lua.1 luac.1 + + # Lua version and release. +@@ -52,7 +52,7 @@ R= $V.0 + all: $(PLAT) + + $(PLATS) clean: +- cd src && $(MAKE) $@ ++ cd src && $(MAKE) V=$(V) $@ + + test: dummy + src/lua -v +diff --git a/src/Makefile b/src/Makefile +index 8dee54c..d0c4194 100644 +--- a/src/Makefile ++++ b/src/Makefile +@@ -26,9 +26,10 @@ MYOBJS= + + # == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE ======= + +-PLATS= aix bsd c89 freebsd generic guess linux linux-readline macosx mingw posix solaris ++PLATS= aix bsd c89 freebsd generic guess haiku 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) +@@ -40,7 +41,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. +@@ -62,6 +63,9 @@ $(LUA_T): $(LUA_O) $(LUA_A) + $(LUAC_T): $(LUAC_O) $(LUA_A) + $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) + ++$(LUA_SO): $(CORE_O) $(LIB_O) ++ $(CC) -o $@ -shared -fPIC -Wl,-soname=liblua.so.$(V) $(LDFLAGS) $? $(LIBS) ++ + clean: + $(RM) $(ALL_T) $(ALL_O) + +@@ -106,6 +110,9 @@ FreeBSD NetBSD OpenBSD freebsd: + + generic: $(ALL) + ++haiku: ++ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_HAIKU -DLUA_USE_POSIX" LIBS= ++ + Linux linux: linux-noreadline + + linux-noreadline: +diff --git a/src/luaconf.h b/src/luaconf.h +index 8f13743..4235d0c 100644 +--- a/src/luaconf.h ++++ b/src/luaconf.h +@@ -84,6 +84,12 @@ + #define LUA_USE_DLOPEN /* MacOS does not need -ldl */ + #endif + ++#if defined(LUA_USE_HAIKU) ++#define LUA_USE_MKSTEMP ++#define LUA_USE_ISATTY ++#define LUA_USE_POPEN ++#define LUA_USE_DLOPEN ++#endif + + /* + @@ LUAI_IS32INT is true iff 'int' has (at least) 32 bits. +@@ -227,8 +233,12 @@ + + #else /* }{ */ + ++#ifndef LUA_ROOT + #define LUA_ROOT "/usr/local/" ++#endif ++#ifndef LUA_LDIR + #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/" ++#endif + #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/" + + #if !defined(LUA_PATH_DEFAULT) +-- +2.23.0 +