diff options
author | Benjamin Trigona-Harany <slackbuilds@jaxartes.net> | 2019-09-21 14:02:38 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2019-09-21 14:02:38 +0700 |
commit | 80100fba7caa5fd3cb963a38649b68dd93cdf879 (patch) | |
tree | 782cc4fe441cdb89f2ddbef853a6c921a7b81e4a /libraries | |
parent | 9f6816e1475a227da48f6afb9a1bf1c260f75e38 (diff) | |
download | slackbuilds-80100fba7caa5fd3cb963a38649b68dd93cdf879.tar.gz |
libraries/lua-luv: Added (libuv bindings for lua).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/lua-luv/README | 6 | ||||
-rw-r--r-- | libraries/lua-luv/lua-luv.SlackBuild | 104 | ||||
-rw-r--r-- | libraries/lua-luv/lua-luv.info | 12 | ||||
-rw-r--r-- | libraries/lua-luv/slack-desc | 19 |
4 files changed, 141 insertions, 0 deletions
diff --git a/libraries/lua-luv/README b/libraries/lua-luv/README new file mode 100644 index 0000000000..418e80f7e5 --- /dev/null +++ b/libraries/lua-luv/README @@ -0,0 +1,6 @@ +This library makes libuv available to lua scripts. It was made for the luvit +project but should usable from nearly any lua project. + +The library can be used by multiple threads at once. Each thread is assumed to +load the library from a different lua_State. Luv will create a unique uv_loop_t +for each state. You can't share uv handles between states/loops. diff --git a/libraries/lua-luv/lua-luv.SlackBuild b/libraries/lua-luv/lua-luv.SlackBuild new file mode 100644 index 0000000000..25bc075b0e --- /dev/null +++ b/libraries/lua-luv/lua-luv.SlackBuild @@ -0,0 +1,104 @@ +#!/bin/sh + +# SlackBuild script for lua-luv + +# Copyright 2019 Benjamin Trigona-Harany <slackbuilds@jaxartes.net> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +SRCNAM=luv +PRGNAM=lua-$SRCNAM +VERSION=${VERSION:-1.30.1_0} +SRCVER=$(echo $VERSION | tr _ -) +COMPATNAM=lua-compat-5.3 +COMPATVER=0.7 +COMPATSRC=$COMPATNAM-$COMPATVER +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + LIBDIRSUFFIX="64" +else + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $SRCNAM-$SRCVER +tar xvf $CWD/$SRCNAM-$SRCVER.tar.gz +cd $SRCNAM-$SRCVER +tar xvf $CWD/$COMPATSRC.tar.gz -C deps +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 {} \; + +# fix install directory +sed -i -r "s/\/lib(\"|\/)/\/lib$LIBDIRSUFFIX\1/g" CMakeLists.txt + +mkdir -p build +cd build + cmake \ + -DWITH_SHARED_LIBUV=ON \ + -DLUA_BUILD_TYPE=System \ + -DBUILD_MODULE=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DLUA_COMPAT53_DIR=deps/$COMPATSRC \ + -DCMAKE_INSTALL_PREFIX=/usr \ + .. + + make install DESTDIR=$PKG +cd .. + +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 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + LICENSE.txt README.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/libraries/lua-luv/lua-luv.info b/libraries/lua-luv/lua-luv.info new file mode 100644 index 0000000000..f0fcafd653 --- /dev/null +++ b/libraries/lua-luv/lua-luv.info @@ -0,0 +1,12 @@ +PRGNAM="lua-luv" +VERSION="1.30.1-0" +HOMEPAGE="https://github.com/luvit/luv" +DOWNLOAD="https://github.com/luvit/luv/archive/1.30.1-0/luv-1.30.1-0.tar.gz \ + https://github.com/keplerproject/lua-compat-5.3/archive/v0.7/lua-compat-5.3-0.7.tar.gz" +MD5SUM="48a1c2f0f5652ae009447cb83ceb2b69 \ + 61c3f1af0d7d587f602ac4a13d77a823" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="libuv luajit" +MAINTAINER="Benjamin Trigona-Harany" +EMAIL="slackbuilds@jaxartes.net" diff --git a/libraries/lua-luv/slack-desc b/libraries/lua-luv/slack-desc new file mode 100644 index 0000000000..6f57ba9905 --- /dev/null +++ b/libraries/lua-luv/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +lua-luv: lua-luv (libuv bindings for lua) +lua-luv: +lua-luv: This library makes libuv available to lua scripts. +lua-luv: +lua-luv: +lua-luv: +lua-luv: +lua-luv: +lua-luv: +lua-luv: +lua-luv: |