Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libproxy for openSUSE:Factory 
checked in at 2022-07-09 16:59:20
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libproxy (Old)
 and      /work/SRC/openSUSE:Factory/.libproxy.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libproxy"

Sat Jul  9 16:59:20 2022 rev:83 rq:987352 version:0.4.18

Changes:
--------
--- /work/SRC/openSUSE:Factory/libproxy/libproxy.changes        2022-05-17 
17:24:09.555156073 +0200
+++ /work/SRC/openSUSE:Factory/.libproxy.new.1523/libproxy.changes      
2022-07-09 16:59:30.668478817 +0200
@@ -1,0 +2,25 @@
+Tue Jun 21 08:50:02 UTC 2022 - Dominique Leuenberger <dims...@opensuse.org>
+
+- Add libproxy-perl-cflags.patch: perl: Use ccflags from %Config
+  for libproxy module compilation; fixes perl test suite on i586.
+
+-------------------------------------------------------------------
+Mon Jun 20 14:01:59 UTC 2022 - Dominique Leuenberger <dims...@opensuse.org>
+
+- Update to version 0.4.18:
+  + build: Allow configuration of sysconfig module.
+  + config_envvar: Add environment variable for pacrunner
+    debugging.
+  + build: disable mozjs by default.
+  + python: Support Python 3.10 and above.
+  + Add Duktape pacrunner module.
+  + config_kde: Compute list of config file locations ourselves.
+  + cpmfog_gnome3: Add gnome-wayland to permitted DESKTOP_SESSION.
+- Drop libproxy-python-310.patch: fixed upstream.
+- Build duktape pacrunner module:
+  + Add pkgconfig(duktape): new dependency.
+  + Split new subpackage libproxy1-pacrunner-duktape.
+  + Suggest duktape pacrunner for config modules recommending a
+    pacrunner.
+
+-------------------------------------------------------------------

Old:
----
  libproxy-0.4.17.tar.xz
  libproxy-python-310.patch

New:
----
  libproxy-0.4.18.tar.xz
  libproxy-perl-cflags.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libproxy.spec ++++++
--- /var/tmp/diff_new_pack.wRf6HM/_old  2022-07-09 16:59:31.052479394 +0200
+++ /var/tmp/diff_new_pack.wRf6HM/_new  2022-07-09 16:59:31.056479400 +0200
@@ -39,7 +39,7 @@
 %bcond_without python2
 %{!?_assemblies_dir: %global _assemblies_dir %(pkg-config cecil 
--variable=assemblies_dir)}
 Name:           libproxy%{?dash}%{?name_suffix}
-Version:        0.4.17
+Version:        0.4.18
 Release:        0
 Summary:        Automatic proxy configuration management for applications
 License:        GPL-2.0-or-later AND LGPL-2.1-or-later
@@ -47,8 +47,8 @@
 URL:            http://libproxy.github.io/libproxy/
 Source:         
https://github.com/libproxy/libproxy/releases/download/%{version}/%{_name}-%{version}.tar.xz
 Source99:       baselibs.conf
-# PATCH-FIX-OPENSUSE libproxy-python-310.patch dims...@opensuse.org -- Detect 
python 3.10. upstream has more sophisticated changes already in the queue
-Patch0:         libproxy-python-310.patch
+# PATCH-FIX-UPSTREAM libproxy-perl-cflags.patch dims...@opensuse.org -- perl: 
Use ccflags from %Config for libproxy module compilation
+Patch0:         libproxy-perl-cflags.patch
 BuildRequires:  cmake
 BuildRequires:  gcc-c++
 # netcfg is needed for the test suite.
@@ -68,6 +68,7 @@
 %if %{with python2}
 BuildRequires:  python-devel
 %endif
+BuildRequires:  pkgconfig(duktape)
 BuildRequires:  pkgconfig(gio-2.0) >= 2.26
 BuildRequires:  pkgconfig(gobject-2.0)
 BuildRequires:  pkgconfig(javascriptcoregtk-4.0)
@@ -137,6 +138,7 @@
 Obsoletes:      libproxy-gnome < %{version}
 %if 0%{?suse_version}
 Recommends:     libproxy1-pacrunner = %{version}
+Suggests:       libproxy1-pacrunner-duktape
 Supplements:    (libproxy1 and gnome-session-core)
 %else
 Requires:       libproxy1-pacrunner = %{version}
@@ -165,6 +167,7 @@
 %endif
 %if 0%{?suse_version}
 Recommends:     libproxy1-pacrunner = %{version}
+Suggests:       libproxy1-pacrunner-duktape
 Supplements:    (libproxy1 and libkde4)
 Supplements:    (libproxy1 and plasma5-session)
 %else
