[gedit] build: require libsoup dep only on Windows for the checkupdate plugin



commit 72cf9d3746d37fe05a644d9ed4e3aa85ad334afd
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Dec 6 08:11:01 2019 +0100

    build: require libsoup dep only on Windows for the checkupdate plugin
    
    libsoup is used nowhere else in this git repo, it's used only by the
    checkupdate plugin. The checkupdate plugin needs access to the internet,
    but it's the only plugin requiring that access. So when sandboxing
    gedit, it's better to disallow network access if no plugins require it.
    
    Note that there is also the gedit-plugins git repo, and third-party
    gedit plugins are also developed. Those may require network access. The
    goal with this commit is to more clearly identify which plugins require
    network/internet access, and be able to disable the build of those
    plugins, to have a more confined sandbox.

 meson.build         | 8 ++++++--
 plugins/meson.build | 2 +-
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/meson.build b/meson.build
index 1416f4353..63e6134af 100644
--- a/meson.build
+++ b/meson.build
@@ -64,7 +64,6 @@ libpeas_gtk_dep = dependency('libpeas-gtk-1.0', version: libpeas_req)
 
 libgd_dep = libgd_subproject.get_variable('libgd_dep')
 
-libsoup_dep = dependency('libsoup-2.4', version: '>= 2.60', required: true)
 gspell_dep = dependency('gspell-1', version: '>= 1.0', required: true)
 x11_dep = dependency('x11', required: false)
 
@@ -73,6 +72,11 @@ vapigen_dep = dependency('vapigen', version: '>= 0.25.1', required: false)
 
 python3 = python.find_installation('python3')
 
+build_checkupdate_plugin = host_machine.system() == 'windows'
+if build_checkupdate_plugin
+  libsoup_dep = dependency('libsoup-2.4', version: '>= 2.60', required: true)
+endif
+
 # Configurations
 if ((host_machine.system() != 'darwin') and
     (host_machine.system() != 'windows') and
@@ -116,7 +120,7 @@ active_plugins = [
   'time',
 ]
 
-if host_machine.system() == 'windows'
+if build_checkupdate_plugin
   active_plugins += 'checkupdate'
 endif
 
diff --git a/plugins/meson.build b/plugins/meson.build
index 14dcb0e3f..a9167f8d6 100644
--- a/plugins/meson.build
+++ b/plugins/meson.build
@@ -15,7 +15,7 @@ msgfmt_plugin_cmd = [
   '--output=@OUTPUT@'
 ]
 
-if host_machine.system() == 'windows'
+if build_checkupdate_plugin
   subdir('checkupdate')
 endif
 


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