|
| 1 | +-- gnome.gio — part of GLib 2.82.5. |
| 2 | +-- |
| 3 | +-- Files, streams, sockets, D-Bus, GApplication, GSettings, GResource — and |
| 4 | +-- `GListModel`, which is what pango's `PangoFontMap` implements. |
| 5 | +-- |
| 6 | +-- Upstream ships glib as one source tree producing FOUR separate shared |
| 7 | +-- libraries, and this index follows that split: `gnome.glib`, `gnome.gobject`, |
| 8 | +-- `gnome.gmodule` and `gnome.gio` are four packages from one fork, because |
| 9 | +-- that is what a consumer links. |
| 10 | +-- |
| 11 | +-- ───────────────────────────────────────────────────────────────────────── |
| 12 | +-- ⭐ THIS PACKAGE EXISTS BECAUSE AN EARLIER ARGUMENT WAS WRONG |
| 13 | +-- |
| 14 | +-- gio was left out of this index once, with the reason: two of its six |
| 15 | +-- generators are `gdbus-codegen`, an 8,351-line Python program that turns |
| 16 | +-- D-Bus interface XML into GObject skeletons, and reimplementing it in |
| 17 | +-- `build.mcpp` is not proportionate. That premise was measured and correct. |
| 18 | +-- The conclusion did not follow, because it conflated two different things: |
| 19 | +-- |
| 20 | +-- reproducing the generator ≠ obtaining its output |
| 21 | +-- |
| 22 | +-- The build never needed the generator. It needed 15,392 lines of C that are a |
| 23 | +-- PURE FUNCTION of five XML files and the codegen version — no target, no |
| 24 | +-- host, no locale enters it. So `mcpp/tools/gengdbus.sh` produces them once, |
| 25 | +-- they live in `mcpp/generated/`, and a CI job REGENERATES AND DIFFS them on a |
| 26 | +-- runner with a different Python than the one that produced them. |
| 27 | +-- |
| 28 | +-- That last part is the whole argument. Committed output has exactly one |
| 29 | +-- failure mode a build never sees: it can stop matching its input, and it |
| 30 | +-- still compiles. A diff is what makes "checked in" different from "stale". |
| 31 | +-- |
| 32 | +-- The same arrangement `freedesktop.wayland-protocols-*` already used for its |
| 33 | +-- 195 generated files — where it was FORCED, since a package whose product is |
| 34 | +-- headers cannot generate at build time. Here it is not forced; it is simply |
| 35 | +-- the cheap way to get code a rewrite would otherwise have to produce. |
| 36 | +-- |
| 37 | +-- ───────────────────────────────────────────────────────────────────────── |
| 38 | +-- THE OTHER FIVE GENERATORS ARE C++, AS EVERYWHERE ELSE IN THIS FORK |
| 39 | +-- |
| 40 | +-- gio-visibility.h gen_visibility("GIO", …) |
| 41 | +-- gnetworking.h one substitution |
| 42 | +-- gioenumtypes.{h,c} glib-mkenums over 82 enums |
| 43 | +-- |
| 44 | +-- ⚠️ 82 ENUMS AGAINST gobject's FOUR, and what changes at that scale is not |
| 45 | +-- the loop but the ANNOTATIONS — with a trap in each direction: |
| 46 | +-- |
| 47 | +-- gio writes `/*< private >*/`, `/*< public >*/` and `/*< protected >*/` |
| 48 | +-- 144 times. Those are GTK-DOC annotations for STRUCT MEMBERS and mean |
| 49 | +-- nothing to mkenums. A scanner that read every `/*< … >*/` would silently |
| 50 | +-- drop enumerators. |
| 51 | +-- |
| 52 | +-- `GConverterFlags` has NO `/*< flags >*/` despite the name, so upstream |
| 53 | +-- registers it with `g_enum_register_static`. A scanner that guessed from |
| 54 | +-- the type name would disagree with upstream's ABI. |
| 55 | +-- |
| 56 | +-- The nicks are public API — `g_flags_get_value_by_nick` reads them — and gio |
| 57 | +-- overrides seventeen of them. Derived, `G_CONVERTER_NO_FLAGS` would be |
| 58 | +-- "no-flags"; upstream says "none". |
| 59 | +-- |
| 60 | +-- `gconstructor_as_data.h` is upstream's sixth generator and is NOT here: it |
| 61 | +-- embeds `glib/gconstructor.h` as a C string for `glib-compile-resources`, a |
| 62 | +-- TOOL. See below. |
| 63 | +-- |
| 64 | +-- ───────────────────────────────────────────────────────────────────────── |
| 65 | +-- ⚠️ WHAT gio NEEDS BESIDES gio/*.c — AND WHY EACH IS CHECKED BY NAME |
| 66 | +-- |
| 67 | +-- gio is assembled from four kinds of input. A missing `gio/*.c` is an |
| 68 | +-- undefined reference, which the linker catches. The other three DEGRADE |
| 69 | +-- SILENTLY, so the example test asserts each one by name rather than trusting |
| 70 | +-- that it built: |
| 71 | +-- |
| 72 | +-- gio/xdgmime/ absent → g_content_type_guess answers |
| 73 | +-- "application/octet-stream" for everything |
| 74 | +-- gio/inotify/ absent → the file monitor quietly falls back to |
| 75 | +-- polling; the test reads the backend's TYPE NAME, |
| 76 | +-- which is the only place the two differ |
| 77 | +-- subprojects/gvdb/ absent → GResource and GSettings' schema reader are |
| 78 | +-- never reachable, and nothing says so |
| 79 | +-- mcpp/generated/ stale → it still compiles; the portal calls fail |
| 80 | +-- only inside a Flatpak sandbox |
| 81 | +-- |
| 82 | +-- `-DXDG_PREFIX=_gio_xdg` is load-bearing rather than hygiene: xdgmime's |
| 83 | +-- header macro-renames every `xdg_mime_*` symbol, and `gcontenttype.c` calls |
| 84 | +-- the unprefixed spelling. Both sides must see the same value or the calls and |
| 85 | +-- the definitions are different symbols. |
| 86 | +-- |
| 87 | +-- ───────────────────────────────────────────────────────────────────────── |
| 88 | +-- NO TOOLS, AND NO EXTERNAL DEPENDENCY BUT zlib |
| 89 | +-- |
| 90 | +-- The ten tools — `gio-tool`, `gdbus-tool`, `glib-compile-schemas`, |
| 91 | +-- `glib-compile-resources`, `gsettings`, … — are NOT built. Each provides |
| 92 | +-- `main`, and a dependency that provides one collides with the consumer's; |
| 93 | +-- that is the rule every package in this index follows. |
| 94 | +-- |
| 95 | +-- Upstream's meson names exactly one external dependency for the library |
| 96 | +-- beyond glib itself: `libelf`, used by `gresource-tool.c` — an |
| 97 | +-- `executable()`, not the library. Measured: no library source mentions elf at |
| 98 | +-- all. There is therefore NO libelf feature, because there is nothing for it |
| 99 | +-- to switch. |
| 100 | +-- |
| 101 | +-- `libmount`, `selinux` and `sysprof` are `auto` upstream and absent here. |
| 102 | +-- Each is `#ifdef`-tested, so each is ABSENT rather than 0, and gio degrades |
| 103 | +-- the way upstream intends: GUnixMountMonitor falls back to reading |
| 104 | +-- /proc/self/mountinfo, and the SELinux and tracing attributes are not |
| 105 | +-- offered. Defining any of them as 0 would say "yes" — see `gnome.glib` for |
| 106 | +-- the nine macros that lesson came from. |
| 107 | +-- |
| 108 | +-- ───────────────────────────────────────────────────────────────────────── |
| 109 | +-- ⚠️ NAME WHAT YOU USE; DO NOT NAME glib |
| 110 | +-- |
| 111 | +-- [dependencies] |
| 112 | +-- gnome.gio = "2.82.5" |
| 113 | +-- gnome.gobject = "2.82.5" |
| 114 | +-- # gnome.glib and gnome.gmodule arrive transitively |
| 115 | +-- |
| 116 | +-- gio declares glib, gobject and gmodule as workspace PATH dependencies — they |
| 117 | +-- are built from one tree — and mcpp rejects a package requested both ways: |
| 118 | +-- |
| 119 | +-- error: dependency 'gnome.glib' is requested as both a version dep |
| 120 | +-- (by 'your-package') and a path dep (by 'gnome.gio') |
| 121 | +-- |
| 122 | +-- ───────────────────────────────────────────────────────────────────────── |
| 123 | +-- ⚠️ NO extern "C" WRAPPER |
| 124 | +-- |
| 125 | +-- gio decorates every header with G_BEGIN_DECLS, so a wrapper is redundant — |
| 126 | +-- and harmful: gio.h reaches <stdlib.h>, which libc++ routes through <cstdlib>, |
| 127 | +-- which defines TEMPLATES. Inside an extern "C" block that is |
| 128 | +-- `templates must have C++ linkage`, dozens of times, against a header the |
| 129 | +-- consumer never named. libstdc++ does not route them that way, so gcc is |
| 130 | +-- green and clang is a wall. |
| 131 | +-- |
| 132 | +-- ❌ "THERE IS NO MODULE" USED TO BE HERE, AND IT WAS THE WRONG CONCLUSION. |
| 133 | +-- The API being macro-heavy is true and does not make a module pointless: this |
| 134 | +-- one hands a consumer 2,850 declarations, and gio's function API — GFile, |
| 135 | +-- GSocket, GVariant, GListModel — needs no macros at all. See above. |
| 136 | +-- |
| 137 | +-- ───────────────────────────────────────────────────────────────────────── |
| 138 | +-- LINUX ONLY |
| 139 | +-- |
| 140 | +-- This is the Unix build: the Windows and Cocoa backends are excluded because |
| 141 | +-- they are ALTERNATIVES to the Unix ones, not companions — both halves define |
| 142 | +-- the volume monitor, the app-info backend and the settings backend. The |
| 143 | +-- generated `glibconfig.h` fixes `G_OS_UNIX` besides, and the upstream tree |
| 144 | +-- carries two `COPYING` symlinks a Windows extraction would not survive. |
| 145 | +-- ───────────────────────────────────────────────────────────────────────── |
| 146 | +-- ⭐ TWO WAYS TO CONSUME IT, AND YOU PICK ONE |
| 147 | +-- |
| 148 | +-- import gnome.gio; -- the module route |
| 149 | +-- #include <gio/gio.h> -- the header route |
| 150 | +-- |
| 151 | +-- The namespace is the contract in this index: `compat.xxx` means headers, an |
| 152 | +-- owner namespace means the package exposes `import`. This module exports |
| 153 | +-- 2,850 names. It re-exports all three siblings, because |
| 154 | +-- `gio.h` reaches all three and because a consumer CANNOT name them itself — |
| 155 | +-- they are workspace path dependencies. |
| 156 | +-- |
| 157 | +-- ⚠️ THE TWO ROUTES DO NOT COMPOSE. A TU that imports the module AND textually |
| 158 | +-- includes a glib header reaches <time.h> twice — once through the module's |
| 159 | +-- global fragment, once directly — and the same `struct tm` from the same file |
| 160 | +-- becomes two entities: |
| 161 | +-- |
| 162 | +-- error: conflicting declaration 'struct tm' |
| 163 | +-- note: previous declaration as 'struct tm' (of module gnome.gio) |
| 164 | +-- |
| 165 | +-- WHICH ROUTE IS DECIDED BY MACROS. A module cannot carry them, and glib's are |
| 166 | +-- half its API — 1,337 `#define` against 1,312 declarations for glib, 1,679 |
| 167 | +-- against 1,753 for gio. `G_DEFINE_TYPE`, `G_OBJECT`, `g_signal_connect` and |
| 168 | +-- every `G_TYPE_*` are macros, so code that defines a GObject subclass takes |
| 169 | +-- the HEADER route. Code that uses the function API — most of gio — takes the |
| 170 | +-- MODULE route and includes nothing at all. |
| 171 | +-- |
| 172 | +-- The wrapper is GENERATED from upstream's public headers, so a name upstream |
| 173 | +-- adds or removes cannot be silently missed. That is not a preference at this |
| 174 | +-- size: four separate silent misses were found by consumers rather than by the |
| 175 | +-- build — a brace inside a char literal that swallowed the rest of a file, |
| 176 | +-- `G_DECLARE_INTERFACE` (which expands to the names rather than spelling |
| 177 | +-- them), `<glibconfig.h>` being spelled without a `glib/` prefix, and glib's |
| 178 | +-- habit of parenthesising a name to defend it from macro expansion. |
| 179 | +-- |
| 180 | +package = { |
| 181 | + spec = "1", |
| 182 | + namespace = "gnome", |
| 183 | + name = "gio", |
| 184 | + description = "GIO 2.82.5 — files, streams, sockets, D-Bus, GSettings and GListModel", |
| 185 | + licenses = {"LGPL-2.1-or-later"}, |
| 186 | + repo = "https://github.com/mcpplibs/glib", |
| 187 | + type = "package", |
| 188 | + |
| 189 | + xpm = { |
| 190 | + linux = { |
| 191 | + ["2.82.5"] = { |
| 192 | + url = { |
| 193 | + GLOBAL = "https://github.com/mcpplibs/glib/archive/refs/tags/2.82.5.tar.gz", |
| 194 | + -- ⚠️ The container tag is `2.82.5-4`, not `2.82.5`. gitcode |
| 195 | + -- refuses to REPLACE an asset of the same name in an |
| 196 | + -- existing release, so each corrected tarball needs a new |
| 197 | + -- container tag while the PACKAGE version stays upstream's. |
| 198 | + -- Verified byte-identical to the GLOBAL tag archive. |
| 199 | + CN = "https://gitcode.com/mcpp-res/glib/releases/download/2.82.5-4/glib-2.82.5.tar.gz", |
| 200 | + }, |
| 201 | + sha256 = "38a175bcd8899f376b6540e2e3ef7450169205fc56bdb909cfb086a0438553e5", |
| 202 | + }, |
| 203 | + }, |
| 204 | + }, |
| 205 | + |
| 206 | + mcpp = "*/mcpp/gio/mcpp.toml", |
| 207 | +} |
0 commit comments