129.2. gobject-introspection-1.86.0
GObject introspection: g-ir-scanner, g-ir-compiler, libgirepository-1.0 and the base GIR/typelib data (cairo, freetype2, fontconfig, libxml2, GL, DBus)
| Version | 1.86.0, release 1 |
| Shelf | gtk — The GLib and GTK platform and GNOME/Xfce desktop-platform libraries: widgets, settings, bindings, GIO plug-ins |
| Phase | 41_system (System), 173 of 1047 in build order |
| Licence | LGPL-2.0-or-later AND GPL-2.0-or-later AND MIT |
| Homepage | https://gi.readthedocs.io/ |
| Build time | 0.3 SBU |
| Installed size | 2.8 MiB in 192 files |
| Recipe | ports/core/gtk/gobject-introspection/kpkgbuild |
About
GObject Introspection describes a C library built on GObject in a form other languages can read. g-ir-scanner reads a library’s headers and its compiled code and writes a .gir file, an XML description of the API; g-ir-compiler turns that into a binary .typelib, which a language binding such as PyGObject or GJS loads at run time to call the library without generated glue code. The port installs those tools, libgirepository-1.0, and the base GIR and typelib files for libraries that do not ship their own, among them cairo-1.0, fontconfig-2.0, freetype2-2.0, GL-1.0, DBus-1.0, libxml2-2.0, Vulkan-1.0 and the X11 ones.
Every port that generates introspection data names it in depends, and with it glib-introspection, whose GLib, GObject and Gio GIRs every new GIR includes. GLib itself is built without introspection, because this port needs GLib first; see A second build of the same source.
Sources
gobject-introspection-1.86.0.tar.xz(1.0 MiB)
sha256920d1a3fcedeadc32acff95c2e203b319039dd4b4a08dd1a2dfd283d19c0b9ae
upstream: https://download.gnome.org/sources/gobject-introspection/1.86/gobject-introspection-1.86.0.tar.xz
archive copy: sources-2/gtk--gobject-introspection-1.86.0.tar.xz
Dependencies
Depends on: glib, libffi, musl-ldd, python3, python3-setuptools, meson, ninja, pkgconf, flex, bison.
Required by (62): appstream, at-spi2-core, ayatana-ido, babl, font-manager, gdk-pixbuf, gegl, gexiv2, gimp, glib-introspection, gnuradio, goffice, goocanvas, graphene, gsettings-desktop-schemas, gspell, gst-plugins-bad, gst-plugins-base, gstreamer, gtk-vnc, gtk3, gtk4, gtksourceview4, gtksourceview5, harfbuzz, json-glib, lasem, libaccounts-glib, libadwaita, libayatana-appindicator, libblockdev, libdbusmenu, libgee, libgsf, libgusb, libhandy, liblangtag, libmbim, libnotify, libosinfo, libpeas, libportal, libqmi, libqrtr-glib, librsvg, libsecret, libsoup3, libspelling, libvirt-glib, modemmanager, osm-gps-map, pango, poppler, python3-gobject, rhythmbox, spice-gtk, totem-pl-parser, udisks2, vala, vte3, webkitgtk, webkitgtk6.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install gobject-introspection'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/gtk/gobject-introspection.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/gtk/gobject-introspection
echo '920d1a3fcedeadc32acff95c2e203b319039dd4b4a08dd1a2dfd283d19c0b9ae gobject-introspection-1.86.0.tar.xz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/gobject-introspection
SRC=$SRC_ROOT/gobject-introspection-1.86.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf gobject-introspection-1.86.0.tar.xz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers devseries and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
meson setup build \
--prefix=/usr \
--sysconfdir=/etc \
--libdir=lib \
--buildtype=release \
-D cairo=disabled \
-D doctool=disabled \
-D gtk_doc=false \
-D build_introspection_data=true \
-D tests=false \
-D wrap_mode=nodownload
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
The switches, and why each is set:
-D build_introspection_data=true— Build and install the base GIR and typelib files as well as the library and the tools. This is upstream’s default.-D cairo=disabled— Do not use cairo in the tests. The option affects only the test suite, which is not built (-D tests=false); thecairo-1.0GIR is installed either way.-D doctool=disabled— Install nog-ir-doc-tool, which renders documentation from a GIR, and run none of its tests.-D wrap_mode=nodownload— Never download a meson subproject, so a missing dependency stops the configuration instead of being fetched.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/gobject-introspection, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf gobject-introspection-1.86.0-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/gobject-introspection, and runs the triggers its paths call for.
Contents
Installed programs: g-ir-annotation-tool, g-ir-compiler, g-ir-generate, g-ir-inspect, g-ir-scanner.
Installed libraries: libgirepository-1.0.so.
Installed directories: /usr/include/gobject-introspection-1.0, /usr/lib/gobject-introspection, /usr/share/gobject-introspection-1.0, /usr/share/licenses/gobject-introspection.
Short descriptions
g-ir-compiler |
Typelib compiler $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
g-ir-generate |
Typelib generator $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
g-ir-scanner |
Extracting C metadata from sources and headers $1 n[an-margin] level n[rst2man-indent-level] level margin: n[rst2man-indentn[rst2man-indent-level]] - n[rst2man-indent0] n[rst2man-indent1] |
gobject-introspection-1.0.pc |
GObject Introspection |
gobject-introspection-no-export-1.0.pc |
GObject Introspection |
Notes
g-ir-scanner finds the shared library a GIR describes by running ldd on the program it compiles and reading the output. musl installs no ldd command; musl-ldd installs /usr/bin/ldd, a script that runs musl’s dynamic loader with --list, which is why it is a dependency. Without it the scanner step of every port that generates introspection data has no ldd to run.