diff options
author | B. Watson <urchlay@slackware.uk> | 2024-10-23 03:11:58 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-11-02 19:28:39 +0700 |
commit | 490a5faa5e052e0f8ad5cb037063249154c2e281 (patch) | |
tree | d252b206c4db55b85189dd50492c886c87d5042e | |
parent | 800906e965e391e30e64000b1e6e0458af1f89f8 (diff) |
libraries/luaexpat: 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/luaexpat/README | 3 | ||||
-rw-r--r-- | libraries/luaexpat/luaexpat.SlackBuild | 57 |
2 files changed, 29 insertions, 31 deletions
diff --git a/libraries/luaexpat/README b/libraries/luaexpat/README index ef08bd79523a..f617204d0f27 100644 --- a/libraries/luaexpat/README +++ b/libraries/luaexpat/README @@ -1,2 +1,5 @@ LuaExpat is a SAX XML parser based on the Expat library. LuaExpat is free software and uses the same license as Lua 5.1. + +Optional dependency: lua51. If lua51 is installed at build time, this +package will contain a module for Lua 5.1. diff --git a/libraries/luaexpat/luaexpat.SlackBuild b/libraries/luaexpat/luaexpat.SlackBuild index 18d976761913..9f372dba0e40 100644 --- a/libraries/luaexpat/luaexpat.SlackBuild +++ b/libraries/luaexpat/luaexpat.SlackBuild @@ -24,11 +24,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: +# - build for both lua 5.4 and lua51. +# Note: there's a new version out (1.5.2) but I didn't update to it. + cd $(dirname $0) ; CWD=$(pwd) PRGNAM=luaexpat VERSION=${VERSION:-1.5.1} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -40,9 +44,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 +53,11 @@ 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="" - LIBDIRSUFFIX="64" -else - SLKCFLAGS="" - LIBDIRSUFFIX="" + SLKCFLAGS+=" -O2 -march=i686 -mtune=i686" fi set -e @@ -76,23 +70,24 @@ mkdir $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 {} \; - -make \ - LUA_LIBDIR=" /usr/lib${LIBDIRSUFFIX}/lua/5.1" \ - LUA_INC=" -I/usr/include" \ - CFLAGS=" $SLKCFLAGS" - -make install \ - LUA_CDIR=" $PKG/usr/lib${LIBDIRSUFFIX}/lua/5.1" \ - LUA_LDIR=" $PKG/usr/share/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 {} + + +runmake() { + local cmod=$( pkg-config $1 --variable INSTALL_CMOD ) + local lmod=$( pkg-config $1 --variable INSTALL_LMOD ) + local incs=$( pkg-config $1 --variable INSTALL_INC ) + + make clean + make -j1 \ + LUA_INC=-I$incs LUA_LDIR=$lmod LUA_CDIR=$cmod \ + COMMON_CFLAGS="-Wl,-s $SLKCFLAGS" \ + DESTDIR=$PKG \ + lib install +} + +runmake lua +[ -x /usr/bin/lua51 ] && runmake lua51 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a \ |