[glib-networking/mcatanzaro/proxy-priority: 2/2] Add build option for environment proxy resolver




commit e59186198a46c26bb5baa65e7c10c02e14a69f02
Author: Michael Catanzaro <mcatanzaro redhat com>
Date:   Fri Aug 5 13:29:12 2022 -0500

    Add build option for environment proxy resolver
    
    Since fixing #190, the environment proxy resolver is now redundant with
    libproxy and there is no reason for it to be built or installed if
    libproxy is enabled. Accordingly, let's give it its own build option. It
    will be enabled by default if libproxy is enabled, and disabled by
    default otherwise.
    
    Part-of: <https://gitlab.gnome.org/GNOME/glib-networking/-/merge_requests/217>

 .gitlab-ci.yml           |  3 +++
 .gitlab-ci/test-msvc.bat |  3 ++-
 meson.build              | 13 +++++++++----
 meson_options.txt        |  4 ++++
 proxy/meson.build        |  4 +---
 5 files changed, 19 insertions(+), 8 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 0da8500f..cd2ca058 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -52,6 +52,7 @@ fedora-x86_64:
         -Db_coverage=true
         -Dgnutls=enabled
         -Dopenssl=enabled
+        -Denvironmentproxy=enabled
         -Dlibproxy=enabled
         -Dgnome_proxy=enabled
         -Ddebug_logs=true
@@ -82,6 +83,7 @@ fedora-x86_64-asan:
             -Dgnutls=enabled
             -Dopenssl=enabled
             -Dlibproxy=enabled
+            -Denvironmentproxy=enabled
             -Dgnome_proxy=enabled
             -Ddebug_logs=true
             -Dwerror=true
@@ -101,6 +103,7 @@ fedora-x86_64-scan-build:
   script:
     - meson -Dgnutls=enabled
             -Dopenssl=enabled
+            -Denvironmentproxy=enabled
             -Dlibproxy=enabled
             -Dgnome_proxy=enabled
             -Ddebug_logs=true
diff --git a/.gitlab-ci/test-msvc.bat b/.gitlab-ci/test-msvc.bat
index da10623e..861cbc86 100644
--- a/.gitlab-ci/test-msvc.bat
+++ b/.gitlab-ci/test-msvc.bat
@@ -26,8 +26,9 @@ set INCLUDE=%DEPS_DIR%\include;%DEPS_DIR%\include\glib-2.0;%INCLUDE%
 set PKG_CONFIG_PATH=%DEPS_DIR%\lib\pkgconfig
 
 :: FIXME: make warnings fatal
+:: FIXME: Environment proxy ought to work on Windows: 
https://gitlab.gnome.org/GNOME/glib-networking/-/issues/185
 pip3 install --upgrade --user meson==0.60.0  || goto :error
-meson build -Dgnutls=disabled -Dopenssl=enabled -Ddebug_logs=true || goto :error
+meson build -Dgnutls=disabled -Dopenssl=enabled -Denvironment_proxy=disabled -Ddebug_logs=true || goto :error
 ninja -C build || goto :error
 
 meson test -C build --timeout-multiplier=10 || goto :error
diff --git a/meson.build b/meson.build
index c816dc61..b51bc852 100644
--- a/meson.build
+++ b/meson.build
@@ -71,6 +71,10 @@ assert(gio_module_dir != '', 'GIO_MODULE_DIR is missing from gio-2.0.pc')
 # *** Checks for LibProxy   ***
 libproxy_dep = dependency('libproxy-1.0', version: '>= 0.4.16', required: get_option('libproxy'))
 
+# *** Checks for environment proxy ***
+environment_proxy_option = get_option('environment_proxy')
+environment_proxy_enabled = environment_proxy_option.enabled() or (environment_proxy_option.auto() and not 
libproxy_dep.found())
+
 # *** Checks for GNOME      ***
 gsettings_desktop_schemas_dep = dependency('gsettings-desktop-schemas', required: get_option('gnome_proxy'))
 
@@ -148,8 +152,9 @@ if gio_querymodules.found()
 endif
 
 output = '\n\n'
-output += '  gnutls support:      ' + backends.contains('gnutls').to_string() + '\n'
-output += '  openssl support:     ' + backends.contains('openssl').to_string() + '\n'
-output += '  libproxy support:    ' + libproxy_dep.found().to_string() + '\n'
-output += '  GNOME proxy support: ' + gsettings_desktop_schemas_dep.found().to_string() + '\n'
+output += '  GnuTLS support:            ' + backends.contains('gnutls').to_string() + '\n'
+output += '  OpenSSL support:           ' + backends.contains('openssl').to_string() + '\n'
+output += '  environment proxy support: ' + environment_proxy_enabled.to_string() + '\n'
+output += '  libproxy support:          ' + libproxy_dep.found().to_string() + '\n'
+output += '  GNOME proxy support:       ' + gsettings_desktop_schemas_dep.found().to_string() + '\n'
 message(output)
diff --git a/meson_options.txt b/meson_options.txt
index f022e3d0..9d5053e1 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,8 +1,12 @@
 # The OpenSSL backend is provided for systems where licensing considerations
 # prohibit use of certain dependencies of GnuTLS. General-purpose Linux distros
 # should leave it disabled. Please don't second-guess our defaults.
+#
+# The environment variable proxy backend is intended for use if you are building
+# without libproxy.
 option('gnutls', type: 'feature', value: 'auto', description: 'support for GnuTLS networking configration')
 option('openssl', type: 'feature', value: 'disabled', description: 'support for OpenSSL networking 
configration')
+option('environment_proxy', type: 'feature', value: 'auto', description: 'support for environment variable 
proxy configuration')
 option('libproxy', type: 'feature', value: 'auto', description: 'support for libproxy proxy configration')
 option('gnome_proxy', type: 'feature', value: 'auto', description: 'support for GNOME desktop proxy 
configuration')
 option('installed_tests', type: 'boolean', value: false, description: 'enable installed tests')
diff --git a/proxy/meson.build b/proxy/meson.build
index c6384525..266cea4e 100644
--- a/proxy/meson.build
+++ b/proxy/meson.build
@@ -6,9 +6,7 @@ if gsettings_desktop_schemas_dep.found()
   subdir('gnome')
 endif
 
-# FIXME: This ought to work on Windows.
-# https://gitlab.gnome.org/GNOME/glib-networking/-/issues/185
-if not ['windows'].contains(host_system)
+if environment_proxy_enabled
   subdir('environment')
 endif
 


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