[epiphany/mwleeds/webapp-dbus-api: 2/4] Make libportal dependency non-optional




commit cba205aaccdcd7d323439e1d21ced55b4a2702fa
Author: Phaedrus Leeds <mwleeds protonmail com>
Date:   Fri Dec 17 14:08:52 2021 -0800

    Make libportal dependency non-optional
    
    This should simplify things since we use libportal for a few different
    things.

 lib/ephy-flatpak-utils.c | 13 -------------
 meson.build              |  4 +---
 meson_options.txt        |  6 ------
 3 files changed, 1 insertion(+), 22 deletions(-)
---
diff --git a/lib/ephy-flatpak-utils.c b/lib/ephy-flatpak-utils.c
index 96fae9c96..10be8f13d 100644
--- a/lib/ephy-flatpak-utils.c
+++ b/lib/ephy-flatpak-utils.c
@@ -28,9 +28,7 @@
 #include <fcntl.h>
 #include <gio/gio.h>
 #include <gio/gunixfdlist.h>
-#if USE_LIBPORTAL
 #include <libportal/portal-gtk3.h>
-#endif
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -82,7 +80,6 @@ ephy_is_running_inside_sandbox (void)
   return GPOINTER_TO_INT (g_once (&inside_sandbox, get_inside_sandbox, NULL));
 }
 
-#if USE_LIBPORTAL
 static void
 opened_uri (GObject      *object,
             GAsyncResult *result,
@@ -101,13 +98,11 @@ 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;
@@ -123,10 +118,6 @@ 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
@@ -147,10 +138,6 @@ ephy_can_install_web_apps (void)
   if (!ephy_is_running_inside_sandbox ())
     return TRUE;
 
-#if USE_LIBPORTAL
   /* TODO bump version requirement of libportal and also check that the portal is available */
   return TRUE;
-#else
-  return FALSE;
-#endif
 }
diff --git a/meson.build b/meson.build
index 0b9f862b2..50138ca20 100644
--- a/meson.build
+++ b/meson.build
@@ -95,7 +95,7 @@ libhandy_dep = dependency('libhandy-1', version: '>= 1.5.0')
 libsecret_dep = dependency('libsecret-1', version: '>= 0.19.0')
 libxml_dep = dependency('libxml-2.0', version: '>= 2.6.12')
 nettle_dep = dependency('nettle', version: nettle_requirement)
-portal_dep = dependency('libportal', version: '>= 0.0.2', required: get_option('libportal'))
+portal_dep = dependency('libportal', version: '>= 0.0.2')
 sqlite3_dep = dependency('sqlite3', version: '>= 3.22')
 
 if get_option('soup2').enabled()
@@ -108,8 +108,6 @@ else
   webkit2gtk_web_extension_dep = dependency('webkit2gtk-web-extension-4.1', version: webkitgtk_requirement)
 endif
 
-conf.set10('USE_LIBPORTAL', portal_dep.found())
-
 webkit_revision = webkit2gtk_dep.get_variable(pkgconfig : 'revision', default_value : '')
 if webkit_revision == 'tarball'
   webkit_revision = ''
diff --git a/meson_options.txt b/meson_options.txt
index 023e61188..030cc9b9f 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -4,12 +4,6 @@ option('developer_mode',
   description: 'Enable developer mode'
 )
 
-option('libportal',
-  type: 'feature',
-  value: 'enabled',
-  description: 'Depend on libportal for Flatpak support'
-)
-
 option('network_tests',
   type: 'feature',
   value: 'disabled',


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