# Contributor: Carlo Landmeter # Maintainer: Carlo Landmeter 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"