[gedit/zbrown/deteplification-src: 94/633] build: require libsoup dep only on Windows for the checkupdate plugin




commit 248ce024bcf42284d1f0a28d38612413b7babc62
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 953526d5d..5d7780204 100644
--- a/meson.build
+++ b/meson.build
@@ -72,7 +72,6 @@ libxml_dep = dependency('libxml-2.0', version: libxml_req)
 
 libgd_dep = libgd_subproject.get_variable('libgd_dep')
 
-libsoup_dep = dependency('libsoup-2.4', version: libsoup_req, required: true)
 gspell_dep = dependency('gspell-1', version: gspell_req, required: true)
 x11_dep = dependency('x11', required: false)
 
@@ -81,6 +80,11 @@ vapigen_dep = dependency('vapigen', version: vala_req, 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: libsoup_req, required: true)
+endif
+
 # Configurations
 if ((host_machine.system() != 'darwin') and
     (host_machine.system() != 'windows') and
@@ -135,7 +139,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]