From afd155430075cee5380334a9c263cc28426fc79c Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 1 Oct 2020 10:07:28 +0100 Subject: build: Allow libportal support to be disabled It isn't clear whether the API/ABI of libportal are entirely stable yet (https://github.com/flatpak/libportal/issues/33) so it is not necessarily appropriate for longer-term-supported OS distributions to include it. When building a version of epiphany for a distribution package, which is only intended to be packaged in a format other than as a Flatpak app, libportal isn't necessary anyway. libportal is also Linux-specific, so non-Linux OSs will likely want to disable it (even if it might compile successfully). Signed-off-by: Simon McVittie --- lib/ephy-flatpak-utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/ephy-flatpak-utils.c') diff --git a/lib/ephy-flatpak-utils.c b/lib/ephy-flatpak-utils.c index 6f91e5ff5..818af95f4 100644 --- a/lib/ephy-flatpak-utils.c +++ b/lib/ephy-flatpak-utils.c @@ -28,7 +28,9 @@ #include #include #include +#if USE_LIBPORTAL #include +#endif #include #include #include @@ -63,6 +65,7 @@ ephy_is_running_inside_flatpak (void) return under_flatpak; } +#if USE_LIBPORTAL static void opened_uri (GObject *object, GAsyncResult *result, @@ -81,11 +84,13 @@ opened_uri (GObject *object, if (!res) g_warning ("%s", error->message); } +#endif static void ephy_open_uri (const char *uri, gboolean is_dir) { +#if USE_LIBPORTAL GApplication *application; GtkWindow *window; XdpParent *parent; @@ -101,6 +106,10 @@ ephy_open_uri (const char *uri, xdp_portal_open_uri (g_steal_pointer (&portal), parent, uri, XDP_OPEN_URI_FLAG_ASK, NULL, opened_uri, GINT_TO_POINTER (FALSE)); xdp_parent_free (parent); +#else + g_warning ("Flatpak portal support disabled at compile time, cannot open %s", + uri); +#endif } void -- cgit v1.2.1