[gnome-settings-daemon/wip/gcr4] build: Use gcr4 by default, but have an option to use gcr3 too



commit 6aab0f5f45f73bf0c29577e44e7477852dde57cd
Author: Milan Crha <mcrha redhat com>
Date:   Tue Jul 19 17:48:36 2022 +0200

    build: Use gcr4 by default, but have an option to use gcr3 too
    
    The gcr4 replaces gcr3, thus make it possible to use either of the two,
    while defaulting to gcr4, as it'll live for a longer time.

 .gitlab-ci.yml                  | 2 +-
 meson.build                     | 8 +++++++-
 meson_options.txt               | 1 +
 plugins/wwan/gsd-wwan-manager.c | 4 ++++
 plugins/wwan/meson.build        | 2 +-
 5 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dd67d8f4..ae37234d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -87,7 +87,7 @@ stages:
 .Build procedure: &build_procedure
   echo "== Building ==" &&
   rm -rf _build/ &&
-  meson . _build ${BUILD_OPTS} &&
+  meson . _build ${BUILD_OPTS} -Dgcr3=true &&
   ninja -C _build 2>&1 | tee compilation.log
 
 .Run Tests: &run_tests
diff --git a/meson.build b/meson.build
index 3e7cb50d..20df059c 100644
--- a/meson.build
+++ b/meson.build
@@ -214,7 +214,13 @@ endif
 # wwan
 enable_wwan = get_option('wwan')
 if enable_wwan
-  gcr_base_dep = dependency('gcr-base-3', version: '>= 3.7.5')
+  enable_gcr3 = get_option('gcr3')
+  if enable_gcr3
+     gcr_dep = dependency('gcr-base-3', version: '>= 3.7.5')
+  else
+     gcr_dep = dependency('gcr-4', version: '>= 3.90.0')
+  endif
+  config_h.set10('HAVE_GCR3', enable_gcr3)
   mm_glib_dep = dependency('mm-glib', version: '>= 1.0')
 endif
 
diff --git a/meson_options.txt b/meson_options.txt
index 3e04cf64..a5eb354f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -11,4 +11,5 @@ option('smartcard', type: 'boolean', value: true, description: 'build with smart
 option('usb-protection', type: 'boolean', value: true, description: 'build with usb-protection support')
 option('wayland', type: 'boolean', value: true, description: 'build with Wayland support')
 option('wwan', type: 'boolean', value: true, description: 'build with WWAN support')
+option('gcr3', type: 'boolean', value: false, description: 'build with gcr3, otherwise gcr4 is used')
 option('colord', type: 'boolean', value: true, description: 'build with colord support')
diff --git a/plugins/wwan/gsd-wwan-manager.c b/plugins/wwan/gsd-wwan-manager.c
index 42109ef8..c2288375 100644
--- a/plugins/wwan/gsd-wwan-manager.c
+++ b/plugins/wwan/gsd-wwan-manager.c
@@ -31,7 +31,11 @@
 #include <libmm-glib.h>
 
 #define GCR_API_SUBJECT_TO_CHANGE
+#ifdef HAVE_GCR3
 #include <gcr/gcr-base.h>
+#else
+#include <gcr/gcr.h>
+#endif
 
 #include "gnome-settings-profile.h"
 #include "cc-wwan-device.h"
diff --git a/plugins/wwan/meson.build b/plugins/wwan/meson.build
index 3f117fb3..238288c6 100644
--- a/plugins/wwan/meson.build
+++ b/plugins/wwan/meson.build
@@ -4,7 +4,7 @@ sources = files(
   'main.c'
 )
 
-deps = plugins_deps + [gio_dep, gcr_base_dep, mm_glib_dep, polkit_gobject_dep]
+deps = plugins_deps + [gio_dep, gcr_dep, mm_glib_dep, polkit_gobject_dep]
 
 cflags += ['-DGNOMECC_DATA_DIR="@0@"'.format(gsd_pkgdatadir)]
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]