libraries/luasocket: Support for lua 5.4, lua51.

Signed-off-by: B. Watson <urchlay@slackware.uk>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2024-10-24 03:15:07 -04:00 committed by Willy Sudiarto Raharjo
parent 41a4da0dc7
commit e7bccea146
No known key found for this signature in database
GPG key ID: 3F617144D7238786
2 changed files with 35 additions and 31 deletions

View file

@ -6,3 +6,6 @@ needed by applications that deal with the Internet.
The library is available under the same terms and conditions as the
Lua language, the MIT license. The idea is that if you can use Lua in
a project, you should also be able to use LuaSocket.
Optional dependency: lua51. If lua51 is installed at build time, this
package will contain modules for Lua 5.1.

View file

@ -24,11 +24,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.
# - install samples/ and etc/ uncompressed in the doc dir (takes an extra
# ~800KB of disk space, which isn't worth trying to optimize away).
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=luasocket
VERSION=${VERSION:-3.1.0}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -40,9 +45,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 +54,11 @@ 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+=" -march=i586 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS=" -O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS=" -O2"
LIBDIRSUFFIX="64"
else
SLKCFLAGS=" -O2"
LIBDIRSUFFIX=""
SLKCFLAGS+=" -march=i686 -mtune=i686"
fi
set -e
@ -75,28 +70,34 @@ 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 {} \;
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
make PLAT=linux LUAV=5.1 prefix=/usr MYCFLAGS="$SLKCFLAGS"
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 )
# Installing:
make install CDIR_linux="lib${LIBDIRSUFFIX}/lua/5.1" DESTDIR=$PKG prefix=/usr
make clean
make -j1 \
MYCFLAGS="$SLKCFLAGS" \
INC_PATH=-I$incs \
INSTALL_TOP_LDIR=$PKG/$lmod \
INSTALL_TOP_CDIR=$PKG/$cmod \
LUAINC=$incs \
INSTALL_EXEC="install -s -m0755" \
linux install install-unix
}
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
runmake lua
pkg-config --exists lua51 && runmake lua51
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a docs/*.* FIX LICENSE CHANGELOG.md README.md $PKG/usr/doc/$PRGNAM-$VERSION
for i in samples etc test ; do
tar zcvf $PKG/usr/doc/$PRGNAM-$VERSION/$i.tar.gz $i
done
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
mkdir -p $PKGDOC
cp -a docs/*.* FIX LICENSE CHANGELOG.md README.md samples etc test $PKGDOC
cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
rm $PKG/usr/doc/$PRGNAM-$VERSION/*.ppt
rm $PKGDOC/*.ppt
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc