aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-turbo/APKBUILD
blob: 7417e736ffbb99df20f2115f374d00ae871a2feb (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.1
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="29562bdad7dd6beb5b13dd954b63ec28  lua-turbo-2.0.1.tar.gz
5fbc1fcf73ef48998a90b06df782162c  fix-bindir.patch"
sha256sums="3885920f018b8d7b5a71d8ea097c0b8da18b2b1e7c9251aabbd1af67c882d7fc  lua-turbo-2.0.1.tar.gz
d676d0cd520759f293afdb59e59024a4ad30a8c419ab348e6acc1e72a1bb90a4  fix-bindir.patch"
sha512sums="a3f8b9fa88dc25d13b1101d2feab403d6b02634d8eea7dc94bf8ed9fa7aabb30f4c8d3057debb194fcdc58777b0443fb550f797f94fc6f29705e0a20794bfbde  lua-turbo-2.0.1.tar.gz
e8ce4427bcf7040fdf3f711a533a0857d9dcf3678334fd4b32917642cb1a5c540ade3d3c8e26bc6b8a7ce0ff6c6f64c92eda70edec3874e7aa3507acb82c2211  fix-bindir.patch"