aboutsummaryrefslogtreecommitdiff
path: root/development
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-10-17 01:10:13 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-11-02 19:28:29 +0700
commitf0c6e8be0eda9517b7f09d3472673bde5ddb3dbb (patch)
treeab752db00b607b7d0fc189f9d91f6f1142bf9018 /development
parent97f2a0c1c1c1bf1f5b6e27d8a465101c5f42f028 (diff)
development/lua: Updated for version 5.4.7.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r--development/lua/README2
-rw-r--r--development/lua/lua.SlackBuild79
-rw-r--r--development/lua/lua.info6
-rw-r--r--development/lua/lua.pc31
-rw-r--r--development/lua/lua.usr.local.patch32
5 files changed, 112 insertions, 38 deletions
diff --git a/development/lua/README b/development/lua/README
index 21e8eaf67494..a5fc399a8c3c 100644
--- a/development/lua/README
+++ b/development/lua/README
@@ -2,5 +2,5 @@ Lua is a free software light-weight programming language designed
for extending applications. Lua is also frequently used as a
general-purpose, stand-alone scripting language.
-This package is for the version 5.1.x of lua, the one compatible
+This package is for version 5.4.x of lua, the one compatible
with the software that needs lua on slackbuilds.org.
diff --git a/development/lua/lua.SlackBuild b/development/lua/lua.SlackBuild
index ef4f13e334cd..9684a035d42c 100644
--- a/development/lua/lua.SlackBuild
+++ b/development/lua/lua.SlackBuild
@@ -6,6 +6,8 @@
# Modified by the SlackBuilds.org project
# Modified by Aaron W. Hsu
# Updated by Matteo Bernardini
+# Updated (for lua-5.4) by B. Watson, based on Patrick Volkerding's
+# lua.SlackBuild for Slackware-current.
# This program is free software. It comes without any warranty.
# Granted WTFPL, Version 2, as published by Sam Hocevar. See
@@ -14,7 +16,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=lua
-VERSION=${VERSION:-5.1.5}
+VERSION=${VERSION:-5.4.7}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -27,9 +29,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -52,6 +51,13 @@ fi
set -e
+# 20241017 bkw: this stuff makes the code slightly less eye-hurting.
+SHORTVER="$( echo $VERSION | cut -d. -f1,2 )" # e.g. 5.4
+VERMAJOR="$( echo $VERSION | cut -d. -f1 )" # e.g. 5
+LIB=lib$LIBDIRSUFFIX
+ULIB=/usr/$LIB
+PKGLIB=$PKG$ULIB
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
@@ -59,54 +65,59 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-${VERSION}.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
+
+# Also search paths under /usr/local:
+patch -p1 < $CWD/lua.usr.local.patch
-# Fix up a to-be-installed header and the pkgconfig file
-sed -i "s|/usr/local|/usr|" src/luaconf.h
-sed -i "s|lib/lua|lib$LIBDIRSUFFIX/lua|" src/luaconf.h
-sed -i "s|/usr/local|/usr|" etc/lua.pc
-sed -i "s|prefix}/lib|prefix}/lib${LIBDIRSUFFIX}|g" etc/lua.pc
+# Fix luaconf.h header to use lib$LIBDIRSUFFIX:
+sed -i "s|lib/lua|$LIB/lua|" src/luaconf.h
make linux \
- CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" \
+ MYCFLAGS="$SLKCFLAGS" \
INSTALL_TOP=/usr \
- INSTALL_LIB=/usr/lib${LIBDIRSUFFIX} \
- INSTALL_LMOD=/usr/share/lua/5.1 \
- INSTALL_CMOD=/usr/lib${LIBDIRSUFFIX}/lua/5.1
+ INSTALL_LIB=$ULIB \
+ INSTALL_LMOD=/usr/share/lua/$SHORTVER \
+ INSTALL_CMOD=$ULIB/lua/$SHORTVER
make linux install \
- CFLAGS="$SLKCFLAGS \$(MYCFLAGS)" \
+ MYCFLAGS="$SLKCFLAGS" \
INSTALL_TOP=$PKG/usr \
- INSTALL_LIB=$PKG/usr/lib${LIBDIRSUFFIX} \
- INSTALL_LMOD=$PKG/usr/share/lua/5.1 \
- INSTALL_CMOD=$PKG/usr/lib${LIBDIRSUFFIX}/lua/5.1
+ INSTALL_LIB=$PKGLIB \
+ INSTALL_LMOD=$PKG/usr/share/lua/$SHORTVER \
+ INSTALL_CMOD=$PKGLIB/lua/$SHORTVER
+
+strip $PKG/usr/bin/*
# Now let's build the shared library
mkdir -p shared
cd shared
- ar -x $PKG/usr/lib${LIBDIRSUFFIX}/liblua.a
+ ar -x $PKGLIB/liblua.a
gcc -ldl -lreadline -lhistory -lncurses -lm -shared *.o -o liblua.so.$VERSION
- cp -a liblua.so.$VERSION $PKG/usr/lib${LIBDIRSUFFIX}
- ( cd $PKG/usr/lib${LIBDIRSUFFIX}
- ln -s liblua.so.$VERSION liblua.so.5.1
- ln -s liblua.so.$VERSION liblua.so.5
+ install -s -m0755 liblua.so.$VERSION $PKGLIB
+ ( cd $PKGLIB
+ ln -s liblua.so.$VERSION liblua.so.$SHORTVER
+ ln -s liblua.so.$VERSION liblua.so.$VERMAJOR
ln -s liblua.so.$VERSION liblua.so
)
cd ..
# and install the pkgconfig file
-mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig
-cat etc/lua.pc > $PKG/usr/lib${LIBDIRSUFFIX}/pkgconfig/lua.pc
-
-find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-
-find $PKG/usr/man -type f -exec gzip -9 {} \;
-for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
-
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/{extras,html}
-cp -a COPYRIGHT HISTORY INSTALL README $PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGLIB/pkgconfig
+sed -e "s/%V%/$SHORTVER/" \
+ -e "s/%R%/$VERSION/" \
+ -e "s/%LIBDIRSUFFIX%/$LIBDIRSUFFIX/g" \
+ < $CWD/lua.pc \
+ > $PKGLIB/pkgconfig/lua.pc
+
+gzip -9 $PKG/usr/man/man*/*
+
+# 20241017 bkw: here is the only real difference between this and PV's:
+# we don't create an empty extras/ under the doc dir.
+mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
+cp -a README* $PKG/usr/doc/$PRGNAM-$VERSION
cp -a doc/*.html doc/logo.gif doc/lua.css $PKG/usr/doc/$PRGNAM-$VERSION/html
-cp -a etc test $PKG/usr/doc/$PRGNAM-$VERSION/extras
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
diff --git a/development/lua/lua.info b/development/lua/lua.info
index 90cca4042080..c87968954ea9 100644
--- a/development/lua/lua.info
+++ b/development/lua/lua.info
@@ -1,8 +1,8 @@
PRGNAM="lua"
-VERSION="5.1.5"
+VERSION="5.4.7"
HOMEPAGE="http://www.lua.org"
-DOWNLOAD="http://www.lua.org/ftp/lua-5.1.5.tar.gz"
-MD5SUM="2e115fe26e435e33b0d5c022e4490567"
+DOWNLOAD="http://www.lua.org/ftp/lua-5.4.7.tar.gz"
+MD5SUM="fc3f3291353bbe6ee6dec85ee61331e8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/development/lua/lua.pc b/development/lua/lua.pc
new file mode 100644
index 000000000000..dbb94a95c746
--- /dev/null
+++ b/development/lua/lua.pc
@@ -0,0 +1,31 @@
+# lua.pc -- pkg-config data for Lua
+
+# vars from install Makefile
+
+# grep '^V=' ../Makefile
+V=%V%
+# grep '^R=' ../Makefile
+R=%R%
+
+# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
+prefix= /usr
+INSTALL_BIN= ${prefix}/bin
+INSTALL_INC= ${prefix}/include
+INSTALL_LIB= ${prefix}/lib%LIBDIRSUFFIX%
+INSTALL_MAN= ${prefix}/man/man1
+INSTALL_LMOD= ${prefix}/share/lua/${V}
+INSTALL_CMOD= ${prefix}/lib%LIBDIRSUFFIX%/lua/${V}
+
+# canonical vars
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib%LIBDIRSUFFIX%
+includedir=${prefix}/include
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${R}
+Requires:
+Libs: -L${libdir} -llua -lm
+Cflags: -I${includedir}
+
+# (end of lua.pc)
diff --git a/development/lua/lua.usr.local.patch b/development/lua/lua.usr.local.patch
new file mode 100644
index 000000000000..9383c8c4787a
--- /dev/null
+++ b/development/lua/lua.usr.local.patch
@@ -0,0 +1,32 @@
+--- ./src/luaconf.h.orig 2023-05-02 15:02:30.000000000 -0500
++++ ./src/luaconf.h 2024-02-13 13:04:58.161007318 -0600
+@@ -224,19 +224,28 @@
+ #else /* }{ */
+
+ #define LUA_ROOT "/usr/local/"
++#define LUA_ROOT2 "/usr/"
+ #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
++#define LUA_LDIR2 LUA_ROOT2 "share/lua/" LUA_VDIR "/"
+ #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
++#define LUA_CDIR2 LUA_ROOT2 "lib/lua/" LUA_VDIR "/"
+
+ #if !defined(LUA_PATH_DEFAULT)
+ #define LUA_PATH_DEFAULT \
+ LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
++ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua;" \
+ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
++ LUA_CDIR2"?.lua;" LUA_CDIR2"?/init.lua;" \
+ "./?.lua;" "./?/init.lua"
+ #endif
+
+ #if !defined(LUA_CPATH_DEFAULT)
+ #define LUA_CPATH_DEFAULT \
+- LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
++ LUA_CDIR"?.so;" \
++ LUA_CDIR2"?.so;" \
++ LUA_CDIR"loadall.so;" \
++ LUA_CDIR2"loadall.so;" \
++ "./?.so"
+ #endif
+
+ #endif /* } */