mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2026-01-07 17:52:10 +01:00
79 lines
1.9 KiB
Plaintext
79 lines
1.9 KiB
Plaintext
# Contributor: Will Sinatra <wpsinatra@gmail.com>
|
|
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
|
|
pkgname=lua-lsqlite3
|
|
_pkgname=lsqlite3
|
|
pkgver=0.9.6
|
|
pkgrel=1
|
|
pkgdesc="A binding for Lua to the SQLite3 database library"
|
|
url="http://lua.sqlite.org"
|
|
license="MIT"
|
|
arch="all"
|
|
depends="sqlite"
|
|
_fossilver=v096
|
|
_rockrel=1
|
|
source="$_pkgname-$pkgver.zip::http://lua.sqlite.org/index.cgi/zip/lsqlite3_$_fossilver.zip?uuid=v$pkgver"
|
|
builddir="$srcdir/${_pkgname}_$_fossilver"
|
|
|
|
_luaversions="5.1 5.2 5.3 5.4"
|
|
for _v in $_luaversions; do
|
|
makedepends="$makedepends lua$_v lua$_v-dev lua$_v-libs luarocks$_v sqlite-dev"
|
|
subpackages="$subpackages lua$_v-${pkgname#lua-}:_subpackage"
|
|
checkdepends="$checkdepends lua$_v-lunit"
|
|
done
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
for _v in $_luaversions; do
|
|
cp -r "$builddir" "$builddir-$_v"
|
|
done
|
|
}
|
|
|
|
build() {
|
|
local _v; for _v in $_luaversions; do
|
|
msg "Building for Lua $_v..."
|
|
cd "$builddir-$_v"
|
|
luarocks-$_v \
|
|
CC="$CC" \
|
|
CFLAGS="$CFLAGS -fPIC" \
|
|
LUA_INCDIR="$(pkg-config --variable=includedir "lua$_v")" \
|
|
LUA_LIBDIR="$(pkg-config --variable=libdir "lua$_v")" \
|
|
LUA_VERSION="$_v" \
|
|
make --tree "./build-$_v" \
|
|
--deps-mode=none \
|
|
"$_pkgname-$pkgver-$_rockrel.rockspec"
|
|
done
|
|
}
|
|
|
|
check() {
|
|
local _v; for _v in $_luaversions; do
|
|
msg "Testing on lua$_v"
|
|
|
|
cd "$builddir-$_v"
|
|
lua$_v test/test.lua
|
|
done
|
|
}
|
|
|
|
package() {
|
|
mkdir -p "$pkgdir"
|
|
}
|
|
|
|
_subpackage() {
|
|
local _v="${subpkgname:3:3}"
|
|
pkgdesc="$pkgdesc (for Lua $_v)"
|
|
depends="lua$_v"
|
|
install_if="$pkgname=$pkgver-r$pkgrel lua$_v"
|
|
local rockdir="$subpkgdir/usr/lib/luarocks/rocks-$_v/$_pkgname/$pkgver-1"
|
|
local libdir="$subpkgdir/usr/lib/lua/$_v/"
|
|
|
|
cd "$builddir-$_v"
|
|
mkdir -p "$libdir"
|
|
cp -a lsqlite3.so "$libdir"/
|
|
|
|
mkdir -p "$rockdir"
|
|
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
|
|
}
|
|
sha512sums="
|
|
ad4ff9ed9a30e2dd8a5db5c02aff259ae523702875e276d4f98ab389c62dd415a45f49f9c25b9e12d136ee147beaa27d5cd616795468f371f7cdd98c5fce0962 lsqlite3-0.9.6.zip
|
|
"
|