aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-turbo/APKBUILD
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2017-08-16 15:16:04 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2017-08-16 15:16:04 +0200
commit4917008e9eb17389d6f55274590d3b11ccd41c9c (patch)
treef249cb87953c8d018f74087d3b0a78e495fe3641 /community/lua-turbo/APKBUILD
parent81aa4582996a5beeb86e14018755cdde27130af7 (diff)
downloadaports-4917008e9eb17389d6f55274590d3b11ccd41c9c.tar.bz2
aports-4917008e9eb17389d6f55274590d3b11ccd41c9c.tar.xz
main/lua-turbo: move to community
Diffstat (limited to 'community/lua-turbo/APKBUILD')
-rw-r--r--community/lua-turbo/APKBUILD77
1 files changed, 77 insertions, 0 deletions
diff --git a/community/lua-turbo/APKBUILD b/community/lua-turbo/APKBUILD
new file mode 100644
index 0000000000..77613e699f
--- /dev/null
+++ b/community/lua-turbo/APKBUILD
@@ -0,0 +1,77 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
+
+pkgname=lua-turbo
+_jitver=2.1.0_beta3
+pkgver=2.1.1
+pkgrel=0
+pkgdesc="a framework built for LuaJIT 2 and Linux"
+url="http://www.turbolua.org/"
+# luajit is not available for disabled arches
+arch="all !s390x"
+license="Apache-2.0"
+depends="luajit ca-certificates lua5.1-cjson"
+makedepends="libressl-dev util-linux"
+# bundled tests dont work
+options="!check"
+install=""
+subpackages="lua5.1-turbo:lua51_turbo:noarch"
+source="$pkgname-$pkgver.tar.gz::https://github.com/kernelsauce/turbo/archive/v$pkgver.tar.gz
+ 0001-use-cjson-instead-of-JSON.lua.patch
+ ${pkgname}.initd
+ ${pkgname}.confd"
+
+builddir="$srcdir/turbo-$pkgver"
+
+prepare() {
+ cd "$builddir"
+ default_prepare
+ # check if we are using the current luajit version
+ if [ -r ../../../../main/luajit/APKBUILD ]; then
+ local _currentjit=$(grep "^pkgver=" ../../../../main/luajit/APKBUILD)
+ if [ "${_currentjit#*=}" != "$_jitver" ]; then
+ die "luajit version does not match!"
+ fi
+ else
+ die "cannot locate luajit APKBUILD!"
+ fi
+ # we need to fix the loading of libssl.
+ # so we replace symlink with real filename
+ sed -i -e \
+ "s|os.getenv(\"TURBO_LIBSSL\") or \"ssl\"|\"$(readlink /usr/lib/libssl.so)\"|" \
+ turbo/hash.lua
+ sed -i -e \
+ "s|os.getenv(\"TURBO_LIBSSL\") or \"ssl\"|\"$(readlink /usr/lib/libssl.so)\"|" \
+ turbo/crypto_linux.lua
+}
+
+build() {
+ cd "$builddir"
+ export LUAJIT_VERSION="${_jitver/_/-}"
+ make
+}
+
+lua51_turbo() {
+ pkgdesc="$pkgdesc (lua 5.1 files)"
+ mkdir -p "$subpkgdir/usr/share"
+ mv "$pkgdir/usr/share/lua" \
+ "$subpkgdir"/usr/share/
+}
+
+package() {
+ cd "$builddir"
+ make PREFIX="$pkgdir"/usr install
+ install -Dm 755 "$srcdir"/${pkgname}.initd \
+ $pkgdir/etc/init.d/$pkgname
+ install -Dm 644 "$srcdir"/${pkgname}.confd \
+ $pkgdir/etc/conf.d/$pkgname
+ # remove ca-certificates
+ rm -f "$pkgdir"/usr/share/*/turbo/ca-certificates.crt \
+ "$pkgdir"/usr/share/*/*/turbo/ca-certificates.crt
+}
+
+sha512sums="207b630ce2b3cfa06266fdabaa82420bc04ecfff3998f04db080c8af14bea3d8b01433416f3a827fe2d2fdb8e72085e36956de5f812305b3fa77207dd4152d5b lua-turbo-2.1.1.tar.gz
+39d5b667e1e0410cce2cfbff21012eeef5059f4ce4e2ca7446420270084ad957d0df7f39cf8fd64e853fb8d43eed52abeb1866cbad6247dc554b7475671817d8 0001-use-cjson-instead-of-JSON.lua.patch
+6be9ca5d8a02c88d82bc43c4f2de779872a8400c8bd59663f71bfe4ac151c17bb213b4e31f2668fc57ca8b98fa44846f666c9865eb786203b34666e64e885861 makefile.patch
+2e91d5dda33b4bf09667fd23c80a471e93605125a820c440c2b1b022b8bce6ab065493473b153f1fa1863e9655f6413dbe42dc983260da4ed8bee3b2e3743ec2 lua-turbo.initd
+3d2816738a2ee615bb6523b6b0aff12a51062e56ade5dbaa4b1b63afda8dce0a532c099b8a03fe67d589058ac8a7d49434a68fb28d93b167a56c56acc7596fdb lua-turbo.confd"