aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2024-10-23 02:05:17 -0400
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2024-11-02 19:28:39 +0700
commit800906e965e391e30e64000b1e6e0458af1f89f8 (patch)
treed4871e6b6d61c6a2f6ec5853a522611f2c547ba1
parent3d3676a1458ea8a9387d079912bb2a0c06f2fa44 (diff)
libraries/lua-filesystem: 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-filesystem/README4
-rw-r--r--libraries/lua-filesystem/lfs.pc2
-rw-r--r--libraries/lua-filesystem/lua-filesystem.SlackBuild64
3 files changed, 36 insertions, 34 deletions
diff --git a/libraries/lua-filesystem/README b/libraries/lua-filesystem/README
index 351268cd98df..9908ac914c05 100644
--- a/libraries/lua-filesystem/README
+++ b/libraries/lua-filesystem/README
@@ -1,5 +1,9 @@
LuaFileSystem is a Lua library developed to complement the set
of functions related to filesystems offered by the standard
Lua distribution.
+
LuaFileSystem offers a portable way to access the underlying
directory structure and file attributes.
+
+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-filesystem/lfs.pc b/libraries/lua-filesystem/lfs.pc
index 9df9c4dd3e79..ee63c4e5f47d 100644
--- a/libraries/lua-filesystem/lfs.pc
+++ b/libraries/lua-filesystem/lfs.pc
@@ -1,7 +1,7 @@
prefix=/usr
exec_prefix=${prefix}
includedir=${prefix}/include
-libdir=${exec_prefix}/lib/lua/5.1
+libdir=${exec_prefix}/lib/lua/5.4
Name: lfs
Description: lfs - lua filesystem library
diff --git a/libraries/lua-filesystem/lua-filesystem.SlackBuild b/libraries/lua-filesystem/lua-filesystem.SlackBuild
index 81c71e84e447..dc845c92cbf8 100644
--- a/libraries/lua-filesystem/lua-filesystem.SlackBuild
+++ b/libraries/lua-filesystem/lua-filesystem.SlackBuild
@@ -22,13 +22,16 @@
# 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:
+# - build for lua 5.4 and lua51.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=lua-filesystem
SRCNAM=luafilesystem
VERSION=${VERSION:-1.6.3}
SRCVER=v_$(echo $VERSION | tr . _)
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -40,9 +43,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,18 +52,13 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
+SLKCFLAGS="-O2 -fPIC" # all arches 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"
+ SLKCFLAGS+=" -O2 -march=i686 -mtune=i686"
+elif [ "$ARCH" = "x86_64" -o "$ARCH" = "aarch64" ]; then
LIBDIRSUFFIX="64"
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
fi
set -e
@@ -72,33 +67,36 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-$SRCVER
-tar xvf $CWD/$SRCNAM-$SRCVER.tar.?z* || tar xvf $CWD/$SRCVER.tar.?z*
+tar xvf $CWD/$SRCNAM-$SRCVER.tar.gz || tar xvf $CWD/$SRCVER.tar.gz
cd $SRCNAM-$SRCVER
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 {} \;
-
-sed -i \
- -e "s|/usr/local|/usr|" \
- -e "s|/lib|/lib$LIBDIRSUFFIX|" \
- -e "s|-O2 -Wall -fPIC|$SLKCFLAGS -Wall|" \
- config || exit 1
-make
-install -m 0755 -D src/lfs.so $PKG/usr/lib$LIBDIRSUFFIX/lua/5.1/lfs.so
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
+
+runmake() {
+ local cmod=$( pkg-config $1 --variable INSTALL_CMOD )
+ local incs=$( pkg-config $1 --variable INSTALL_INC )
+
+ make clean
+ make PREFIX=/usr LUA_LIBDIR=$lmod LUA_INC=$incs WARN="-Wl,-s $SLKCFLAGS"
+ make install PREFIX=$PKG/usr LUA_LIBDIR=$PKG/$cmod
+}
+
+runmake lua
+[ -x /usr/bin/lua51 ] && runmake lua51
+
install -m 0644 -D src/lfs.h $PKG/usr/include/lfs.h
# install a pkgconfig file
-install -m 0644 -D $CWD/lfs.pc $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig/lfs.pc
-sed -i \
+# 20241023 bkw: NOTE: there's only a .pc file for the lua 5.4 module.
+# I doubt this will matter.
+PCDIR=$PKG/usr/lib$LIBDIRSUFFIX/pkgconfig
+mkdir -p $PCDIR
+sed \
-e "s|@VERSION@|$VERSION|" \
-e "s|/lib|/lib$LIBDIRSUFFIX|" \
- $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig/lfs.pc
-
-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
+ < $CWD/lfs.pc \
+ > $PKG/usr/lib$LIBDIRSUFFIX/pkgconfig/lfs.pc
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/html
cp -a README $PKG/usr/doc/$PRGNAM-$VERSION