summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorPopolon2025-01-25 01:01:20 +0100
committerPopolon2025-01-25 01:01:20 +0100
commit0d2b59a87f28b5767cd5f57d1ac1ef5a65728985 (patch)
tree81d1dcdeca2f41e31ec5d8c154b669062c011b13 /PKGBUILD
parent51d4e1a102fcfa9086ff4209d5fa6c97690adbec (diff)
downloadaur-0d2b59a87f28b5767cd5f57d1ac1ef5a65728985.tar.gz
add a splitted package examples, with precompiled examples and sources
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD35
1 files changed, 33 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 0ce2c64d5a3e..8fb1287dbd07 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,8 +1,9 @@
# Maintainer: Popolon <Popolon aL popolon.org>
+pkgbase=thorvg
pkgname=thorvg
pkgver=0.15.9
-pkgrel=1
+pkgrel=2
pkgdesc="An open-source, lightweight, and portable library designed for rendering vector-based scenes and animations, including SVG and Lottie formats"
arch=('x86_64' 'aarch64' 'riscv32' 'riscv64' 'i386' 'i686' 'armv7h' 'armv6h' 'loong64' 'powerpc' 'powerpc64le' 'powerpc64')
url="https://www.thorvg.org/"
@@ -26,8 +27,38 @@ build() {
ninja -C builddir
}
-package() {
+_package() {
+ pkgdesc="An open-source, lightweight, and portable library designed for rendering vector-based scenes and animations, including SVG and Lottie formats"
cd ${pkgname}-${pkgver}
install -Dm644 LICENSE -t ${pkgdir}/usr/share/licenses/${pkgname}/
DESTDIR="$pkgdir/" ninja -C builddir install
}
+
+_package-examples() {
+depends=('sdl2')
+
+ pkgdesc="Examples for ${pkgbase} ${pkgdesc}"
+ cd ${pkgbase}-${pkgver}
+ meson setup builddir --prefix=/usr \
+ -Dexamples=true \
+ -Dengines=all \
+ -Dloaders=all \
+ -Dsavers=all \
+ -Dtools=all
+ ninja -C builddir
+
+ mkdir -p ${pkgdir}/usr/share/doc/${pkgbase}
+ cp -a builddir/examples ${pkgdir}/usr/share/doc/${pkgbase}/
+ cp -a examples ${pkgdir}/usr/share/doc/${pkgbase}/
+}
+
+pkgname=(
+ "${pkgbase}"
+ "${pkgbase}-examples"
+)
+for _p in "${pkgname[@]}"; do
+ eval "package_$_p() {
+ $(declare -f "_package${_p#$pkgbase}")
+ _package${_p#$pkgbase}
+ }"
+done