aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-10-23 00:03:35 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-11-02 19:28:39 +0700
commit3d3676a1458ea8a9387d079912bb2a0c06f2fa44 (patch)
tree3b3e24772778b8cbd35f05be9211cf21e8a9dad0
parent60dbc95786da264fef692c683e754d3d3d7aad8f (diff)
libraries/lua-posix: Support for lua 5.4, lua51.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--libraries/lua-posix/README9
-rw-r--r--libraries/lua-posix/lua-posix.SlackBuild79
2 files changed, 38 insertions, 50 deletions
diff --git a/libraries/lua-posix/README b/libraries/lua-posix/README
index 685c688561f1..06aed9a2fb8d 100644
--- a/libraries/lua-posix/README
+++ b/libraries/lua-posix/README
@@ -1,10 +1,5 @@
A library binding various POSIX APIs. POSIX is the IEEE Portable
Operating System Interface standard. luaposix is based on lposix.
-This require one version of Lua installed (lua, lua52, lua53, luajit):
-Default support for all versions of Lua installed before build.
-To specify which Lua versions:
- LUAVER="vers"
-
-"vers" must be one or more of "5.1 5.2 5.3 jit", in the right order,
-separated with space
+Optional dependency: lua51. If lua51 is installed at build time, this
+package will contain a module for Lua 5.1.
diff --git a/libraries/lua-posix/lua-posix.SlackBuild b/libraries/lua-posix/lua-posix.SlackBuild
index 4ce422273888..ade736f7fc79 100644
--- a/libraries/lua-posix/lua-posix.SlackBuild
+++ b/libraries/lua-posix/lua-posix.SlackBuild
@@ -21,12 +21,20 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20241022 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - build for lua 5.4 and lua51.
+
+# Note: you can test whether the module works by running some of the
+# examples in the doc dir, e.g.:
+# $ lua /tmp/SBo/luaposix-35.0/doc/examples/dir.lua
+# (and also with lua51)
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=lua-posix
SRCNAM=luaposix
VERSION=${VERSION:-35.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -38,9 +46,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
@@ -50,54 +55,42 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+SLKCFLAGS="-O2 -fPIC" # on all platforms we need PIC
if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
+ SLKCFLAGS+=" -O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
+ SLKCFLAGS+=" -O2 -march=i686 -mtune=i686"
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
-cd $TMP
-rm -rf $PRGNAM-$VERSION
-tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
-cd $SRCNAM-$VERSION
-chown -R root:root .
-find -L . \
- \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
- -exec chmod 755 {} \; -o \
- \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \;
-
-LUAVER=${LUAVER:-"5.1 5.2 5.3 5.4 jit"}
-
-for i in $LUAVER
-do
- if [ $i != 5.1 ]; then ver=$i; fi
- if $(lua$ver -v &> /dev/null)
- then
- sed -i "1s|lua.*|lua$ver|" build-aux/luke
- build-aux/luke all
- build-aux/luke PREFIX=$PKG/usr install
- fi
-done
-
-if [ -e $PKG/usr/lib ] && [ ! -z "$LIBDIRSUFFIX" ]; then
- mv $PKG/usr/lib $PKG/usr/lib$LIBDIRSUFFIX
-fi
-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
+LUKE=./build-aux/luke
+
+# I don't see a "make clean" equivalent, so blow away the dir and
+# re-extract it between builds for different lua versions.
+runmake() {
+ cd $TMP
+ rm -rf $PRGNAM-$VERSION
+ tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
+ cd $SRCNAM-$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 {} +
+
+ $LUKE CFLAGS="-Wl,-s $SLKCFLAGS" \
+ LUA_INCDIR="$( pkg-config $1 --variable INSTALL_INC )" \
+ LDFLAGS="$( pkg-config $1 --libs )"
+
+ $LUKE install \
+ INST_LIBDIR=$PKG/"$( pkg-config $1 --variable INSTALL_CMOD )" \
+ INST_LUADIR=$PKG/"$( pkg-config $1 --variable INSTALL_LMOD )"
+}
+
+runmake lua
+[ -x /usr/bin/lua51 ] && runmake lua51
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -r -t $PKG/usr/doc/$PRGNAM-$VERSION doc/* AUTHORS LICENSE NEWS.md README.md