diff options
author | Alexander Mikhaylenko <alexm@gnome.org> | 2023-02-21 04:43:32 +0000 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2023-03-03 19:04:24 +0000 |
commit | c0d3b3f4ce41af148fdf1cfd35a6b5bf01922d84 (patch) | |
tree | 8cf46133dd6bab1ed66cdb56944f8180dbc07929 | |
parent | dbae548312b65947f5a548f8c8277a81aad04714 (diff) | |
download | epiphany-c0d3b3f4ce41af148fdf1cfd35a6b5bf01922d84.tar.gz |
Use Granite on elementary OS
Part-of: <https://gitlab.gnome.org/GNOME/epiphany/-/merge_requests/1292>
-rw-r--r-- | meson.build | 5 | ||||
-rw-r--r-- | meson_options.txt | 6 | ||||
-rw-r--r-- | org.gnome.Epiphany.json | 11 | ||||
-rw-r--r-- | src/ephy-shell.c | 9 | ||||
-rw-r--r-- | src/meson.build | 1 |
5 files changed, 32 insertions, 0 deletions
diff --git a/meson.build b/meson.build index ed3cb92bd..9621874bf 100644 --- a/meson.build +++ b/meson.build @@ -90,6 +90,7 @@ gdk_pixbuf_dep = dependency('gdk-pixbuf-2.0', version: '>= 2.36.5') gio_dep = dependency('gio-2.0', version: glib_requirement) gio_unix_dep = dependency('gio-unix-2.0', version: glib_requirement) glib_dep = dependency('glib-2.0', version: glib_requirement) +granite_dep = dependency('granite-7', version: '>= 7.2.0', required: get_option('granite')) gsettings_desktop_schemas = dependency('gsettings-desktop-schemas') gstreamer_dep = dependency('gstreamer-1.0') gtk_dep = dependency('gtk4', version: gtk_requirement) @@ -108,6 +109,10 @@ sqlite3_dep = dependency('sqlite3', version: '>= 3.22') webkitgtk_dep = dependency('webkitgtk-6.0', version: webkitgtk_requirement) webkitgtk_web_extension_dep = dependency('webkitgtk-web-extension-6.0', version: webkitgtk_requirement) +if granite_dep.found() + conf.set('USE_GRANITE', 1) +endif + webkit_revision = webkitgtk_dep.get_variable(pkgconfig: 'revision', default_value: '') if webkit_revision == 'tarball' webkit_revision = '' diff --git a/meson_options.txt b/meson_options.txt index 116ee41fd..452716670 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -33,3 +33,9 @@ option('gsb_api_key', value: '', description: 'The API key used to access the Google Safe Browsing API v4' ) + +option('granite', + type: 'feature', + value: 'auto', + description: 'Enable elementary OS integration. Requires Granite' +) diff --git a/org.gnome.Epiphany.json b/org.gnome.Epiphany.json index 1fc0cd1fc..41db1d484 100644 --- a/org.gnome.Epiphany.json +++ b/org.gnome.Epiphany.json @@ -90,6 +90,17 @@ ] }, { + "name": "granite", + "buildsystem": "meson", + "sources": [ + { + "type": "git", + "url": "https://github.com/elementary/granite.git", + "branch": "main" + } + ] + }, + { "name" : "libportal", "buildsystem" : "meson", "config-opts" : [ diff --git a/src/ephy-shell.c b/src/ephy-shell.c index 4cd0948f4..bac776d9d 100644 --- a/src/ephy-shell.c +++ b/src/ephy-shell.c @@ -50,6 +50,10 @@ #include <glib/gi18n.h> #include <gtk/gtk.h> +#ifdef USE_GRANITE +#include <granite-7.h> +#endif + struct _EphyShell { EphyEmbedShell parent_instance; @@ -843,6 +847,11 @@ ephy_shell_init (EphyShell *shell) ephy_shell->startup_finished = FALSE; g_object_add_weak_pointer (G_OBJECT (ephy_shell), (gpointer *)ptr); + +#ifdef USE_GRANITE + if (is_desktop_pantheon ()) + granite_init (); +#endif } static void diff --git a/src/meson.build b/src/meson.build index 4edcccd1d..ab0ffc219 100644 --- a/src/meson.build +++ b/src/meson.build @@ -82,6 +82,7 @@ libephymain_deps = [ ephysync_dep, gcr_dep, gdk_pixbuf_dep, + granite_dep, gstreamer_dep, gvdb_dep, libarchive_dep, |