pkgbase=glib2 pkgname=(glib2 glib2-docs) pkgver=2.58.0 pkgrel=1 pkgdesc="Common C routines used by GTK+ and other libs" url="https://wiki.gnome.org/Projects/GLib" arch=(x86_64) depends=(pcre libffi util-linux zlib) makedepends=(gettext gtk-doc shared-mime-info python3 libelf git meson dbus) checkdepends=(desktop-file-utils) optdepends=('python: gdbus-codegen, glib-genmarshal, glib-mkenums, gtester-report' 'libelf: gresource inspection tool') options=(!emptydirs) source=("http://download.gnome.org/sources/glib/2.58/glib-${pkgver}.tar.xz" noisy-glib-compile-schemas.diff glib-compile-schemas.hook gio-querymodules.hook) sha256sums=('c0f4ce0730b4f95c47b711613b5406a887c2ee13ea6d25930d72a4fa7fdb77f6' '81a4df0b638730cffb7fa263c04841f7ca6b9c9578ee5045db6f30ff0c3fc531' 'e1123a5d85d2445faac33f6dae1085fdd620d83279a4e130a83fe38db52b62b3' '5ba204a2686304b1454d401a39a9d27d09dd25e4529664e3fd565be3d439f8b6') pkgver() { cd glib git describe --tags | sed 's/-/+/g' } prepare() { cd glib # Suppress noise from glib-compile-schemas.hook patch -Np1 -i ../noisy-glib-compile-schemas.diff } build() { chakra-meson glib build \ -D selinux=false \ -D man=true \ -D gtk_doc=true ninja -C build } check() { meson test -C build -t 2 } package_glib2() { DESTDIR="$pkgdir" meson install -C build mv "$pkgdir/usr/share/gtk-doc" "$srcdir" python3 -m compileall "$pkgdir/usr/share/glib-2.0/codegen" python3 -O -m compileall "$pkgdir/usr/share/glib-2.0/codegen" install -Dt "$pkgdir/usr/share/libalpm/hooks" -m644 *.hook } package_glib2-docs() { pkgdesc="Documentation for GLib" depends=() optdepends=() license+=(custom) mkdir -p "$pkgdir/usr/share" mv gtk-doc "$pkgdir/usr/share" install -Dt "$pkgdir/usr/share/licenses/glib2-docs" -m644 glib/docs/reference/COPYING }