[balsa] build: deprecation cleanup



commit c55b4fac0640091a9c89ce988c39c0244706004a
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Tue Oct 1 20:28:32 2019 -0400

    build: deprecation cleanup
    
    GTimeVal, used in GtkSourceView-3, is deprecated in glib
    version 2.62; we will use GtkSourceView-4 if available, which
    doesn't use GTimeVal, or otherwise continue to use GtkSourceView-3
    with -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_48 to suppress the
    deprecation warning.
    
    * configure.ac:
    * meson.build:

 ChangeLog    | 11 +++++++++++
 configure.ac |  8 ++++++--
 meson.build  | 10 +++++++---
 3 files changed, 24 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index f07ad551e..04a04d936 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2019-10-01  Peter Bloomfield  <pbloomfield bellsouth net>
+
+       Build: GTimeVal, used in GtkSourceView-3, is deprecated in glib
+       version 2.62; we will use GtkSourceView-4 if available, which
+       doesn't use GTimeVal, or otherwise continue to use GtkSourceView-3
+       with -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_48 to suppress the
+       deprecation warning.
+
+       * configure.ac:
+       * meson.build:
+
 2019-09-18  Peter Bloomfield  <pbloomfield bellsouth net>
 
        ab-main: Use GMenu API instead of GtkBuilder
diff --git a/configure.ac b/configure.ac
index fe34502bd..19ca20502 100644
--- a/configure.ac
+++ b/configure.ac
@@ -469,8 +469,12 @@ fi
 # GtkSourceView configuration
 #
 if test x$with_gtksourceview != xno; then
-    PKG_CHECK_MODULES(GTKSOURCEVIEW, [ gtksourceview-3.0 >= 3.2.0 ])
-    AC_DEFINE(HAVE_GTKSOURCEVIEW,1,[Defined when GtkSourceView-3 can be used.])
+    PKG_CHECK_MODULES([GTKSOURCEVIEW], [ gtksourceview-4 ], [],
+                      [
+                       PKG_CHECK_MODULES([GTKSOURCEVIEW], [ gtksourceview-3.0 >= 3.2.0 ])
+                       BALSA_CFLAGS="$BALSA_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_48"
+                      ])
+    AC_DEFINE(HAVE_GTKSOURCEVIEW,1,[Defined when GtkSourceView-3 or 4 can be used.])
     BALSA_CFLAGS="$BALSA_CFLAGS $GTKSOURCEVIEW_CFLAGS"
     BALSA_LIBS="$BALSA_LIBS $GTKSOURCEVIEW_LIBS"
 fi
diff --git a/meson.build b/meson.build
index 61a257fa9..54278c17f 100644
--- a/meson.build
+++ b/meson.build
@@ -384,10 +384,14 @@ endif # compface != 'false'
 # GtkSourceView configuration
 #
 if gtksourceview
-  gsv_dep = dependency('gtksourceview-3.0', version : '>= 3.2.0')
-  conf.set('HAVE_GTKSOURCEVIEW', 1,
-    description : 'Defined when GtkSourceView-3 can be used.')
+  gsv_dep = dependency('gtksourceview-4', required : false)
+  if not gsv_dep.found()
+    gsv_dep = dependency('gtksourceview-3.0', version : '>= 3.2.0')
+    add_global_arguments('-DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_48', language : 'c')
+  endif # not gsv_dep.found()
   balsa_deps += gsv_dep
+  conf.set('HAVE_GTKSOURCEVIEW', 1,
+    description : 'Defined when GtkSourceView-3 or 4 can be used.')
 endif # gtksourceview
 
 # libcanberra configuration


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