aboutsummaryrefslogtreecommitdiff
path: root/libraries/lua-readline/lua-readline.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/lua-readline/lua-readline.SlackBuild')
-rw-r--r--libraries/lua-readline/lua-readline.SlackBuild41
1 files changed, 16 insertions, 25 deletions
diff --git a/libraries/lua-readline/lua-readline.SlackBuild b/libraries/lua-readline/lua-readline.SlackBuild
index 35029fe75ff79..5aad2c4fc113c 100644
--- a/libraries/lua-readline/lua-readline.SlackBuild
+++ b/libraries/lua-readline/lua-readline.SlackBuild
@@ -1,7 +1,7 @@
#!/bin/sh
# Slackware build script for lua-readline
-# Copyright 2020 abooksigun <abooksigun09@gmail.com>
+# Copyright 2021 abooksigun <abooksigun09@gmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,7 +23,7 @@
PRGNAM=lua-readline
SRCNAM=readline
-VERSION=${VERSION:-2.6}
+VERSION=${VERSION:-2.8}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -69,29 +69,20 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-gcc $SLKCFLAGS -I /usr/include -c C-readline.c -o C-readline.o
-gcc $SLKCFLAGS -shared -o C-readline.so C-readline.o
-
-install -D -m 0755 C-readline.so $PKG/usr/lib$LIBDIRSUFFIX/lua/5.1/C-readline.so
-install -D -m 0644 readline.lua $PKG/usr/share/lua/5.1/readline.lua
-
-# lua 5.2 support.
-if $(lua5.2 -v &> /dev/null); then
- gcc $SLKCFLAGS -I /usr/include/lua5.2 -c C-readline.c -o C-readline.o
- gcc $SLKCFLAGS -shared -o C-readline.so.5.2 C-readline.o
-
- install -D -m 0755 C-readline.so.5.2 $PKG/usr/lib$LIBDIRSUFFIX/lua/5.2/C-readline.so
- install -D -m 0644 readline.lua $PKG/usr/share/lua/5.2/readline.lua
-fi
-
-# lua 5.3 support
-if $(lua5.3 -v &> /dev/null); then
- gcc $SLKCFLAGS -I /usr/include/lua5.3 -c C-readline.c -o C-readline.o
- gcc $SLKCFLAGS -shared -o C-readline.so.5.3 C-readline.o
-
- install -D -m 0755 C-readline.so.5.3 $PKG/usr/lib$LIBDIRSUFFIX/lua/5.3/C-readline.so
- install -D -m 0644 readline.lua $PKG/usr/share/lua/5.3/readline.lua
-fi
+LUAVERS="5.1 5.2 5.3 5.4"
+
+for luaver in $LUAVERS
+do
+ if [ $luaver != 5.1 ]; then version=$luaver dir=lua$version; fi
+ if $(lua$version -v &> /dev/null)
+ then
+ gcc $SLKCFLAGS -I /usr/include/$dir -c C-readline.c -o C-readline.o
+ gcc $SLKCFLAGS -shared -o C-readline.so.$luaver C-readline.o
+
+ install -D -m 0755 C-readline.so.$luaver $PKG/usr/lib$LIBDIRSUFFIX/lua/$luaver/C-readline.so
+ install -D -m 0644 readline.lua $PKG/usr/share/lua/$luaver/readline.lua
+ fi
+done
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