python3-gobject: fix cross

The cross-built gobject-introspection does not contain the
/usr/share/gobject-introspection-1.0/tests directory.
If it's missing, copy from the host and always remove
it after install to be safe.
This commit is contained in:
Jürgen Buchmüller 2020-03-25 00:23:21 +01:00
parent bc74fec9e0
commit daf9a7e51b

View file

@ -7,7 +7,7 @@ build_style=meson
build_helper="gir"
configure_args="-Dpython=python${py3_ver}"
pycompile_module="gi pygtkcompat"
hostmakedepends="pkg-config python3 python3-MarkupSafe"
hostmakedepends="gobject-introspection pkg-config python3 python3-MarkupSafe"
makedepends="libglib-devel python3-cairo-devel python3-devel"
depends="gir-freedesktop python3-cairo"
short_desc="Python3 bindings for GObject"
@ -17,6 +17,19 @@ homepage="https://pygobject.readthedocs.io/"
distfiles="${GNOME_SITE}/pygobject/${version%.*}/pygobject-${version}.tar.xz"
checksum=c39ca2a28364b57fa00549c6e836346031e6b886c3ceabfd8ab4b4fed0a83611
pre_configure() {
if [ ! -s "${XBPS_CROSS_BASE}/usr/share/gobject-introspection-1.0/tests/gitestmacros.h" ]; then
# /usr/share/gobject-introspection-1.0/tests missing in cross builds
cp -aR /usr/share/gobject-introspection-1.0/tests \
${XBPS_CROSS_BASE}/usr/share/gobject-introspection-1.0
fi
}
post_install() {
# In case it was copied make sure it's removed
rm -rf ${XBPS_CROSS_BASE}/usr/share/gobject-introspection-1.0/tests
}
python3-gobject-devel_package() {
depends="libgirepository-devel python3-cairo-devel
libglib-devel libffi-devel