@@ -199,6 +202,22 @@
 A module to extend libproxy with capabilities to pass addresses to a
 WPAD/PAC script and have it find the correct proxy.
 
+%package -n libproxy1-pacrunner-duktape
+Summary:        Libproxy module to support WPAD/PAC parsing via the WebKit 
JavaScript Engine
+Group:          System/Libraries
+Requires:       libproxy1 = %{version}
+# A virtual symbol to identify that this is a pacrunner.
+Provides:       libproxy1-pacrunner = %{version}
+%if 0%{?suse_version}
+Supplements:    (libproxy1 and %(rpm --qf "%%{name}" -qf $(readlink -f 
%{_libdir}/libduktape.so)))
+%endif
+
+%description -n libproxy1-pacrunner-duktape
+A module to extend libproxy with capabilities to pass addresses to a
+WPAD/PAC script and have it find the correct proxy.
+
+Relies on tuktape to do the javascript parsing
+
 %package -n libproxy1-pacrunner-webkit
 Summary:        Libproxy module to support WPAD/PAC parsing via the WebKit 
JavaScript Engine
 Group:          System/Libraries
@@ -411,6 +430,10 @@
 %defattr(-, root, root)
 %{_libdir}/libproxy-%{version}/modules/network_networkmanager.so
 
+%files -n libproxy1-pacrunner-duktape
+%defattr(-, root, root)
+%{_libdir}/libproxy-%{version}/modules/pacrunner_duktape.so
+
 %files -n libproxy1-pacrunner-webkit
 %defattr(-, root, root)
 %{_libdir}/libproxy-%{version}/modules/pacrunner_webkit.so

++++++ libproxy-0.4.17.tar.xz -> libproxy-0.4.18.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/INSTALL new/libproxy-0.4.18/INSTALL
--- old/libproxy-0.4.17/INSTALL 2020-12-15 12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/INSTALL 2022-06-20 15:54:49.000000000 +0200
@@ -120,6 +120,7 @@
 
 WITH_WEBKIT3:           Default to OFF: Enable Webkit GTK3 support.
 
+WITH_DUKTAPE:           Defaults to ON. Enable Duktape JavaScript engine.
 
 Bindings Path:
 ==============
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/NEWS new/libproxy-0.4.18/NEWS
--- old/libproxy-0.4.17/NEWS    2020-12-29 12:27:52.000000000 +0100
+++ new/libproxy-0.4.18/NEWS    2022-06-20 16:23:41.000000000 +0200
@@ -1,3 +1,13 @@
+New in version 0.4.18:
+==============================
+* build: Allow configuration of sysconfig module
+* config_envvar: Add environment variable for pacrunner debugging
+* build: disable mozjs by default
+* python: Support Python 3.10 and above
+* Add Duktape pacrunner module
+* config_kde: Compute list of config file locations ourselves
+* cpmfog_gnome3: Add gnome-wayland to permitted DESKTOP_SESSION
+
 New in version 0.4.17:
 ==============================
 * python bindings: fix "TypeError: _argtypes_ must be a sequence of types" 
(#125)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/bindings/perl/lib/CMakeLists.txt 
new/libproxy-0.4.18/bindings/perl/lib/CMakeLists.txt
--- old/libproxy-0.4.17/bindings/perl/lib/CMakeLists.txt        2017-01-09 
15:23:39.000000000 +0100
+++ new/libproxy-0.4.18/bindings/perl/lib/CMakeLists.txt        2022-06-20 
16:06:50.000000000 +0200
@@ -1,2 +1,2 @@
-add_custom_target(PMlibproxy ALL ${CMAKE_COMMAND} -E copy 
${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.pm 
${CMAKE_BINARY_DIR}/perl/blib/lib/Libproxy.pm)
+add_custom_target(PMlibproxy ALL ${CMAKE_COMMAND} -E copy 
${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.pm 
${CMAKE_BINARY_DIR}/perl/Net/Libproxy.pm)
 install( FILES Libproxy.pm DESTINATION ${PX_PERL_ARCH}/Net )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/bindings/perl/src/CMakeLists.txt 
new/libproxy-0.4.18/bindings/perl/src/CMakeLists.txt
--- old/libproxy-0.4.17/bindings/perl/src/CMakeLists.txt        2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/bindings/perl/src/CMakeLists.txt        2022-06-20 
16:06:50.000000000 +0200
@@ -9,7 +9,7 @@
 
 set(Libproxy_LIB_SRCS Libproxy.c)
 
-set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/perl/blib/arch/auto/Net)
+set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/perl/auto/Net/Libproxy)
 add_library(PLlibproxy SHARED ${Libproxy_LIB_SRCS})
 
 set(PLlibproxy_LIB_DEPENDENCIES libproxy pthread)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/bindings/perl/src/Libproxy.xs 
new/libproxy-0.4.18/bindings/perl/src/Libproxy.xs
--- old/libproxy-0.4.17/bindings/perl/src/Libproxy.xs   2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/bindings/perl/src/Libproxy.xs   2022-06-20 
16:23:41.000000000 +0200
@@ -15,6 +15,37 @@
   SvSetSV( arg, newRV((SV*)avref));
 }
 
