mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-06-04 08:55:20 +02:00
82 lines
2.4 KiB
Text
82 lines
2.4 KiB
Text
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
|
|
_luaversions="5.1 5.2 5.3 5.4"
|
|
pkgname=lua-lgi
|
|
_rockname="${pkgname#lua-*}"
|
|
pkgver=0.9.2_git20241227
|
|
_gitcommit=a412921fad445bcfc05a21148722a92ecb93ad06
|
|
pkgrel=0
|
|
pkgdesc="Dynamic Lua binding to GObject libraries using GObject-Introspection"
|
|
url="https://github.com/lgi-devs/lgi"
|
|
arch="all"
|
|
license="MIT"
|
|
makedepends="glib-dev gobject-introspection-dev libffi-dev"
|
|
checkdepends="dbus gtk+3.0 xvfb-run"
|
|
subpackages="$pkgname-doc"
|
|
for _i in $_luaversions; do
|
|
makedepends="$makedepends lua$_i-dev"
|
|
subpackages="$subpackages lua$_i-$_rockname:_split"
|
|
done
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/lgi-devs/lgi/archive/$_gitcommit.tar.gz
|
|
tests.patch
|
|
"
|
|
builddir="$srcdir/lgi-$_gitcommit"
|
|
|
|
case "$CARCH" in
|
|
# Integer overflow in tests
|
|
armhf|armv7|x86) options="$options !check" ;;
|
|
esac
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
for _i in $_luaversions; do
|
|
cp -r . "$srcdir"/build-$_i
|
|
done
|
|
}
|
|
|
|
build() {
|
|
for _i in $_luaversions; do
|
|
msg "build for $_i"
|
|
make -C "$srcdir"/build-$_i PREFIX=/usr LUA_VERSION=$_i \
|
|
LUA_CFLAGS="$(pkg-config --cflags lua$_i)"
|
|
done
|
|
}
|
|
|
|
check() {
|
|
for _i in $_luaversions; do
|
|
msg "check for $_i"
|
|
xvfb-run -a make -C "$srcdir"/build-$_i LUA=lua$_i \
|
|
LDFLAGS="$LDFLAGS $(pkg-config --libs lua$_i)" \
|
|
LUA_CFLAGS="$(pkg-config --cflags lua$_i)" check
|
|
done
|
|
}
|
|
|
|
package() {
|
|
for _i in $_luaversions; do
|
|
cd "$srcdir"/build-$_i
|
|
make install PREFIX=/usr DESTDIR="$pkgdir" LUA_VERSION=$_i
|
|
local rockdir="$pkgdir"/usr/lib/luarocks/rocks-$_i/lua-lgi/$pkgver-1/
|
|
mkdir -p "$rockdir"
|
|
echo 'rock_manifest = {}' > "$rockdir"/rock_manifest
|
|
done
|
|
cd "$builddir"
|
|
mkdir -p "$pkgdir"/usr/share/doc/lua-lgi
|
|
cp -r docs/* samples "$pkgdir"/usr/share/doc/lua-lgi/
|
|
}
|
|
|
|
_split() {
|
|
_luaversion="${subpkgname%-"$_rockname"}"
|
|
_luaversion="${_luaversion#lua*}"
|
|
pkgdesc="Lua $_luaversion binding to GObject libraries using introspection"
|
|
install_if="lua$_luaversion $pkgname=$pkgver-r$pkgrel"
|
|
depends="$depends lua$_luaversion"
|
|
|
|
amove usr/lib/lua/$_luaversion
|
|
amove usr/lib/luarocks/rocks-$_luaversion
|
|
amove usr/share/lua/$_luaversion
|
|
}
|
|
|
|
sha512sums="
|
|
eb8fc13c8183d9b5677135c6ec81596489e9f0a031a21d37ab6220271d304190a4a4a94caa1ce1d91b71a004101deecef59964b446a5d05c789a4d511b83d250 lua-lgi-0.9.2_git20241227.tar.gz
|
|
34b4b77768b766c0a2a20ebdc6406c7b8425590a52aa3de90d3b30076cf265d722727e4ce8e9d941bff97c715b9368684846e80ee61aa43ca5b92ddd4466f87e tests.patch
|
|
"
|