aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-turbo/APKBUILD
blob: dd51d391fc82aa8b39dbf4375f5f897de10df13f (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>

pkgname=lua-turbo
_jitver=2.0.4
pkgver=2.0.3
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"

_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="2e701b97838dcee8ebbd1c4d4a286a91  lua-turbo-2.0.3.tar.gz"
sha256sums="4c4d8367d68319974dc4a48f0e65930eca20a02ff9694c4947a9be14ee95cdc9  lua-turbo-2.0.3.tar.gz"
sha512sums="339fd95e0dda393d845fe2dc53e65936a7648f21e543ebdd88435f171791c48b4e281ed6702849c70e5b5bf3b117a99dffe1c1aa9553ebd8471c9ee535820533  lua-turbo-2.0.3.tar.gz"