+/* http://www.perlmonks.org/?node_id=680842 */
+static char **
+XS_unpack_charPtrPtr (SV *arg) {
+  char **ret;
+  AV *av;
+  I32 i;
+
+  if (!arg || !SvOK (arg) || !SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV)
+    croak ("array reference expected");
+
+  av = (AV *)SvRV (arg);
+  ret = malloc ((av_len (av) + 1 + 1) * sizeof (char *));
+  if (!ret)
+    croak ("malloc failed");
+
+  for (i = 0; i <= av_len (av); i++) {
+    SV **elem = av_fetch (av, i, 0);
+
+    if (!elem || !*elem) {
+      free (ret);
+      croak ("missing element in list");
+    }
+
+    ret[i] = SvPV_nolen (*elem);
+  }
+
+  ret[i] = NULL;
+
+  return ret;
+}
+
 
 MODULE = Net::Libproxy PACKAGE = Net::Libproxy
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/bindings/perl/t/CMakeLists.txt 
new/libproxy-0.4.18/bindings/perl/t/CMakeLists.txt
--- old/libproxy-0.4.17/bindings/perl/t/CMakeLists.txt  2017-01-09 
15:23:39.000000000 +0100
+++ new/libproxy-0.4.18/bindings/perl/t/CMakeLists.txt  2022-06-20 
16:06:50.000000000 +0200
@@ -1 +1,2 @@
-add_custom_target(test prove -b ${CMAKE_CURRENT_SOURCE_DIR})
+add_test(NAME perl COMMAND prove -b ${CMAKE_CURRENT_SOURCE_DIR})
+set_property(TEST perl APPEND PROPERTY ENVIRONMENT 
"PERL5LIB=${CMAKE_BINARY_DIR}/perl")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libproxy-0.4.17/bindings/python/python2/CMakeLists.txt 
new/libproxy-0.4.18/bindings/python/python2/CMakeLists.txt
--- old/libproxy-0.4.17/bindings/python/python2/CMakeLists.txt  2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/bindings/python/python2/CMakeLists.txt  2022-06-20 
15:54:49.000000000 +0200
@@ -6,7 +6,7 @@
   if(NOT PYTHON2_SITEPKG_DIR)
     execute_process(COMMAND
                    ${PYTHON2_EXECUTABLE}
-                   -c "import sys; print (sys.version[0:3])"
+                   -c "import sys; 
print('{}.{}'.format(*sys.version_info[0:2]))"
                    OUTPUT_VARIABLE PYTHON2_VERSION
                    OUTPUT_STRIP_TRAILING_WHITESPACE)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libproxy-0.4.17/bindings/python/python3/CMakeLists.txt 
new/libproxy-0.4.18/bindings/python/python3/CMakeLists.txt
--- old/libproxy-0.4.17/bindings/python/python3/CMakeLists.txt  2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/bindings/python/python3/CMakeLists.txt  2022-06-20 
15:54:49.000000000 +0200
@@ -6,7 +6,7 @@
   if(NOT PYTHON3_SITEPKG_DIR)
     execute_process(COMMAND
                    ${PYTHON3_EXECUTABLE}
-                   -c "import sys; print (sys.version[0:3])"
+                   -c "import sys; 
print('{}.{}'.format(*sys.version_info[0:2]))"
                    OUTPUT_VARIABLE PYTHON3_VERSION
                    OUTPUT_STRIP_TRAILING_WHITESPACE)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/cmake/FindPython2Interp.cmake 
new/libproxy-0.4.18/cmake/FindPython2Interp.cmake
--- old/libproxy-0.4.17/cmake/FindPython2Interp.cmake   2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/cmake/FindPython2Interp.cmake   2022-06-20 
15:54:49.000000000 +0200
@@ -27,15 +27,32 @@
 # Copyright 2012 Rolf Eike Beer <e...@sf-mail.de>
 # Copyright 2016 Dominique Leuenberger <dims...@opensuse.org>
 #
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
 #
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#
+# * Neither the name of Kitware, Inc. nor the names of Contributors
+#   may be used to endorse or promote products derived from this
+#   software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 unset(_Python2_NAMES)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/cmake/FindPython3Interp.cmake 
new/libproxy-0.4.18/cmake/FindPython3Interp.cmake
--- old/libproxy-0.4.17/cmake/FindPython3Interp.cmake   2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/cmake/FindPython3Interp.cmake   2022-06-20 
16:06:50.000000000 +0200
@@ -27,19 +27,36 @@
 # Copyright 2012 Rolf Eike Beer <e...@sf-mail.de>
 # Copyright 2016 Dominique Leuenberger <dims...@opensuse.org>
 #
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
 #
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
+# * Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+#
+# * Neither the name of Kitware, Inc. nor the names of Contributors
+#   may be used to endorse or promote products derived from this
+#   software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 unset(_Python3_NAMES)
 
