diff options
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/lua-posix/README | 9 | ||||
-rw-r--r-- | libraries/lua-posix/lua-posix.SlackBuild | 79 |
2 files changed, 38 insertions, 50 deletions
diff --git a/libraries/lua-posix/README b/libraries/lua-posix/README index 685c688561f13..06aed9a2fb8df 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 4ce4222738885..ade736f7fc790 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 |