[gnome-desktop/ebassi/update-for-gtk4] build: Allow disabling the legacy libgnome-desktop-3.0
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop/ebassi/update-for-gtk4] build: Allow disabling the legacy libgnome-desktop-3.0
- Date: Tue, 9 Nov 2021 16:02:57 +0000 (UTC)
commit cc20f0bd3762d4d0bc59c03aff98297659031e7f
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Nov 9 15:52:12 2021 +0000
build: Allow disabling the legacy libgnome-desktop-3.0
At some point, we're going to build only the 4.0 libraries except on
older versions of GNOME.
libgnome-desktop/meson.build | 246 ++++++++++++++++++++++---------------------
meson.build | 2 +-
meson_options.txt | 4 +
3 files changed, 129 insertions(+), 123 deletions(-)
---
diff --git a/libgnome-desktop/meson.build b/libgnome-desktop/meson.build
index 44bc4613..629c87e4 100644
--- a/libgnome-desktop/meson.build
+++ b/libgnome-desktop/meson.build
@@ -162,131 +162,133 @@ if gtk4_dep.found()
endif
### Legacy ###
-introspection_sources = [
- 'gnome-desktop-thumbnail.c',
- 'gnome-bg.c',
- 'gnome-bg-slide-show.c',
- 'gnome-bg-crossfade.c',
- 'gnome-rr.c',
- 'gnome-rr-config.c',
- 'gnome-rr-output-info.c',
- 'gnome-systemd.c',
- 'gnome-pnp-ids.c',
- 'gnome-wall-clock.c',
- 'gnome-xkb-info.c',
- 'gnome-idle-monitor.c',
- 'gnome-languages.c',
-]
+if get_option('legacy_library')
+ introspection_sources = [
+ 'gnome-desktop-thumbnail.c',
+ 'gnome-bg.c',
+ 'gnome-bg-slide-show.c',
+ 'gnome-bg-crossfade.c',
+ 'gnome-rr.c',
+ 'gnome-rr-config.c',
+ 'gnome-rr-output-info.c',
+ 'gnome-systemd.c',
+ 'gnome-pnp-ids.c',
+ 'gnome-wall-clock.c',
+ 'gnome-xkb-info.c',
+ 'gnome-idle-monitor.c',
+ 'gnome-languages.c',
+ ]
+
+ libgnome_desktop_sources = [
+ introspection_sources,
+ dbus_xrandr_built_sources,
+ dbus_idle_built_sources,
+ 'gnome-datetime-source.c',
+ 'gnome-desktop-thumbnail-script.c',
+ 'gnome-gettext-portable.c',
+ ]
+
+ libgnome_desktop_headers = [
+ 'gnome-bg.h',
+ 'gnome-bg-crossfade.h',
+ 'gnome-bg-slide-show.h',
+ 'gnome-desktop-thumbnail.h',
+ 'gnome-rr.h',
+ 'gnome-rr-config.h',
+ 'gnome-systemd.h',
+ 'gnome-pnp-ids.h',
+ 'gnome-wall-clock.h',
+ 'gnome-xkb-info.h',
+ 'gnome-idle-monitor.h',
+ 'gnome-languages.h',
+ ]
+
+ install_headers(libgnome_desktop_headers,
+ subdir: 'gnome-desktop-3.0/libgnome-desktop'
+ )
-libgnome_desktop_sources = [
- introspection_sources,
- dbus_xrandr_built_sources,
- dbus_idle_built_sources,
- 'gnome-datetime-source.c',
- 'gnome-desktop-thumbnail-script.c',
- 'gnome-gettext-portable.c',
-]
+ gnome_desktop_deps = [
+ gdk_pixbuf_dep,
+ gtk3_dep,
+ glib_dep,
+ gio_dep,
+ gio_unix_dep,
+ libsystemd_dep,
+ schemas_dep,
+ xkb_config_dep,
+ xkbregistry_dep,
+ iso_codes_dep,
+ udev_dep,
+ seccomp_dep
+ ]
+
+ compat_ldflags = []
+ compat_symbol_map = '-Wl,--version-script=@0@'.format(meson.current_source_dir() / 'symbol.map')
+ if cc.has_link_argument(compat_symbol_map)
+ compat_ldflags += compat_symbol_map
+ endif
+
+ libgnome_desktop = library('gnome-desktop-3',
+ libgnome_desktop_sources,
+ dependencies: [gnome_desktop_deps, m_dep, rt_dep],
+ soversion: compat_soversion,
+ version: compat_libversion,
+ c_args: libargs,
+ link_args: compat_ldflags,
+ install: true,
+ include_directories: [
+ include_directories('.'),
+ include_directories('..'),
+ ],
+ )
-libgnome_desktop_headers = [
- 'gnome-bg.h',
- 'gnome-bg-crossfade.h',
- 'gnome-bg-slide-show.h',
- 'gnome-desktop-thumbnail.h',
- 'gnome-rr.h',
- 'gnome-rr-config.h',
- 'gnome-systemd.h',
- 'gnome-pnp-ids.h',
- 'gnome-wall-clock.h',
- 'gnome-xkb-info.h',
- 'gnome-idle-monitor.h',
- 'gnome-languages.h',
-]
+ libgnome_desktop_dep = declare_dependency(
+ dependencies: gnome_desktop_deps,
+ link_with: libgnome_desktop,
+ include_directories: [
+ include_directories('.'),
+ include_directories('..'),
+ ],
+ )
-install_headers(libgnome_desktop_headers,
- subdir: 'gnome-desktop-3.0/libgnome-desktop'
-)
+ gnome.generate_gir(libgnome_desktop,
+ sources: introspection_sources + libgnome_desktop_headers,
+ export_packages: 'gnome-desktop-3.0',
+ namespace: 'GnomeDesktop',
+ nsversion: '3.0',
+ includes: ['GObject-2.0', 'Gtk-3.0', 'GDesktopEnums-3.0'],
+ extra_args: ['-DGNOME_DESKTOP_USE_UNSTABLE_API', '--quiet', '--warn-all'],
+ identifier_prefix: 'Gnome',
+ symbol_prefix: 'gnome',
+ install: true
+ )
-gnome_desktop_deps = [
- gdk_pixbuf_dep,
- gtk3_dep,
- glib_dep,
- gio_dep,
- gio_unix_dep,
- libsystemd_dep,
- schemas_dep,
- xkb_config_dep,
- xkbregistry_dep,
- iso_codes_dep,
- udev_dep,
- seccomp_dep
-]
+ pkg.generate(
+ libraries: libgnome_desktop,
+ requires: ['gtk+-3.0', 'gsettings-desktop-schemas'],
+ version: meson.project_version(),
+ name: 'gnome-desktop-3.0',
+ filebase: 'gnome-desktop-3.0',
+ description: 'Utility library for loading .desktop files',
+ subdirs: 'gnome-desktop-3.0'
+ )
-compat_ldflags = []
-compat_symbol_map = '-Wl,--version-script=@0@'.format(meson.current_source_dir() / 'symbol.map')
-if cc.has_link_argument(compat_symbol_map)
- compat_ldflags += compat_symbol_map
+ ### Tests
+ test_programs = [
+ 'gnome-rr-debug',
+ 'test-xkb-info',
+ 'test-pnp-ids',
+ 'test-wall-clock',
+ 'test-desktop-thumbnail',
+ 'test-idle-monitor',
+ 'test-languages'
+ ]
+
+ foreach program: test_programs
+ executable(program, program + '.c',
+ dependencies: libgnome_desktop_dep,
+ install: get_option('debug_tools'),
+ install_dir: libexecdir / 'gnome-desktop-debug',
+ )
+ endforeach
endif
-
-libgnome_desktop = library('gnome-desktop-3',
- libgnome_desktop_sources,
- dependencies: [gnome_desktop_deps, m_dep, rt_dep],
- soversion: compat_soversion,
- version: compat_libversion,
- c_args: libargs,
- link_args: compat_ldflags,
- install: true,
- include_directories: [
- include_directories('.'),
- include_directories('..'),
- ],
-)
-
-libgnome_desktop_dep = declare_dependency(
- dependencies: gnome_desktop_deps,
- link_with: libgnome_desktop,
- include_directories: [
- include_directories('.'),
- include_directories('..'),
- ],
-)
-
-gnome.generate_gir(libgnome_desktop,
- sources: introspection_sources + libgnome_desktop_headers,
- export_packages: 'gnome-desktop-3.0',
- namespace: 'GnomeDesktop',
- nsversion: '3.0',
- includes: ['GObject-2.0', 'Gtk-3.0', 'GDesktopEnums-3.0'],
- extra_args: ['-DGNOME_DESKTOP_USE_UNSTABLE_API', '--quiet', '--warn-all'],
- identifier_prefix: 'Gnome',
- symbol_prefix: 'gnome',
- install: true
-)
-
-pkg.generate(
- libraries: libgnome_desktop,
- requires: ['gtk+-3.0', 'gsettings-desktop-schemas'],
- version: meson.project_version(),
- name: 'gnome-desktop-3.0',
- filebase: 'gnome-desktop-3.0',
- description: 'Utility library for loading .desktop files',
- subdirs: 'gnome-desktop-3.0'
-)
-
-### Tests
-test_programs = [
- 'gnome-rr-debug',
- 'test-xkb-info',
- 'test-pnp-ids',
- 'test-wall-clock',
- 'test-desktop-thumbnail',
- 'test-idle-monitor',
- 'test-languages'
-]
-
-foreach program: test_programs
- executable(program, program + '.c',
- dependencies: libgnome_desktop_dep,
- install: get_option('debug_tools'),
- install_dir: libexecdir / 'gnome-desktop-debug',
- )
-endforeach
diff --git a/meson.build b/meson.build
index 68613093..ba9a149b 100644
--- a/meson.build
+++ b/meson.build
@@ -48,7 +48,7 @@ test_execdir = libexecdir / 'installed-tests' / meson.project_name()
versiondir = datadir / 'gnome'
gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: gdk_pixbuf_req)
-gtk3_dep = dependency('gtk+-3.0', version: gtk3_req)
+gtk3_dep = dependency('gtk+-3.0', version: gtk3_req, required: get_option('legacy_library'))
gtk4_dep = dependency('gtk4', version: gtk4_req, required: get_option('build_gtk4'))
glib_dep = dependency('glib-2.0', version: glib_req)
gio_dep = dependency('gio-2.0', version: glib_req)
diff --git a/meson_options.txt b/meson_options.txt
index 9fe2d7bd..e17e7330 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -36,3 +36,7 @@ option('installed_tests',
option('build_gtk4',
type: 'boolean', value: true, description: 'Enable GTK4 libraries'
)
+
+option('legacy_library',
+ type: 'boolean', value: true, description: 'Build the legacy libgnome-desktop-3.0'
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]