-set(_Python3_VERSIONS 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+set(_Python3_VERSIONS 3.11 3.10 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
 
 if(Python3Interp_FIND_VERSION)
     if(Python3Interp_FIND_VERSION_COUNT GREATER 1)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/CMakeLists.txt 
new/libproxy-0.4.18/libproxy/CMakeLists.txt
--- old/libproxy-0.4.17/libproxy/CMakeLists.txt 2020-12-29 12:28:56.000000000 
+0100
+++ new/libproxy-0.4.18/libproxy/CMakeLists.txt 2022-06-20 16:23:41.000000000 
+0200
@@ -1,6 +1,6 @@
 ### Project info
 project(libproxy)
-set_project_version(0 4 17)
+set_project_version(0 4 18)
 
 ### Add a global compilation stuff
 if (WIN32)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libproxy-0.4.17/libproxy/cmake/modules/config_sysconfig.cmk 
new/libproxy-0.4.18/libproxy/cmake/modules/config_sysconfig.cmk
--- old/libproxy-0.4.17/libproxy/cmake/modules/config_sysconfig.cmk     
2017-01-09 15:23:39.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/cmake/modules/config_sysconfig.cmk     
2022-06-20 15:54:49.000000000 +0200
@@ -1,5 +1,8 @@
 if (NOT WIN32 AND NOT APPLE)
-  if (EXISTS "/etc/sysconfig" AND IS_DIRECTORY "/etc/sysconfig")
-    set(SYSCONFIG_FOUND 1)
+  option(WITH_SYSCONFIG "Build sysconfig module for /etc/sysconfig" ON)
+  if(WITH_SYSCONFIG)
+    if (EXISTS "/etc/sysconfig" AND IS_DIRECTORY "/etc/sysconfig")
+      set(SYSCONFIG_FOUND 1)
+    endif()
   endif()
 endif()
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libproxy-0.4.17/libproxy/cmake/modules/pacrunner_duktape.cmk 
new/libproxy-0.4.18/libproxy/cmake/modules/pacrunner_duktape.cmk
--- old/libproxy-0.4.17/libproxy/cmake/modules/pacrunner_duktape.cmk    
1970-01-01 01:00:00.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/cmake/modules/pacrunner_duktape.cmk    
2022-06-20 15:54:49.000000000 +0200
@@ -0,0 +1,21 @@
+if(WIN32)
+  set(DUKTAPE_FOUND 0)
+else()
+  set(DUKTAPE_INCLUDE_DIR "DUKTAPE_INCLUDE_DIR-NOTFOUND" CACHE PATH "Path to 
Duktape headers")
+  set(DUKTAPE_LIBRARIES   "DUKTAPE_LIBRARIES-NOTFOUND"   CACHE FILEPATH "Path 
to Duktape libraries")
+
+  option(WITH_DUKTAPE "Search for Duktape package" ON)
+
+  if(WITH_DUKTAPE)
+    px_check_modules(DUKTAPE "duktape")
+
+    if(NOT DUKTAPE_FOUND AND DUKTAPE_INCLUDE_DIR AND DUKTAPE_LIBRARIES)
+      message("Duktape headers: " ${DUKTAPE_INCLUDE_DIR})
+      message("Duktape libraries: " ${DUKTAPE_LIBRARIES})
+      set(DUKTAPE_FOUND 1)
+      include_directories(${DUKTAPE_INCLUDE_DIR})
+      link_directories(${DUKTAPE_LIBRARIES})
+      link_libraries(duktape)
+    endif()
+  endif()
+endif()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libproxy-0.4.17/libproxy/cmake/modules/pacrunner_mozjs.cmk 
new/libproxy-0.4.18/libproxy/cmake/modules/pacrunner_mozjs.cmk
--- old/libproxy-0.4.17/libproxy/cmake/modules/pacrunner_mozjs.cmk      
2020-12-15 12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/cmake/modules/pacrunner_mozjs.cmk      
2022-06-20 15:54:49.000000000 +0200
@@ -7,7 +7,7 @@
     include_directories("${MOZJS_INCLUDE_DIR}")
   endif()
 elseif(NOT APPLE)
-  option(WITH_MOZJS "Search for MOZJS package" ON)
+  option(WITH_MOZJS "Search for MOZJS package" OFF)
   if (WITH_MOZJS)
     pkg_search_module(MOZJS mozjs-68)
     if(MOZJS_FOUND)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libproxy-0.4.17/libproxy/cmake/modules/pacrunner_webkit.cmk 
new/libproxy-0.4.18/libproxy/cmake/modules/pacrunner_webkit.cmk
--- old/libproxy-0.4.17/libproxy/cmake/modules/pacrunner_webkit.cmk     
2020-12-15 12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/cmake/modules/pacrunner_webkit.cmk     
2022-06-20 15:54:49.000000000 +0200
@@ -20,7 +20,7 @@
         px_check_modules(WEBKIT "webkitgtk-3.0 < 1.5.0")
       endif(NOT WEBKIT_LIBRARIES)
     endif(NOT WEBKIT_LIBRARIES)
-  else(WITH_WEBKIT3)
+  else(WITH_WEBKIT)
     px_check_modules(WEBKIT webkit-1.0)
   endif()
 endif()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/cmake/modules.cmk 
new/libproxy-0.4.18/libproxy/cmake/modules.cmk
--- old/libproxy-0.4.17/libproxy/cmake/modules.cmk      2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/cmake/modules.cmk      2022-06-20 
15:54:49.000000000 +0200
@@ -18,10 +18,13 @@
 include(cmake/modules/pacrunner_mozjs.cmk)
 include(cmake/modules/pacrunner_natus.cmk)
 include(cmake/modules/pacrunner_webkit.cmk)
+include(cmake/modules/pacrunner_duktape.cmk)
 
 # Build the pacrunner into libproxy unless we are building for multiple engines
 set(BIPR 1 CACHE BOOL "Build internal pacrunner? (Always false when building 
more than one PR")
-if((MOZJS_FOUND AND WEBKIT_FOUND) OR (MOZJS_FOUND AND NATUS_FOUND) OR 
(WEBKIT_FOUND AND NATUS_FOUND))
+
+math(EXPR NUM_PACRUNNER 
"${MOZJS_FOUND}+${NATUS_FOUND}+${WEBKIT_FOUND}+${DUKTAPE_FOUND}")
+if(NUM_PACRUNNER GREATER 1)
   set(BIPR 0)
 endif()
 
@@ -44,8 +47,10 @@
   set(NM_BUILD 1)
 endif(NM_FOUND OR NMold_FOUND)
 px_module(network_networkmanager   "${NM_BUILD}"     0       
${NM_LIBRARIES}${NMold_LIBRARIES})
-px_module(pacrunner_mozjs          0                 ${BIPR} 
${MOZJS_LIBRARIES})
+px_module(pacrunner_mozjs          "${MOZJS_FOUND}"  ${BIPR} 
${MOZJS_LIBRARIES})
 px_module(pacrunner_natus          "${NATUS_FOUND}"  ${BIPR} 
${NATUS_LIBRARIES})
 px_module(pacrunner_webkit         "${WEBKIT_FOUND}" ${BIPR} 
${WEBKIT_LIBRARIES})
+px_module(pacrunner_duktape        "${DUKTAPE_FOUND}" ${BIPR} 
${DUKTAPE_LIBRARIES})
 px_module(wpad_dns_alias           1                 1)
+message("${NUM_PACRUNNER} pacrunner(s) are enabled")
 message("")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/modules/config_envvar.cpp 
new/libproxy-0.4.18/libproxy/modules/config_envvar.cpp
--- old/libproxy-0.4.17/libproxy/modules/config_envvar.cpp      2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/modules/config_envvar.cpp      2022-06-20 
15:54:49.000000000 +0200
@@ -28,6 +28,12 @@
                const char *proxy = NULL;
                 vector<url> response;
 
+               // If _PX_DEBUG_PACURL is set, use it as the PAC URL.
+               if (proxy = getenv("_PX_DEBUG_PACURL")) {
+                       response.push_back(url(string("pac+") + proxy));
+                       return response;
+               }
+
                // If the URL is an ftp url, try to read the ftp proxy
                if (dst.get_scheme() == "ftp") {
                        if (!(proxy = getenv("ftp_proxy")))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/modules/config_gnome3.cpp 
new/libproxy-0.4.18/libproxy/modules/config_gnome3.cpp
--- old/libproxy-0.4.17/libproxy/modules/config_gnome3.cpp      2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/modules/config_gnome3.cpp      2022-06-20 
15:54:49.000000000 +0200
@@ -299,6 +299,8 @@
                        || (getenv("DESKTOP_SESSION")
                                && string(getenv("DESKTOP_SESSION")) == "gnome")
                        || (getenv("DESKTOP_SESSION")
+                               && string(getenv("DESKTOP_SESSION")) == 
"gnome-wayland")
+                       || (getenv("DESKTOP_SESSION")
                                && string(getenv("DESKTOP_SESSION")) == 
"mate"));
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/modules/config_kde.cpp 
new/libproxy-0.4.18/libproxy/modules/config_kde.cpp
--- old/libproxy-0.4.17/libproxy/modules/config_kde.cpp 2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/modules/config_kde.cpp 2022-06-20 
15:54:49.000000000 +0200
@@ -1,7 +1,7 @@
 
/*******************************************************************************
  * libproxy - A library for proxy configuration
  * Copyright (C) 2006 Nathaniel McCallum <nathan...@natemccallum.com>
- * Copyright (C) 2016 Fabian Vogt <fv...@suse.com>
+ * Copyright (C) 2021 Fabian Vogt <fv...@suse.com>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -19,6 +19,7 @@
  
******************************************************************************/
 
 #include <sys/stat.h>
+#include <pwd.h>
 
 #include <algorithm>
 #include <cstdlib>
@@ -46,7 +47,7 @@
             command_output("kreadconfig5 --key nonexistant");
 
             try {
-                parse_dir_list(command_output("qtpaths --paths 
GenericConfigLocation"));
+                use_xdg_config_dirs();
             }
             catch(...) {}
 
@@ -190,7 +191,7 @@
         time_t mtime; // 0 means either not refreshed or doesn't exist
     };
 
-    // Parses output of qtpaths/kde4-config to fill config_locs
+    // Parses colon-delimited lists of paths to fill config_locs
     void parse_dir_list(const string &dirs) {
         string config_path;
         stringstream config_paths_stream(dirs);
@@ -204,6 +205,34 @@
         }
     }
 
+    // Add XDG configuration locations to the configuration paths
+    void use_xdg_config_dirs() {
+        // Return environment value as std::string if set, otherwise def
+        auto getenv_default = [](const char *name, const std::string &def) {
+            const char *ret = getenv(name);
+            return std::string(ret ? ret : def);
+        };
+
+        std::string homedir = getenv_default("HOME", "");
+        if (homedir.empty()) {
+            size_t bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
+            if (bufsize == -1)
+                bufsize = 16384;
+
+            std::vector<char> buf(bufsize);
+            struct passwd pwd, *result;
+            getpwuid_r(getuid(), &pwd, buf.data(), buf.size(), &result);
+            if (result)
+                homedir = pwd.pw_dir;
+        }
+
+        if (homedir.empty())
+            throw std::runtime_error("Failed to get home directory");
+
+        parse_dir_list(getenv_default("XDG_CONFIG_HOME", homedir + 
"/.config"));
+        parse_dir_list(getenv_default("XDG_CONFIG_DIRS", "/etc/xdg"));
+    }
+
     // If any of the locations in config_locs changed (different mtime),
     // update config_locs and return true.
     bool cache_needs_refresh() {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libproxy-0.4.17/libproxy/modules/pacrunner_duktape.cpp 
new/libproxy-0.4.18/libproxy/modules/pacrunner_duktape.cpp
--- old/libproxy-0.4.17/libproxy/modules/pacrunner_duktape.cpp  1970-01-01 
01:00:00.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/modules/pacrunner_duktape.cpp  2022-06-20 
15:54:49.000000000 +0200
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * libproxy - A library for proxy configuration
+ * Copyright (C) 2006 Nathaniel McCallum <nathan...@natemccallum.com>
+ * Copyright (C) 2021 Zhaofeng Li <he...@zhaofeng.li>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 
USA
+ 
******************************************************************************/
+
+#include "../extension_pacrunner.hpp"
+#include <unistd.h> // gethostname
+using namespace libproxy;
+
+#include <duktape.h>
+#include "pacutils.h"
+
+static duk_ret_t dnsResolve(duk_context *ctx) {
+       if (duk_get_top(ctx) != 1) {
+               // Invalid number of arguments
+               return 0;
+       }
+
+       // We do not need to free the string - It's managed by Duktape.
+       const char *hostname = duk_get_string(ctx, 0);
+       if (!hostname) {
+               return 0;
+       }
+
+       // Look it up
+       struct addrinfo *info;
+       if (getaddrinfo(hostname, NULL, NULL, &info)) {
+               return 0;
+       }
+
+       // Try for IPv4
+       char tmp[INET6_ADDRSTRLEN+1];
+       if (getnameinfo(info->ai_addr, info->ai_addrlen,
+                                       tmp, INET6_ADDRSTRLEN+1,
+                                       NULL, 0,
+                                       NI_NUMERICHOST)) {
+               freeaddrinfo(info);
+               duk_push_null(ctx);
+               return 1;
+       }
+       freeaddrinfo(info);
+
+       // Create the return value
+       duk_push_string(ctx, tmp);
+       return 1;
+}
+
+static duk_ret_t myIpAddress(duk_context *ctx) {
+       char hostname[1024];
+       hostname[sizeof(hostname) - 1] = '\0';
+
+       if (!gethostname(hostname, sizeof(hostname) - 1)) {
+               duk_push_string(ctx, hostname);
+               return dnsResolve(ctx);
+       }
+
+       return duk_error(ctx, DUK_ERR_ERROR, "Unable to find hostname!");
+}
+
+class duktape_pacrunner : public pacrunner {
+public:
+       duktape_pacrunner(string pac, const url& pacurl) : pacrunner(pac, 
pacurl) {
+               this->ctx = duk_create_heap_default();
+               if (!this->ctx) goto error;
+               duk_push_c_function(this->ctx, dnsResolve, 1);
+               duk_put_global_string(this->ctx, "dnsResolve");
+
+               duk_push_c_function(this->ctx, myIpAddress, 1);
+               duk_put_global_string(this->ctx, "myIpAddress");
+
+               // Add other routines
+               duk_push_string(this->ctx, JAVASCRIPT_ROUTINES);
+               if (duk_peval_noresult(this->ctx)) {
+                       goto error;
+               }
+
+               // Add the PAC into the context
+               duk_push_string(this->ctx, pac.c_str());
+               if (duk_peval_noresult(this->ctx)) {
+                       goto error;
+               }
+
+               return;
+       error:
+               duk_destroy_heap(this->ctx);
+               throw bad_alloc();
+       }
+
+       ~duktape_pacrunner() {
+               duk_destroy_heap(this->ctx);
+       }
+
+       string run(const url& url_) override {
+               string url = url_.to_string();
+               string host = url_.get_host();
+
+               duk_get_global_string(this->ctx, "FindProxyForURL");
+               duk_push_string(this->ctx, url.c_str());
+               duk_push_string(this->ctx, host.c_str());
+               duk_int_t result = duk_pcall(this->ctx, 2);
+
+               if (result == 0) {
+                       // Success
+                       const char *proxy = duk_get_string(this->ctx, 0);
+                       if (!proxy) {
+                               duk_pop(this->ctx);
+                               return "";
+                       }
+                       string proxyString = string(proxy);
+                       duk_pop(this->ctx);
+                       return proxyString;
+               } else {
+                       // Something happened. The top of the stack is an error.
+                       duk_pop(this->ctx);
+                       return "";
+               }
+       }
+
+private:
+       duk_context *ctx;
+};
+
+PX_PACRUNNER_MODULE_EZ(duktape, "duk_create_heap_default", "duktape");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/modules/pacrunner_mozjs.cpp 
new/libproxy-0.4.18/libproxy/modules/pacrunner_mozjs.cpp
--- old/libproxy-0.4.17/libproxy/modules/pacrunner_mozjs.cpp    2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/modules/pacrunner_mozjs.cpp    2022-06-20 
15:54:49.000000000 +0200
@@ -93,6 +93,7 @@
 static bool myIpAddress(JSContext *cx, unsigned argc, JS::Value *vp) {
        JS::CallArgs argv=JS::CallArgsFromVp(argc,vp);
        char *hostname = (char *) JS_malloc(cx, 1024);
+       hostname[1023] = '\0';
 
        if (!gethostname(hostname, 1023)) {
                JSString *myhost = JS_NewStringCopyN(cx, hostname, 
strlen(hostname));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/modules/pacrunner_natus.cpp 
new/libproxy-0.4.18/libproxy/modules/pacrunner_natus.cpp
--- old/libproxy-0.4.17/libproxy/modules/pacrunner_natus.cpp    2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/modules/pacrunner_natus.cpp    2022-06-20 
15:54:49.000000000 +0200
@@ -56,7 +56,9 @@
 
 static Value myIpAddress(Value& ths, Value& fnc, vector<Value>& arg) {
        char hostname[1024];
-       if (!gethostname(hostname, 1023)) {
+       hostname[sizeof(hostname) - 1] = '\0';
+
+       if (!gethostname(hostname, sizeof(hostname) - 1)) {
                vector<Value> dnsargs;
                dnsargs.push_back(ths.newString(hostname));
                return dnsResolve(ths, fnc, dnsargs);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libproxy-0.4.17/libproxy/modules/pacrunner_webkit.cpp 
new/libproxy-0.4.18/libproxy/modules/pacrunner_webkit.cpp
--- old/libproxy-0.4.17/libproxy/modules/pacrunner_webkit.cpp   2020-12-15 
12:26:48.000000000 +0100
+++ new/libproxy-0.4.18/libproxy/modules/pacrunner_webkit.cpp   2022-06-20 
15:54:49.000000000 +0200
@@ -86,7 +86,9 @@
 static JSValueRef myIpAddress(JSContextRef ctx, JSObjectRef func, JSObjectRef 
self, size_t /*argc*/, const JSValueRef[] /*argv*/, JSValueRef* /*exception*/)
 {
        char hostname[1024];
-       if (!gethostname(hostname, 1023)) {
+       hostname[sizeof(hostname) - 1] = '\0';
+
+       if (!gethostname(hostname, sizeof(hostname) - 1)) {
                JSStringRef str = JSStringCreateWithUTF8CString(hostname);
                JSValueRef  val = JSValueMakeString(ctx, str);
                JSStringRelease(str);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/proxy.h 
new/libproxy-0.4.18/libproxy/proxy.h
--- old/libproxy-0.4.17/libproxy/proxy.h        2020-12-15 12:26:48.000000000 
+0100
+++ new/libproxy-0.4.18/libproxy/proxy.h        2022-06-20 15:54:49.000000000 
+0200
@@ -74,7 +74,7 @@
  * and should be use to authenticate the connection if present.
  *
  * For SOCKS proxies, when the protocol version is specified (socks4:// or
- * sock5://), it is expected that only this version is used. When only
+ * socks5://), it is expected that only this version is used. When only
  * socks:// is set, the client MUST try SOCKS version 5 protocol and, on
  * connection failure, fallback to SOCKS version 4.
  *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libproxy-0.4.17/libproxy/url.cpp 
new/libproxy-0.4.18/libproxy/url.cpp
--- old/libproxy-0.4.17/libproxy/url.cpp        2020-12-28 12:32:09.000000000 
+0100
+++ new/libproxy-0.4.18/libproxy/url.cpp        2022-06-20 15:54:49.000000000 
+0200
@@ -457,7 +457,7 @@
 
        // Build the request string
        request  = "GET " + (m_path.size() > 0 ? m_path : "/") + m_query + " 
HTTP/1.1\r\n";
-       request += "Host: " + m_host + "\r\n";
+       request += "Host: " + m_host + (m_port != 80 ? ":" + 
std::to_string(m_port) : "") + "\r\n";
        request += "Accept: " + string(PAC_MIME_TYPE) + "\r\n";
        request += "Connection: close\r\n";
        request += "\r\n";

++++++ libproxy-perl-cflags.patch ++++++
>From 4d7b2a237b206492cd63d0e96c0c1caf89902352 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fv...@suse.de>
Date: Tue, 21 Jun 2022 10:45:50 +0200
Subject: [PATCH] bindings: perl: Use ccflags from %Config for libproxy module
 compilation

This is needed to achieve (binary and source) compatibility. Unfortunately
there doesn't appear to be a more official way, even PERL_EXTRA_C_FLAGS is not
complete.

Fixes #182
---
 bindings/perl/CMakeLists.txt     | 7 +++++++
 bindings/perl/src/CMakeLists.txt | 1 +
 2 files changed, 8 insertions(+)

diff --git a/bindings/perl/CMakeLists.txt b/bindings/perl/CMakeLists.txt
index 4db28e1a..368bc56a 100644
--- a/bindings/perl/CMakeLists.txt
+++ b/bindings/perl/CMakeLists.txt
@@ -33,6 +33,13 @@ if(PERL_FOUND AND PERLLIBS_FOUND)
         OUTPUT_VARIABLE PX_PERL_ARCH)
       set (PX_PERL_LIB ${PERL_SITELIB})
     endif()
+
+    # PERL_EXTRA_C_FLAGS is not complete, we need full flags (including e.g.
+    # _FILE_OFFSET_BITS=64) for compatibility.
+    EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print 
\$Config{ccflags}"
+      OUTPUT_VARIABLE PX_PERL_CCFLAGS)
+    # Convert it to a "list" suitable for target_compile_options.
+    string(REPLACE " " ";" PX_PERL_CCFLAGS ${PX_PERL_CCFLAGS})
   endif()
 
   add_subdirectory(lib)
diff --git a/bindings/perl/src/CMakeLists.txt b/bindings/perl/src/CMakeLists.txt
index 29e656d4..2800a85c 100644
--- a/bindings/perl/src/CMakeLists.txt
+++ b/bindings/perl/src/CMakeLists.txt
@@ -18,6 +18,7 @@ if(PERL_LINK_LIBPERL)
 endif()
 
 target_link_libraries(PLlibproxy ${PLlibproxy_LIB_DEPENDENCIES})
+target_compile_options(PLlibproxy PRIVATE ${PX_PERL_CCFLAGS})
 set_target_properties(PLlibproxy PROPERTIES OUTPUT_NAME "Libproxy")
 set_target_properties(PLlibproxy PROPERTIES PREFIX "")
 

Reply via email to