aboutsummaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-10-23 05:10:05 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-11-02 19:28:39 +0700
commite529e62410144882e79b54ba8de184018f17fe0d (patch)
treea9b71dec065806dd234c23e9c34ccbae7ab9073f /libraries
parent490a5faa5e052e0f8ad5cb037063249154c2e281 (diff)
libraries/lua-zlib: Support for lua 5.4, lua51.
Signed-off-by: B. Watson <urchlay@slackware.uk> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/lua-zlib/README3
-rw-r--r--libraries/lua-zlib/lua-zlib.SlackBuild69
-rw-r--r--libraries/lua-zlib/lua-zlib.info6
3 files changed, 35 insertions, 43 deletions
diff --git a/libraries/lua-zlib/README b/libraries/lua-zlib/README
index fe0179ddc52f..7950bd936fcc 100644
--- a/libraries/lua-zlib/README
+++ b/libraries/lua-zlib/README
@@ -1,3 +1,6 @@
Simple streaming interface to zlib for Lua. Consists of two functions:
inflate and deflate. Both functions return "stream functions" (takes a
buffer of input and returns a buffer of output).
+
+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-zlib/lua-zlib.SlackBuild b/libraries/lua-zlib/lua-zlib.SlackBuild
index c91a4dba0ec2..5e7297feec73 100644
--- a/libraries/lua-zlib/lua-zlib.SlackBuild
+++ b/libraries/lua-zlib/lua-zlib.SlackBuild
@@ -22,12 +22,15 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20241023 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - update for v1.2 (the old 2014 version wouldn't build with lua 5.4).
+# - build for lua 5.4 and lua51.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=lua-zlib
-HASH=${HASH:-c0014bcbc4c3fd65ba3519b10965f0c184c1a059}
-VERSION=${VERSION:-20140201_c0014bc}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-1.2}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -39,9 +42,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
@@ -51,18 +51,13 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+SLKCFLAGS="-O2 -fPIC" # all arches need PIC
if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
+ SLKCFLAGS+=" -O2 -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS=""
+ SLKCFLAGS+=" -O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" -o "$ARCH" = "aarch64" ]; then
LIBDIRSUFFIX="64"
-else
- SLKCFLAGS=""
- LIBDIRSUFFIX=""
fi
set -e
@@ -70,32 +65,26 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $PRGNAM-$HASH
-tar xvf $CWD/$HASH.tar.gz || tar xvf $CWD/$PRGNAM-$HASH.tar.gz
-cd $PRGNAM-$HASH
+rm -rf $PRGNAM-$VERSION
+tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
+cd $PRGNAM-$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 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-# Getting default cflags from config then append slkcflags to them and passing to make
-_CFLAGS=$( cat Makefile |grep ^LNX_CFLAGS |sed "s,LNX_CFLAGS\ \ \=,,g" )" "${SLKCFLAGS}
-_LIBDIR=$( cat Makefile |grep ^LIBDIR |sed "s,LIBDIR\ \ \ ?\=,,g" )${LIBDIRSUFFIX}
-make linux \
- LUAPATH=/usr/share/lua/5.1 \
- LUACPATH=/usr/lib${LIBDIRSUFFIX}/lua/5.1 \
- LIBDIR=" $_LIBDIR" \
- LNX_CFLAGS=" $_CFLAGS"
-
-# Installing:
-mkdir -p $PKG/usr/lib${LIBDIRSUFFIX}/lua/5.1
-make install \
- LUACPATH=$PKG/usr/lib${LIBDIRSUFFIX}/lua/5.1
-
-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
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
+
+# 20241023 bkw: easier to manually install here than coerce 'make install'
+# into doing the right thing.
+runmake() {
+ local cmod=$( pkg-config $1 --variable INSTALL_CMOD )
+ local incs=$( pkg-config $1 --variable INSTALL_INC )
+
+ make clean
+ make linux WARN="$SLKCFLAGS" INCDIR=-I$incs LIBDIR=-L/usr/lib$LIBDIRSUFFIX
+ install -s -m0755 -D zlib.so $PKG/$cmod/zlib.so
+}
+
+runmake lua
+[ -x /usr/bin/lua51 ] && runmake lua51
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
diff --git a/libraries/lua-zlib/lua-zlib.info b/libraries/lua-zlib/lua-zlib.info
index 4850711d5fba..ab04c6f87559 100644
--- a/libraries/lua-zlib/lua-zlib.info
+++ b/libraries/lua-zlib/lua-zlib.info
@@ -1,8 +1,8 @@
PRGNAM="lua-zlib"
-VERSION="20140201_c0014bc"
+VERSION="1.2"
HOMEPAGE="https://github.com/brimworks/lua-zlib"
-DOWNLOAD="https://github.com/brimworks/lua-zlib/archive/c0014bcbc4c3fd65ba3519b10965f0c184c1a059/lua-zlib-c0014bcbc4c3fd65ba3519b10965f0c184c1a059.tar.gz"
-MD5SUM="3ba445324203e4e0beb2bc1cd93c547a"
+DOWNLOAD="https://github.com/brimworks/lua-zlib/archive/v1.2/lua-zlib-1.2.tar.gz"
+MD5SUM="7c4596f1720e078e4dd8960f19e226d6"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="lua"