aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-turbo/APKBUILD
blob: 4dd9ca0a612d7ea3f66e67bbeed4a377e4470c1c (plain)
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
59
60
61
62
63
64
65
66
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>

pkgname=lua-turbo
_jitver=2.0.4
pkgver=2.0.0
pkgrel=0
pkgdesc="a framework built for LuaJIT 2 and Linux"
url="http://www.turbolua.org/"
arch="all"
license="GPL"
depends="luajit"
depends_dev=""
makedepends="$depends_dev openssl-dev"
install=""
subpackages=""
source="$pkgname-$pkgver.tar.gz::https://github.com/kernelsauce/turbo/archive/v$pkgver.tar.gz
	fix-bindir.patch"

_builddir="$srcdir/turbo-$pkgver"

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	# check if we are using the current luajit version
	if [ -r ../../../../main/luajit/APKBUILD ]; then
		local _currentjit=$(grep "^pkgver=" ../../../../main/luajit/APKBUILD)
		export LUAJIT_VERSION="$_jitver"
		msg "Building for luajit version $_jitver"
		if [ "${_currentjit#*=}" != "$LUAJIT_VERSION" ]; 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 || return 1
	sed -i -e \
		"s|os.getenv(\"TURBO_LIBSSL\") or \"ssl\"|\"$(readlink /usr/lib/libssl.so)\"|" \
		turbo/crypto_linux.lua || return 1
}

build() {
	cd "$_builddir"
	make PREFIX=/usr || return 1
}

package() {
	cd "$_builddir"
	make PREFIX="$pkgdir"/usr install || return 1
}

md5sums="387f768f3c0d617cba882b002aeb289d  lua-turbo-2.0.0.tar.gz
5fbc1fcf73ef48998a90b06df782162c  fix-bindir.patch"
sha256sums="1c538e7d3190ac17898d61e83654404859a30c37eaaef8be1b9e78c55d2b3999  lua-turbo-2.0.0.tar.gz
d676d0cd520759f293afdb59e59024a4ad30a8c419ab348e6acc1e72a1bb90a4  fix-bindir.patch"
sha512sums="9261dd4a080f5c1b2474d4bb5d46232dcec782687587df6458a19761419ffbbeb8c8c90de1b09f5c9de2da9099d950d4cd6ac86da0d25150df54c77fff090577  lua-turbo-2.0.0.tar.gz
e8ce4427bcf7040fdf3f711a533a0857d9dcf3678334fd4b32917642cb1a5c540ade3d3c8e26bc6b8a7ce0ff6c6f64c92eda70edec3874e7aa3507acb82c2211  fix-bindir.patch"