aboutsummaryrefslogtreecommitdiff
path: root/net/libproxy
diff options
context:
space:
mode:
authorTobias C. Berner <tcberner@FreeBSD.org>2021-02-26 19:27:14 +0000
committerTobias C. Berner <tcberner@FreeBSD.org>2021-02-26 19:27:14 +0000
commit58b7ce0b0c96421ba93d9e1eda0b31ef8fe09092 (patch)
tree80f37c24c92d39e7fc63d550fd091b02f74d6ec0 /net/libproxy
parent92861de85a719ef0dfbb6bbd111fd635ac147d9e (diff)
downloadports-58b7ce0b0c96421ba93d9e1eda0b31ef8fe09092.tar.gz
ports-58b7ce0b0c96421ba93d9e1eda0b31ef8fe09092.zip
net/libproxy: update to 0.4.17
- mark libproxy-mozjs borken - add new port for pacrunner - drop support for python2 Changelog: - 0.4.16: * Port to, and require, SpiderMonkey 68 * Use closesocket() instead of close() on Windows * Add symbol versions - be ready to introduce new APIs as needed * Add public px_proxy_factory_free_proxies function * Add PacRunner config backend (largely untested; feedback welcome!) * Small performance improvements * pxgsettings: use the correct syntax to connect to the changed signal (silences annoying output on console) * Support python3 up to version 3.9 * Fix buffer overflow when PAC is enabled (CVE-2020-26154) * Rewrite url::recvline to be nonrecursive (CVE-2020-25219) * Remove nonfunctional and crashy pacrunner caching * Never use system libmodman (no other consumers, not maintained) - 0.4.17: * python bindings: fix "TypeError: argtypes must be a sequence of types" (#125)
Notes
Notes: svn path=/head/; revision=566630
Diffstat (limited to 'net/libproxy')
-rw-r--r--net/libproxy/Makefile17
-rw-r--r--net/libproxy/distinfo6
-rw-r--r--net/libproxy/files/libproxy-0.4.15-mozjs52.patch124
-rw-r--r--net/libproxy/files/patch-CMakeLists.txt6
-rw-r--r--net/libproxy/files/patch-libproxy_cmake_modules.cmk12
-rw-r--r--net/libproxy/files/patch-libproxy_test_get-pac-test.cpp29
6 files changed, 28 insertions, 166 deletions
diff --git a/net/libproxy/Makefile b/net/libproxy/Makefile
index cebee974ac0c..3afd1b73a97b 100644
--- a/net/libproxy/Makefile
+++ b/net/libproxy/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
PORTNAME= libproxy
-PORTVERSION= 0.4.15
+DISTVERSION= 0.4.17
PORTREVISION?= 0
CATEGORIES?= net devel
@@ -46,19 +46,22 @@ CMAKE_ON+= WITH_WEBKIT
CMAKE_OFF:= ${CMAKE_OFF:C/WITH_WEBKIT//}
.endif
+.if ${LIBPROXY_SLAVE:Mpacrunner}
+LIB_DEPENDS+= libdbus-1.so:devel/dbus
+CMAKE_ON= BUILD_CONFIG_PACRUNNER
+.endif
+
+.if ${LIBPROXY_SLAVE:Mkde} || ${LIBPROXY_SLAVE:Mwebkit3}
+RUN_DEPENDS+= libproxy-pacrunner>=${DISTVERSION}:net/libproxy-pacrunner
+.endif
+
.include <bsd.port.pre.mk>
# Hackery for the to python backends.
.if ${LIBPROXY_SLAVE:Mpython}
-. if ${PYTHON_MAJOR_VER} == 2
-CMAKE_ON+= WITH_PYTHON2
-CMAKE_OFF+= WITH_PYTHON3
-CMAKE_ARGS+= -DPYTHON2_EXECUTABLE:FILEPATH=${PYTHON_CMD}
-. else
CMAKE_ON+= WITH_PYTHON3
CMAKE_OFF+= WITH_PYTHON2
CMAKE_ARGS+= -DPYTHON3_EXECUTABLE:FILEPATH=${PYTHON_CMD}
-. endif
.else
CMAKE_OFF+= WITH_PYTHON2 WITH_PYTHON3
.endif
diff --git a/net/libproxy/distinfo b/net/libproxy/distinfo
index b0890e89a5a0..9354e0ad01e9 100644
--- a/net/libproxy/distinfo
+++ b/net/libproxy/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1499371033
-SHA256 (libproxy-libproxy-0.4.15_GH0.tar.gz) = 18f58b0a0043b6881774187427ead158d310127fc46a1c668ad6d207fb28b4e0
-SIZE (libproxy-libproxy-0.4.15_GH0.tar.gz) = 93084
+TIMESTAMP = 1614342859
+SHA256 (libproxy-libproxy-0.4.17_GH0.tar.gz) = 88c624711412665515e2800a7e564aabb5b3ee781b9820eca9168035b0de60a9
+SIZE (libproxy-libproxy-0.4.17_GH0.tar.gz) = 95542
diff --git a/net/libproxy/files/libproxy-0.4.15-mozjs52.patch b/net/libproxy/files/libproxy-0.4.15-mozjs52.patch
deleted file mode 100644
index a9e2ce921a36..000000000000
--- a/net/libproxy/files/libproxy-0.4.15-mozjs52.patch
+++ /dev/null
@@ -1,124 +0,0 @@
-From f594720280b2e40d81fa6e286a0ef8868687ef7e Mon Sep 17 00:00:00 2001
-From: Pierre Lejeune <superheron@gmail.com>
-Date: Sat, 30 Jun 2018 21:10:06 +0200
-Subject: [PATCH] Build with mozjs-52
-
-Fixes #71
----
- libproxy/cmake/modules/pacrunner_mozjs.cmk | 2 +-
- libproxy/modules/pacrunner_mozjs.cpp | 19 +++++++------------
- 2 files changed, 8 insertions(+), 13 deletions(-)
-
-diff --git a/libproxy/cmake/modules/pacrunner_mozjs.cmk b/libproxy/cmake/modules/pacrunner_mozjs.cmk
-index c2ae3db..20857fb 100644
---- a/libproxy/cmake/modules/pacrunner_mozjs.cmk
-+++ b/libproxy/cmake/modules/pacrunner_mozjs.cmk
-@@ -9,7 +9,7 @@ if(WIN32)
- elseif(NOT APPLE)
- option(WITH_MOZJS "Search for MOZJS package" ON)
- if (WITH_MOZJS)
-- pkg_search_module(MOZJS mozjs-38)
-+ pkg_search_module(MOZJS mozjs-52)
- if(MOZJS_FOUND)
- include_directories(${MOZJS_INCLUDE_DIRS})
- link_directories(${MOZJS_LIBRARY_DIRS})
-diff --git a/libproxy/modules/pacrunner_mozjs.cpp b/libproxy/modules/pacrunner_mozjs.cpp
-index a70b2e9..ed07c69 100644
---- a/libproxy/modules/pacrunner_mozjs.cpp
-+++ b/libproxy/modules/pacrunner_mozjs.cpp
-@@ -35,6 +35,7 @@ using namespace libproxy;
- #pragma GCC diagnostic ignored "-Winvalid-offsetof"
- #include <jsapi.h>
- #pragma GCC diagnostic error "-Winvalid-offsetof"
-+#include <js/Initialization.h>
- #include <js/CallArgs.h>
-
- #include "pacutils.h"
-@@ -111,17 +112,14 @@ class mozjs_pacrunner : public pacrunner {
- mozjs_pacrunner(string pac, const url& pacurl) throw (bad_alloc) : pacrunner(pac, pacurl) {
-
- // Set defaults
-- this->jsrun = nullptr;
- this->jsctx = nullptr;
- JS_Init();
-
-- // Initialize Javascript runtime environment
-- if (!(this->jsrun = JS_NewRuntime(1024 * 1024))) goto error;
-- if (!(this->jsctx = JS_NewContext(this->jsrun, 1024 * 1024))) goto error;
-+ // Initialize Javascript context
-+ if (!(this->jsctx = JS_NewContext(1024 * 1024))) goto error;
- {
- JS::RootedValue rval(this->jsctx);
- JS::CompartmentOptions compart_opts;
-- compart_opts.setVersion(JSVERSION_LATEST);
-
- this->jsglb = new JS::Heap<JSObject*>(JS_NewGlobalObject(
- this->jsctx, &cls,
-@@ -139,16 +137,15 @@ class mozjs_pacrunner : public pacrunner {
- JS::CompileOptions options(this->jsctx);
- options.setUTF8(true);
-
-- JS::Evaluate(this->jsctx, global, options, JAVASCRIPT_ROUTINES,
-- strlen(JAVASCRIPT_ROUTINES), &rval);
-+ JS::Evaluate(this->jsctx, options, JAVASCRIPT_ROUTINES,
-+ strlen(JAVASCRIPT_ROUTINES), JS::MutableHandleValue(&rval));
-
- // Add PAC to the environment
-- JS::Evaluate(this->jsctx, global, options, pac.c_str(), pac.length(), &rval);
-+ JS::Evaluate(this->jsctx, options, pac.c_str(), pac.length(), JS::MutableHandleValue(&rval));
- return;
- }
- error:
- if (this->jsctx) JS_DestroyContext(this->jsctx);
-- if (this->jsrun) JS_DestroyRuntime(this->jsrun);
- throw bad_alloc();
- }
-
-@@ -156,7 +153,6 @@ class mozjs_pacrunner : public pacrunner {
- if (this->jsac) delete this->jsac;
- if (this->jsglb) delete this->jsglb;
- if (this->jsctx) JS_DestroyContext(this->jsctx);
-- if (this->jsrun) JS_DestroyRuntime(this->jsrun);
- JS_ShutDown();
- }
-
-@@ -178,7 +174,7 @@ class mozjs_pacrunner : public pacrunner {
- JS::RootedObject global(this->jsctx,this->jsglb->get());
- bool result = JS_CallFunctionName(this->jsctx, global, "FindProxyForURL", args, &rval);
- if (!result) return "";
--
-+
- char * tmpanswer = JS_EncodeString(this->jsctx, rval.toString());
- string answer = string(tmpanswer);
- JS_free(this->jsctx, tmpanswer);
-@@ -188,7 +184,6 @@ class mozjs_pacrunner : public pacrunner {
- }
-
- private:
-- JSRuntime *jsrun;
- JSContext *jsctx;
- JS::Heap<JSObject*> *jsglb;
- JSAutoCompartment *jsac;
-From a9b052c6e30101fb0b702917f245a3e2a2f08366 Mon Sep 17 00:00:00 2001
-From: Laurent Bigonville <bigon@bigon.be>
-Date: Tue, 2 Oct 2018 10:22:56 +0200
-Subject: [PATCH] Add call to JS::InitSelfHostedCode()
-
-This is needed otherwise mozjs crashes
----
- libproxy/modules/pacrunner_mozjs.cpp | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/libproxy/modules/pacrunner_mozjs.cpp b/libproxy/modules/pacrunner_mozjs.cpp
-index ed07c69..38e7d46 100644
---- a/libproxy/modules/pacrunner_mozjs.cpp
-+++ b/libproxy/modules/pacrunner_mozjs.cpp
-@@ -118,6 +118,8 @@ class mozjs_pacrunner : public pacrunner {
- // Initialize Javascript context
- if (!(this->jsctx = JS_NewContext(1024 * 1024))) goto error;
- {
-+ if (!JS::InitSelfHostedCode(this->jsctx)) goto error;
-+
- JS::RootedValue rval(this->jsctx);
- JS::CompartmentOptions compart_opts;
-
diff --git a/net/libproxy/files/patch-CMakeLists.txt b/net/libproxy/files/patch-CMakeLists.txt
index f9b7708ac3c3..9532ccec6ade 100644
--- a/net/libproxy/files/patch-CMakeLists.txt
+++ b/net/libproxy/files/patch-CMakeLists.txt
@@ -2,9 +2,9 @@ As the library is only built in the master port, and therfore missing in the
build directory for the slave ports, find it via pkg-config and link against it,
when building a slave.
---- CMakeLists.txt.orig 2017-05-11 09:33:33 UTC
+--- CMakeLists.txt.orig 2020-12-29 11:30:46 UTC
+++ CMakeLists.txt
-@@ -23,6 +23,15 @@ else()
+@@ -26,6 +26,15 @@ else()
set(CMAKE_INSTALL_CONFIG_NAME ${CMAKE_BUILD_TYPE})
endif()
@@ -20,7 +20,7 @@ when building a slave.
include(cmake/cpack.cmk)
include(cmake/ctest.cmk)
include(cmake/paths.cmk)
-@@ -56,5 +65,7 @@ endif()
+@@ -44,5 +53,7 @@ endif()
# Always build these
add_subdirectory(libproxy)
diff --git a/net/libproxy/files/patch-libproxy_cmake_modules.cmk b/net/libproxy/files/patch-libproxy_cmake_modules.cmk
new file mode 100644
index 000000000000..afe898372415
--- /dev/null
+++ b/net/libproxy/files/patch-libproxy_cmake_modules.cmk
@@ -0,0 +1,12 @@
+--- libproxy/cmake/modules.cmk.orig 2021-02-26 18:24:03 UTC
++++ libproxy/cmake/modules.cmk
+@@ -29,7 +29,9 @@ endif()
+ ## Module definition
+ #
+ message("MODULES TO BUILD:")
++if(BUILD_CONFIG_PACRUNNER)
+ px_module(config_pacrunner "${DBUS_FOUND}" 0 ${DBUS_LIBRARIES})
++endif()
+ px_module(config_envvar "${ENVVAR_FOUND}" 1)
+ px_module(config_sysconfig "${SYSCONFIG_FOUND}" 1)
+ px_module(config_gnome "${GNOME2_FOUND}" 0)
diff --git a/net/libproxy/files/patch-libproxy_test_get-pac-test.cpp b/net/libproxy/files/patch-libproxy_test_get-pac-test.cpp
deleted file mode 100644
index 8baef77dae6d..000000000000
--- a/net/libproxy/files/patch-libproxy_test_get-pac-test.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-First hunk:
-libc++ doesn't like "using namespace std" in C++11
-
-libproxy/test/get-pac-test.cpp:48:10: error: assigning to 'int' from incompatible type '__bind<int &, sockaddr *, unsigned long>'
- ret = bind(m_sock, (sockaddr*)&addr, sizeof (struct sockaddr_in));
- ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-Second hunk:
-Fix typo.
-
---- libproxy/test/get-pac-test.cpp.orig 2017-05-11 11:33:33.000000000 +0200
-+++ libproxy/test/get-pac-test.cpp 2018-06-02 14:32:22.796000000 +0200
-@@ -52,7 +52,7 @@
-
- setsockopt(m_sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof(i));
-
-- ret = bind(m_sock, (sockaddr*)&addr, sizeof (struct sockaddr_in));
-+ ret = ::bind(m_sock, (sockaddr*)&addr, sizeof (struct sockaddr_in));
- assert(!ret);
-
- ret = listen(m_sock, 1);
-@@ -130,7 +130,7 @@
-
- #ifdef SO_NOSIGPIPE
- int i = 1;
-- setsockopt(c_sock, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i));
-+ setsockopt(csock, SOL_SOCKET, SO_NOSIGPIPE, &i, sizeof(i));
- #endif
-
- // Read request