From 69870af1aed34b32a48ff75554b4438e222cc526 Mon Sep 17 00:00:00 2001 From: rbuj Date: Fri, 26 Feb 2021 09:20:30 +0100 Subject: build: port to gtksourceview-4 --- .build.yml | 8 ++++---- README.md | 2 +- configure.ac | 4 ++-- data/pluma-bugreport.sh.in | 2 +- data/pluma.pc.in | 2 +- pluma/Makefile.am | 2 +- pluma/pluma-document.c | 14 +++++++++++--- 7 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.build.yml b/.build.yml index e61d065b..865f062d 100644 --- a/.build.yml +++ b/.build.yml @@ -12,7 +12,7 @@ requires: - gcc - git - gobject-introspection - - gtksourceview3 + - gtksourceview4 - iso-codes - itstool - libpeas @@ -40,7 +40,7 @@ requires: - libgirepository1.0-dev - libglib2.0-dev - libgtk-3-dev - - libgtksourceview-3.0-dev + - libgtksourceview-4-dev - libpeas-dev - libsm-dev - libx11-dev @@ -62,7 +62,7 @@ requires: - gcc - git - gtk3-devel - - gtksourceview3-devel + - gtksourceview4-devel - iso-codes-devel - libappstream-glib-devel - libSM-devel @@ -87,7 +87,7 @@ requires: - libgirepository1.0-dev - libglib2.0-dev - libgtk-3-dev - - libgtksourceview-3.0-dev + - libgtksourceview-4-dev - libpeas-dev - libsm-dev - libx11-dev diff --git a/README.md b/README.md index 5d6d040c..d3e06f38 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ You can download the latest Pluma tarball from: ## Build/Installation -Pluma requires GTK+ (>= 3.22) and GtkSourceView (>= 3.0.0). For a complete list of dependencies see the [build.yml](https://github.com/mate-desktop/pluma/blob/master/.build.yml). +Pluma requires GTK+ (>= 3.22) and GtkSourceView (>= 4.0.2). For a complete list of dependencies see the [build.yml](https://github.com/mate-desktop/pluma/blob/master/.build.yml). **Warning**: This procedure doesn't install in a separate prefix, so it may overwrite your system binaries. diff --git a/configure.ac b/configure.ac index e5bf3552..ae16ddab 100644 --- a/configure.ac +++ b/configure.ac @@ -156,7 +156,7 @@ fi AM_CONDITIONAL(ENABLE_ENCHANT, test x"$enable_enchant" = "xyes") GTK_REQUIRED=3.22.0 -GTKSOURCEVIEW_REQUIRED=3.0.0 +GTKSOURCEVIEW_REQUIRED=4.0.2 PKG_CHECK_MODULES(GMODULE,gmodule-2.0,[GMODULE_ADD="gmodule-2.0"],[GMODULE_ADD=""]) PKG_CHECK_MODULES(PLUMA, [ @@ -166,7 +166,7 @@ PKG_CHECK_MODULES(PLUMA, [ gthread-2.0 >= 2.13.0 gio-2.0 >= 2.50.0 gtk+-3.0 >= $GTK_REQUIRED - gtksourceview-3.0 >= $GTKSOURCEVIEW_REQUIRED + gtksourceview-4 >= $GTKSOURCEVIEW_REQUIRED libpeas-1.0 >= 1.2.0 libpeas-gtk-1.0 >= 1.2.0 ]) diff --git a/data/pluma-bugreport.sh.in b/data/pluma-bugreport.sh.in index 9fab78bf..a0270db4 100644 --- a/data/pluma-bugreport.sh.in +++ b/data/pluma-bugreport.sh.in @@ -1,6 +1,6 @@ #!/bin/sh -PKG_CONFIG_MODULES="glib-2.0 gtk+-3.0 gtksourceview-3.0 enchant iso-codes" +PKG_CONFIG_MODULES="glib-2.0 gtk+-3.0 gtksourceview-4 enchant iso-codes" echo_padded () { diff --git a/data/pluma.pc.in b/data/pluma.pc.in index 68d60a02..6ed56d80 100644 --- a/data/pluma.pc.in +++ b/data/pluma.pc.in @@ -6,7 +6,7 @@ pluginsdir=@libdir@/pluma/plugins Name: pluma Description: pluma -Requires: gtksourceview-3.0 libpeas-1.0 libpeas-gtk-1.0 +Requires: gtksourceview-4 libpeas-1.0 libpeas-gtk-1.0 Version: @VERSION@ Cflags: -I${includedir}/pluma Libs: -L${libdir} diff --git a/pluma/Makefile.am b/pluma/Makefile.am index 28c869f0..24e52728 100644 --- a/pluma/Makefile.am +++ b/pluma/Makefile.am @@ -199,7 +199,7 @@ Pluma_1_0_gir_NAMESPACE = Pluma Pluma_1_0_gir_VERSION = 1.0 Pluma_1_0_gir_PROGRAM = $(builddir)/pluma Pluma_1_0_gir_FILES = $(INST_H_FILES) $(libpluma_c_files) $(BUILT_SOURCES) -Pluma_1_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0 +Pluma_1_0_gir_INCLUDES = Gtk-3.0 GtkSource-4 girdir = $(datadir)/gir-1.0 gir_DATA = $(INTROSPECTION_GIRS) diff --git a/pluma/pluma-document.c b/pluma/pluma-document.c index 6b26a317..f8dfb81f 100644 --- a/pluma/pluma-document.c +++ b/pluma/pluma-document.c @@ -75,6 +75,14 @@ PROFILE (static GTimer *timer = NULL) #define PLUMA_MAX_PATH_LEN 2048 #endif +/* undo https://gitlab.gnome.org/GNOME/gtksourceview/-/commit/b3dffc39 */ +#undef GTK_SOURCE_CHECK_VERSION +#define GTK_SOURCE_CHECK_VERSION(major, minor, micro) \ + (GTK_SOURCE_MAJOR_VERSION > (major) || \ + (GTK_SOURCE_MAJOR_VERSION == (major) && GTK_SOURCE_MINOR_VERSION > (minor)) || \ + (GTK_SOURCE_MAJOR_VERSION == (major) && GTK_SOURCE_MINOR_VERSION == (minor) && \ + GTK_SOURCE_MICRO_VERSION >= (micro))) + static void pluma_document_load_real (PlumaDocument *doc, const gchar *uri, const PlumaEncoding *encoding, @@ -641,7 +649,7 @@ pluma_document_class_init (PlumaDocumentClass *klass) GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE); } -#if !GTK_SOURCE_CHECK_VERSION (3, 24, 11) +#if !GTK_SOURCE_CHECK_VERSION(4, 3, 1) static gboolean file_with_bom (GFile *file) { @@ -693,7 +701,7 @@ set_language (PlumaDocument *doc, { GtkSourceLanguage *old_lang; -#if !GTK_SOURCE_CHECK_VERSION (3, 24, 11) +#if !GTK_SOURCE_CHECK_VERSION(4, 3, 1) const gchar *new_lang_id; const gchar *bom_langs[] = { "asp", "dtl", "docbook", "html", "mxml", "mallard", "markdown", @@ -709,7 +717,7 @@ set_language (PlumaDocument *doc, if (old_lang == lang) return; -#if !GTK_SOURCE_CHECK_VERSION (3, 24, 11) +#if !GTK_SOURCE_CHECK_VERSION(4, 3, 1) new_lang_id = gtk_source_language_get_id (lang); if (new_lang_id) is_bom_lang = g_strv_contains (bom_langs, new_lang_id); -- cgit v1.2.1