Commit Graph

5 Commits

Author SHA1 Message Date
Philip Withnall
19308d6c18 introspection: Re-add platform specific APIs to GLib-2.0.gir and Gio-2.0.gir
To avoid a big introspection API break.

These APIs are now listed in the new `{GLib,Gio}{Unix,Win32}-2.0.gir`
files, but for backwards compatibility they need to continue to be
listed in `Gio-2.0.gir` and `GLib-2.0.gir` as well, until the next major
introspection API break (and none is planned).

No new platform specific APIs should be added to these GIR files, but
these existing ones must remain.

See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3892#note_2001361

Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-12 17:54:36 +00:00
Philip Withnall
4314944e56 introspection: Drop Unix and Win32 prefixes from platform specific APIs
So now introspection users will have to call `GLibUnix.open_pipe()`
rather than `GLibUnix.unix_open_pipe()` — or
`GLibWin32.check_windows_version()` rather than
`GLibWin32.win32_check_windows_version()`.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:36 +00:00
Philip Withnall
5021d002ab introspection: Generate separate GIR files for platform specific APIs
For both GLib and GIO. (GObject, GIRepository and GModule don’t have any
platform specific APIs.)

This is needed for two reasons:
 * If the same GIR file is shipped on multiple platforms, it has no way
   to conditionally define/not-define an API based on the platform (like
   an `#ifdef` in a C header). So we either end up shipping differing
   GIR APIs on different platforms, or shipping a GIR file which
   declares APIs which aren’t resolvable by `dlopen()` on certain
   platforms, and will cause a language runtime error.
 * The API reference documentation is now generated from the GIR, and
   similar problems are present there: if the GIR contains different
   symbols depending on the platform, there is no way to generate API
   documentation for the union of all of them.

The fix is to ensure that there are no conditional symbols in a GIR, by
splitting out the platform specific symbols into platform specific GIR
files. Platform specific documentation can then be generated from these,
in addition to the main, platform agnostic, documentation.

The documentation changes will following in a subsequent commit.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:10 +00:00
Philip Withnall
0d9170c6b8 gio: Remove unnecessary appinfo_sources variable
There was no obvious logical need to list the `GAppInfo` subclass
sources separately in the build. It makes more sense to add them to the
platform-specific source lists, since they are platform specific.

This will be used in an upcoming commit which generates
platform-specific GIR files, so needs the full platform-specific lists
of sources.

Signed-off-by: Philip Withnall <pwithnall@gnome.org>

Helps: #3037
2024-02-12 17:54:10 +00:00
Evan Welsh
f75221c7ea girepository: Move GIR generation into girepository and prior to tests
To enable tests which depend on libgirepository's GIR and typelib,
we need to refactor the order we're currently building these items.

We can also move everything under girepository/ to cleanup the
top-level.
2024-01-30 00:50:40 -06:00