From 2148aa5f14501bd5e66b372910c6a36fccb2c6a3 Mon Sep 17 00:00:00 2001 From: Evandro Alves Rodrigues Date: Wed, 23 Oct 2024 12:07:24 +0700 Subject: [PATCH] development/luarocks: Fix for newer lua. --- development/luarocks/README | 7 ++++ development/luarocks/luarocks.SlackBuild | 44 +++++++++++++++++++----- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/development/luarocks/README b/development/luarocks/README index b9c1d9a3d61..805e870e631 100644 --- a/development/luarocks/README +++ b/development/luarocks/README @@ -1,3 +1,10 @@ LuaRocks is a deployment and management system for Lua modules, with automatic dependency checking, with access to remote repositories and local rock source trees. + +This build script by default builds for a "default Lua", which +will be 5.1 on "older" SBo tree, and 5.4 on "newer" SBo tree, +and on "-current" as of 2024-10-23. + +It will pick up the compatibility interpreter "Lua 5.1", if +it is present. diff --git a/development/luarocks/luarocks.SlackBuild b/development/luarocks/luarocks.SlackBuild index 43f9860aec3..c0d017985ff 100644 --- a/development/luarocks/luarocks.SlackBuild +++ b/development/luarocks/luarocks.SlackBuild @@ -22,11 +22,15 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20241023 lwf: Modified by SlackBuilds.org, BUILD=2: +# - support lua5.1 and lua 5.4 for 15.0 and 15.1 + + cd $(dirname $0) ; CWD=$(pwd) PRGNAM="luarocks" VERSION=${VERSION:-2.4.1} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -79,15 +83,37 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --with-lua-lib=/usr/lib$LIBDIRSUFFIX +# CFLAGS="$SLKCFLAGS" \ +# CXXFLAGS="$SLKCFLAGS" \ +# ./configure \ +# --prefix=/usr \ +# --sysconfdir=/etc \ +# --versioned-rocks-dir \ +# --with-lua-lib=/usr/lib$LIBDIRSUFFIX +# make build +# make install DESTDIR=$PKG + +sed -i '/Invalid Lua version/d' configure + +runmake () +( + args=(--prefix=/usr + --sysconfdir=/etc + --lua-version="$(pkg-config --variable=V "$1")" + --with-lua-lib=/usr/lib$LIBDIRSUFFIX + --with-lua-include=/usr/include/"$2" + --versioned-rocks-dir) + if [[ "$3" != "" ]] ; then args=("${args[@]}" --lua-suffix="$3") ; fi + CFLAGS="$SLKCFLAGS" \ + CXXFLAGS="$SLKCFLAGS" \ + ./configure "${args[@]}" + make build + make install DESTDIR=$PKG +) + +pkg-config --exists lua51 && runmake lua51 "lua5.1" "51" +runmake lua "" "" -make build -make install DESTDIR=$PKG find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true