aboutsummaryrefslogtreecommitdiffstats
path: root/community/lua-turbo/APKBUILD
blob: 7d6d09f80f05c72e30d6315d72b17f5496b09943 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>

pkgname=lua-turbo
pkgver=2.1.3
pkgrel=5
pkgdesc="framework built for LuaJIT 2 and Linux"
url="https://github.com/kernelsauce/turbo"
arch="all"
license="Apache-2.0"
depends="luajit lua5.1-cjson lua5.1-sec ca-certificates"
subpackages="$pkgname-openrc"
# https://github.com/kernelsauce/turbo/issues/343 (libressl-dev)
makedepends="openssl-dev"
options="!check" # bundled tests dont work
source="$pkgname-$pkgver.tar.gz::https://github.com/kernelsauce/turbo/archive/v$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	0001-use-cjson-instead-of-JSON.lua.patch
	default-luasocket.patch
	openssl-1.1.patch
	"

builddir="$srcdir/turbo-$pkgver"

prepare() {
	default_prepare
	# we need to fix the loading of libssl.
	local _soname=$(scanelf --nobanner --soname /usr/lib/libssl.so | awk '{print $2}')
	sed -i -e \
		"/ffi.load/s|\"ssl\")$|\"/usr/lib/$_soname\")|" \
		turbo/hash.lua turbo/crypto_linux.lua
}

build() {
	export LUAJIT_VERSION="$(pkgconf luajit --variable=version)"
	make
}

package() {
	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
	# we use luajit only
	rm -rf "$pkgdir/usr/share/lua"
	# remove cruft
	find "$pkgdir" -name ca-certificates.crt -delete \
		-o -name turbovisor -delete -o -name JSON.lua -delete
}

sha512sums="c553478f3985d2b462a81a6a9555b911d50dab8fe790aa4185fc1fbc2b4af7e85418dc874d91a85fa38d57f2057acefb7d91996ae250a9a794d0d61055f95326  lua-turbo-2.1.3.tar.gz
2e91d5dda33b4bf09667fd23c80a471e93605125a820c440c2b1b022b8bce6ab065493473b153f1fa1863e9655f6413dbe42dc983260da4ed8bee3b2e3743ec2  lua-turbo.initd
3d2816738a2ee615bb6523b6b0aff12a51062e56ade5dbaa4b1b63afda8dce0a532c099b8a03fe67d589058ac8a7d49434a68fb28d93b167a56c56acc7596fdb  lua-turbo.confd
b3579e2a90dd0a50701f06f07de88e2398145c12df41c07c87a22e78bd159280b7e445b51c3a37f8314695abdcdc6f2045433a84d5c84be795d1bcbbbd6c8f97  0001-use-cjson-instead-of-JSON.lua.patch
724e78556296e58f4df8e089f782dba7d4387a26e6ab80f5585b65c35b97c460edf3fe2e6b33bc817fdb5eb5923fd0ae39054060c238dbd41a185b52a70b3949  default-luasocket.patch
6cc7c511f66f5d28b0a0799b22e6545dc2dce975539a446eff56ea0016f28116f6c777536b3d1a9e9c076e6db7b4ed75d7caa8a201efdd467b857a7342a6c2c0  openssl-1.1.patch"