void-packages/srcpkgs/gobject-introspection/template

92 lines
3.5 KiB
Bash

# Template file for 'gobject-introspection'
pkgname=gobject-introspection
version=1.58.3
revision=2
build_style=meson
pycompile_dirs="usr/lib/${pkgname}/giscanner"
hostmakedepends="flex pkg-config"
makedepends="cairo-devel libffi-devel libglib-devel libxml2-devel python3-devel"
depends="libgirepository-devel python3-Mako python3-Markdown"
short_desc="Introspection system for GObject-based libraries"
maintainer="Enno Boland <gottox@voidlinux.org>"
license="GPL-2.0-or-later, LGPL-2.1-or-later"
homepage="https://wiki.gnome.org/Projects/GObjectIntrospection"
distfiles="${GNOME_SITE}/${pkgname}/${version%.*}/${pkgname}-${version}.tar.xz"
checksum=025b632bbd944dcf11fc50d19a0ca086b83baf92b3e34936d008180d28cdc3c8
pycompile_version="$py3_ver"
patch_args="-Np1"
if [ "$CROSS_BUILD" ]; then
hostmakedepends+=" gobject-introspection qemu-user-static prelink-cross"
configure_args+=" -Denable-host-gi=true
-Denable-gi-cross-wrapper=/usr/bin/g-ir-scanner-qemuwrapper
-Denable-gi-ldd-wrapper=/usr/bin/g-ir-scanner-lddwrapper
-Dpkgconfig-sysroot-path=${XBPS_CROSS_BASE}"
fi
case "$XBPS_TARGET_MACHINE" in
x86_64-musl) ;;
*-musl) broken="Errors out when building any package that uses gir" ;;
esac
post_install() {
# Install our wrappers system-wide, they are required for building all other
# gobject-based packages.
vbin ${FILESDIR}/g-ir-scanner-qemuwrapper
vbin ${FILESDIR}/g-ir-scanner-lddwrapper
# Install g-ir-scanner-wrapper as g-ir-scanner, we need it with that name since
# we can't expect people to just not hardcode /usr/bin/g-ir-scanner, some packages
# like gtk+3 just like **really** much to use /usr/bin/g-ir-scanner and meson with
# find_program is also to blame.
mv ${DESTDIR}/usr/bin/g-ir-scanner{,.wrapped}
vbin ${FILESDIR}/g-ir-scanner-wrapper g-ir-scanner
# Same logic of g-ir-scanner applies here
mv ${DESTDIR}/usr/bin/g-ir-compiler{,.wrapped}
vbin ${FILESDIR}/g-ir-compiler-wrapper g-ir-compiler
# modify the pkg-config files to respect ${pc_sysrootdir} for variables that are
# meant to be called with 'pkg-config --variable'
vsed -e 's|^g_ir_scanner=.*|g_ir_scanner=${pc_sysrootdir}/${bindir}/g-ir-scanner|g' \
-e 's|^g_ir_compiler=.*|g_ir_compiler=${pc_sysrootdir}/${bindir}/g-ir-compiler|g' \
-e 's|^g_ir_generate=.*|g_ir_generate=${pc_sysrootdir}/${bindir}/g-ir-generate|g' \
-e 's|^gidatadir.*|gidatadir=${pc_sysrootdir}/${datadir}/gobject-introspection-1.0|g' \
-e 's|^girdir.*|girdir=${pc_sysrootdir}/${datadir}/gir-1.0|g' \
-e 's|^typelibdir.*|typelibdir=${pc_sysrootdir}/${libdir}/girepository-1.0|g' \
-i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-1.0.pc \
-i ${DESTDIR}/usr/lib/pkgconfig/gobject-introspection-no-export-1.0.pc
# Fix the name of the python3 c bindings
mv ${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner*.so \
${DESTDIR}/usr/lib/gobject-introspection/giscanner/_giscanner.so
}
gir-freedesktop_package() {
short_desc="Introspection data for some FreeDesktop components"
pkg_install() {
vmove usr/lib/girepository-1.0
}
}
libgirepository_package() {
short_desc="Library for handling GObject introspection data (runtime library)"
depends="gir-freedesktop-${version}_${revision}"
pkg_install() {
vmove "usr/lib/*.so.*"
}
}
libgirepository-devel_package() {
depends="cairo-devel libffi-devel libglib-devel libgirepository>=${version}_${revision}"
short_desc="Library for handling GObject introspection data (development files)"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig
vmove "usr/lib/*.so"
vmove usr/share/gir-1.0
vmove usr/share/aclocal
}
}