Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

8 changed files with 698 additions and 51 deletions

132
SOURCES/Copyright.txt Normal file
View File

@ -0,0 +1,132 @@
CMake - Cross Platform Makefile Generator
Copyright 2000-2021 Kitware, Inc. and Contributors
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* 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.
------------------------------------------------------------------------------
The following individuals and institutions are among the Contributors:
* Aaron C. Meadows <cmake@shadowguarddev.com>
* Adriaan de Groot <groot@kde.org>
* Aleksey Avdeev <solo@altlinux.ru>
* Alexander Neundorf <neundorf@kde.org>
* Alexander Smorkalov <alexander.smorkalov@itseez.com>
* Alexey Sokolov <sokolov@google.com>
* Alex Merry <alex.merry@kde.org>
* Alex Turbov <i.zaufi@gmail.com>
* Andreas Pakulat <apaku@gmx.de>
* Andreas Schneider <asn@cryptomilk.org>
* André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no>
* Axel Huebl, Helmholtz-Zentrum Dresden - Rossendorf
* Benjamin Eikel
* Bjoern Ricks <bjoern.ricks@gmail.com>
* Brad Hards <bradh@kde.org>
* Christopher Harvey
* Christoph Grüninger <foss@grueninger.de>
* Clement Creusot <creusot@cs.york.ac.uk>
* Daniel Blezek <blezek@gmail.com>
* Daniel Pfeifer <daniel@pfeifer-mail.de>
* Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
* Eran Ifrah <eran.ifrah@gmail.com>
* Esben Mose Hansen, Ange Optimization ApS
* Geoffrey Viola <geoffrey.viola@asirobots.com>
* Google Inc
* Gregor Jasny
* Helio Chissini de Castro <helio@kde.org>
* Ilya Lavrenov <ilya.lavrenov@itseez.com>
* Insight Software Consortium <insightsoftwareconsortium.org>
* Jan Woetzel
* Julien Schueller
* Kelly Thompson <kgt@lanl.gov>
* Konstantin Podsvirov <konstantin@podsvirov.pro>
* Laurent Montel <montel@kde.org>
* Mario Bensi <mbensi@ipsquad.net>
* Martin Gräßlin <mgraesslin@kde.org>
* Mathieu Malaterre <mathieu.malaterre@gmail.com>
* Matthaeus G. Chajdas
* Matthias Kretz <kretz@kde.org>
* Matthias Maennich <matthias@maennich.net>
* Michael Hirsch, Ph.D. <www.scivision.co>
* Michael Stürmer
* Miguel A. Figueroa-Villanueva
* Mike Jackson
* Mike McQuaid <mike@mikemcquaid.com>
* Nicolas Bock <nicolasbock@gmail.com>
* Nicolas Despres <nicolas.despres@gmail.com>
* Nikita Krupen'ko <krnekit@gmail.com>
* NVIDIA Corporation <www.nvidia.com>
* OpenGamma Ltd. <opengamma.com>
* Patrick Stotko <stotko@cs.uni-bonn.de>
* Per Øyvind Karlsen <peroyvind@mandriva.org>
* Peter Collingbourne <peter@pcc.me.uk>
* Petr Gotthard <gotthard@honeywell.com>
* Philip Lowman <philip@yhbt.com>
* Philippe Proulx <pproulx@efficios.com>
* Raffi Enficiaud, Max Planck Society
* Raumfeld <raumfeld.com>
* Roger Leigh <rleigh@codelibre.net>
* Rolf Eike Beer <eike@sf-mail.de>
* Roman Donchenko <roman.donchenko@itseez.com>
* Roman Kharitonov <roman.kharitonov@itseez.com>
* Ruslan Baratov
* Sebastian Holtermann <sebholt@xwmw.org>
* Stephen Kelly <steveire@gmail.com>
* Sylvain Joubert <joubert.sy@gmail.com>
* The Qt Company Ltd.
* Thomas Sondergaard <ts@medical-insight.com>
* Tobias Hunger <tobias.hunger@qt.io>
* Todd Gamblin <tgamblin@llnl.gov>
* Tristan Carel
* University of Dundee
* Vadim Zhukov
* Will Dicharry <wdicharry@stellarscience.com>
See version control history for details of individual contributions.
The above copyright and license notice applies to distributions of
CMake in source and binary form. Third-party software packages supplied
with CMake under compatible licenses provide their own copyright notices
documented in corresponding subdirectories or source files.
------------------------------------------------------------------------------
CMake was initially developed by Kitware with the following sponsorship:
* National Library of Medicine at the National Institutes of Health
as part of the Insight Segmentation and Registration Toolkit (ITK).
* US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
Visualization Initiative.
* National Alliance for Medical Image Computing (NAMIC) is funded by the
National Institutes of Health through the NIH Roadmap for Medical Research,
Grant U54 EB005149.
* Kitware, Inc.

View File

@ -0,0 +1,38 @@
From 738785214546ec5bb772886019529b2a6519deaf Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Fri, 1 May 2020 19:04:22 +0100
Subject: [PATCH] mozjs: Avoid use-after-free
If we don't assign the temporary std::string returned by
url_.to_string() to a variable, then it immediately goes out of scope
and is freed, resulting in the result of c_str() pointing into freed
memory. This works about as well as you would expect.
Signed-off-by: Simon McVittie <smcv@debian.org>
---
libproxy/modules/pacrunner_mozjs.cpp | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/libproxy/modules/pacrunner_mozjs.cpp b/libproxy/modules/pacrunner_mozjs.cpp
index ade6d0a..aac6531 100644
--- a/libproxy/modules/pacrunner_mozjs.cpp
+++ b/libproxy/modules/pacrunner_mozjs.cpp
@@ -175,14 +175,11 @@ class mozjs_pacrunner : public pacrunner {
string run(const url& url_) throw (bad_alloc) {
// Build arguments to the FindProxyForURL() function
- const char *tmpurl = url_.to_string().c_str();
- const char *tmphost = url_.get_host().c_str();
- if (!tmpurl || !tmphost) {
- throw bad_alloc();
- }
+ string tmpurl(url_.to_string());
+ string tmphost(url_.get_host());
JS::AutoValueArray<2> args(this->jsctx);
- args[0].setString(JS_NewStringCopyZ(this->jsctx, tmpurl));
- args[1].setString(JS_NewStringCopyZ(this->jsctx, tmphost));
+ args[0].setString(JS_NewStringCopyZ(this->jsctx, tmpurl.c_str()));
+ args[1].setString(JS_NewStringCopyZ(this->jsctx, tmphost.c_str()));
// Find the proxy (call FindProxyForURL())
JS::RootedValue rval(this->jsctx);

View File

@ -0,0 +1,124 @@
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;

View File

@ -0,0 +1,23 @@
From 1600c6af7ed775d4ccbb239937acd92ef7162409 Mon Sep 17 00:00:00 2001
From: Laurent Bigonville <bigon@bigon.be>
Date: Sun, 9 Dec 2018 16:07:55 +0100
Subject: [PATCH] Build with mozjs 60 instead
This seems enough to make it work with mozjs 60
---
libproxy/cmake/modules/pacrunner_mozjs.cmk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libproxy/cmake/modules/pacrunner_mozjs.cmk b/libproxy/cmake/modules/pacrunner_mozjs.cmk
index 20857fb..871cc85 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-52)
+ pkg_search_module(MOZJS mozjs-60)
if(MOZJS_FOUND)
include_directories(${MOZJS_INCLUDE_DIRS})
link_directories(${MOZJS_LIBRARY_DIRS})

View File

@ -0,0 +1,180 @@
From 6c9e48accddb90eef8412bef3ccc29594935d3b3 Mon Sep 17 00:00:00 2001
From: Iain Lane <iain@orangesquash.org.uk>
Date: Wed, 11 Mar 2020 11:54:52 +0000
Subject: [PATCH] mozjs: Port to mozjs 68
There are a number of API changes that need to be adapted to, notably
- JS_EncodeString is gone; need to use JS_EncodeStringToUTF8 now which
requires a rooted object to be passed in.
- JS_free is gone
The pkg-config file ships some flags which need to be supplied to the
build.
---
libproxy/cmake/modules/pacrunner_mozjs.cmk | 6 ++-
libproxy/modules/pacrunner_mozjs.cpp | 56 ++++++++++++++--------
2 files changed, 41 insertions(+), 21 deletions(-)
diff --git a/libproxy/cmake/modules/pacrunner_mozjs.cmk b/libproxy/cmake/modules/pacrunner_mozjs.cmk
index 871cc85..2cc3c51 100644
--- a/libproxy/cmake/modules/pacrunner_mozjs.cmk
+++ b/libproxy/cmake/modules/pacrunner_mozjs.cmk
@@ -9,8 +9,12 @@ if(WIN32)
elseif(NOT APPLE)
option(WITH_MOZJS "Search for MOZJS package" ON)
if (WITH_MOZJS)
- pkg_search_module(MOZJS mozjs-60)
+ pkg_search_module(MOZJS mozjs-68)
if(MOZJS_FOUND)
+ foreach(OPT ${MOZJS_CFLAGS})
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OPT}")
+ endforeach()
+ message("mozjs is " ${CMAKE_CXX_FLAGS})
include_directories(${MOZJS_INCLUDE_DIRS})
link_directories(${MOZJS_LIBRARY_DIRS})
else()
diff --git a/libproxy/modules/pacrunner_mozjs.cpp b/libproxy/modules/pacrunner_mozjs.cpp
index 38e7d46..37e1b42 100644
--- a/libproxy/modules/pacrunner_mozjs.cpp
+++ b/libproxy/modules/pacrunner_mozjs.cpp
@@ -37,6 +37,9 @@ using namespace libproxy;
#pragma GCC diagnostic error "-Winvalid-offsetof"
#include <js/Initialization.h>
#include <js/CallArgs.h>
+#include <js/CompilationAndEvaluation.h>
+#include <js/MemoryFunctions.h>
+#include <js/SourceText.h>
#include "pacutils.h"
@@ -49,19 +52,21 @@ using namespace libproxy;
#endif
static void dnsResolve_(JSContext *cx, JSString *hostname, JS::CallArgs *argv) {
+ char *tmp;
// Get hostname argument
- char *tmp = JS_EncodeString(cx, hostname);
+ JS::RootedString str(cx, hostname);
+ JS::UniqueChars chars = JS_EncodeStringToUTF8(cx, str);
+ const char *val = chars.get();
// Set the default return value
argv->rval().setNull();
// Look it up
struct addrinfo *info = nullptr;
- if (getaddrinfo(tmp, NULL, NULL, &info))
+ if (getaddrinfo(val, NULL, NULL, &info))
goto out;
// Allocate the IP address
- JS_free(cx, tmp);
tmp = (char *) JS_malloc(cx, INET6_ADDRSTRLEN+1);
memset(tmp, 0, INET6_ADDRSTRLEN+1);
@@ -77,7 +82,6 @@ static void dnsResolve_(JSContext *cx, JSString *hostname, JS::CallArgs *argv) {
out:
if (info) freeaddrinfo(info);
- JS_free(cx, tmp);
}
static bool dnsResolve(JSContext *cx, unsigned argc, JS::Value *vp) {
@@ -121,29 +125,40 @@ class mozjs_pacrunner : public pacrunner {
if (!JS::InitSelfHostedCode(this->jsctx)) goto error;
JS::RootedValue rval(this->jsctx);
- JS::CompartmentOptions compart_opts;
+ JS::RealmOptions realm_opts;
this->jsglb = new JS::Heap<JSObject*>(JS_NewGlobalObject(
this->jsctx, &cls,
nullptr, JS::DontFireOnNewGlobalHook,
- compart_opts));
+ realm_opts));
if (!(this->jsglb)) goto error;
JS::RootedObject global(this->jsctx,this->jsglb->get());
- if (!(this->jsac = new JSAutoCompartment(this->jsctx, global))) goto error;
- if (!JS_InitStandardClasses(this->jsctx, global)) goto error;
+ if (!(this->jsar = new JSAutoRealm(this->jsctx, global))) goto error;
// Define Javascript functions
JS_DefineFunction(this->jsctx, global, "dnsResolve", dnsResolve, 1, 0);
JS_DefineFunction(this->jsctx, global, "myIpAddress", myIpAddress, 0, 0);
JS::CompileOptions options(this->jsctx);
- options.setUTF8(true);
- JS::Evaluate(this->jsctx, options, JAVASCRIPT_ROUTINES,
- strlen(JAVASCRIPT_ROUTINES), JS::MutableHandleValue(&rval));
+ JS::SourceText<mozilla::Utf8Unit> routines, pac_source;
+ if (!routines.init(this->jsctx,
+ JAVASCRIPT_ROUTINES,
+ strlen(JAVASCRIPT_ROUTINES),
+ JS::SourceOwnership::Borrowed))
+ goto error;
+
+ if (!pac_source.init(this->jsctx,
+ pac.c_str(),
+ pac.length(),
+ JS::SourceOwnership::Borrowed))
+ goto error;
+
+
+ JS::Evaluate(this->jsctx, options, routines, JS::MutableHandleValue(&rval));
// Add PAC to the environment
- JS::Evaluate(this->jsctx, options, pac.c_str(), pac.length(), JS::MutableHandleValue(&rval));
+ JS::Evaluate(this->jsctx, options, pac_source, JS::MutableHandleValue(&rval));
return;
}
error:
@@ -152,7 +167,7 @@ class mozjs_pacrunner : public pacrunner {
}
~mozjs_pacrunner() {
- if (this->jsac) delete this->jsac;
+ if (this->jsar) delete this->jsar;
if (this->jsglb) delete this->jsglb;
if (this->jsctx) JS_DestroyContext(this->jsctx);
JS_ShutDown();
@@ -160,11 +175,9 @@ class mozjs_pacrunner : public pacrunner {
string run(const url& url_) throw (bad_alloc) {
// Build arguments to the FindProxyForURL() function
- char *tmpurl = JS_strdup(this->jsctx, url_.to_string().c_str());
- char *tmphost = JS_strdup(this->jsctx, url_.get_host().c_str());
+ const char *tmpurl = url_.to_string().c_str();
+ const char *tmphost = url_.get_host().c_str();
if (!tmpurl || !tmphost) {
- if (tmpurl) JS_free(this->jsctx, tmpurl);
- if (tmphost) JS_free(this->jsctx, tmphost);
throw bad_alloc();
}
JS::AutoValueArray<2> args(this->jsctx);
@@ -176,10 +189,13 @@ 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 "";
+ if (!rval.isString())
+ return "";
- char * tmpanswer = JS_EncodeString(this->jsctx, rval.toString());
+ JS::RootedString s(this->jsctx, rval.toString());
+ JS::UniqueChars chars = JS_EncodeStringToUTF8(this->jsctx, s);
+ const char *tmpanswer = chars.get();
string answer = string(tmpanswer);
- JS_free(this->jsctx, tmpanswer);
if (answer == "undefined") return "";
return answer;
@@ -188,7 +204,7 @@ class mozjs_pacrunner : public pacrunner {
private:
JSContext *jsctx;
JS::Heap<JSObject*> *jsglb;
- JSAutoCompartment *jsac;
+ JSAutoRealm *jsar;
};
PX_PACRUNNER_MODULE_EZ(mozjs, "JS_DefineFunction", "mozjs");

View File

@ -0,0 +1,26 @@
From 2d6da65598b90480b4a62c4633eda035ea51681f Mon Sep 17 00:00:00 2001
From: David King <amigadave@amigadave.com>
Date: Wed, 27 Jun 2018 06:36:00 +0100
Subject: [PATCH] python: support Python 3.7 and 3.8
Add 3.7 and 3.8 to the list of accepted Python 3 versions.
---
cmake/FindPython3Interp.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/FindPython3Interp.cmake b/cmake/FindPython3Interp.cmake
index c6cbe3d..8e5e409 100644
--- a/cmake/FindPython3Interp.cmake
+++ b/cmake/FindPython3Interp.cmake
@@ -39,7 +39,7 @@
unset(_Python3_NAMES)
-set(_Python3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+set(_Python3_VERSIONS 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)
--
2.17.1

View File

@ -0,0 +1,26 @@
From 869307ba7547cadef4a131581c3afdcaaec8c576 Mon Sep 17 00:00:00 2001
From: David King <amigadave@amigadave.com>
Date: Thu, 13 Feb 2020 12:24:17 +0000
Subject: [PATCH] python: support Python 3.9
Add 3.9 to the list of accepted Python 3 versions.
---
cmake/FindPython3Interp.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/FindPython3Interp.cmake b/cmake/FindPython3Interp.cmake
index 8e5e409..74398b2 100644
--- a/cmake/FindPython3Interp.cmake
+++ b/cmake/FindPython3Interp.cmake
@@ -39,7 +39,7 @@
unset(_Python3_NAMES)
-set(_Python3_VERSIONS 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
+set(_Python3_VERSIONS 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)
--
2.24.1

View File

@ -4,41 +4,52 @@
Name: libproxy
Version: 0.4.15
Release: 5.5%{?dist}
Release: 35%{?dist}
Summary: A library handling all the details of proxy configuration
Group: System Environment/Libraries
License: LGPLv2+
URL: https://libproxy.github.io/libproxy/
Source0: https://github.com/libproxy/%{name}/archive/%{version}.tar.gz
# Taken from the Debian package.
Source1: proxy.1
Source2: Copyright.txt
Patch1: libproxy-0.4.11-crash.patch
Patch2: libproxy-0.4.15-python3738.patch
# https://github.com/libproxy/libproxy/pull/86
# https://github.com/libproxy/libproxy/pull/87
Patch3: libproxy-0.4.15-mozjs52.patch
# https://github.com/libproxy/libproxy/pull/95
Patch4: libproxy-0.4.15-mozjs60.patch
# https://github.com/libproxy/libproxy/pull/106
Patch5: libproxy-0.4.15-python39.patch
# https://github.com/libproxy/libproxy/pull/109
Patch6: libproxy-0.4.15-mozjs68.patch
# https://github.com/libproxy/libproxy/pull/118
Patch7: libproxy-0.4.15-mozjs-use-after-free.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1880350
Patch2: libproxy-0.4.15-fix-CVE-2020-25219.patch
Patch8: libproxy-0.4.15-fix-CVE-2020-25219.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1883584
Patch3: libproxy-0.4.15-fix-pac-buffer-overflow.patch
Patch9: libproxy-0.4.15-fix-pac-buffer-overflow.patch
BuildRequires: libmodman-devel >= 2.0.1
BuildRequires: cmake >= 2.6.0
BuildRequires: gcc-c++
%if ! 0%{?bootstrap}
# gnome
BuildRequires: pkgconfig(gio-2.0) >= 2.26
# NetworkManager
BuildRequires: pkgconfig(libnm)
BuildRequires: pkgconfig(dbus-1)
# webkit (gtk3)
BuildRequires: pkgconfig(javascriptcoregtk-4.0)
# Python
BuildRequires: python3-devel
%else
# Obsoletes of disabled subpackages.
Provides: %{name}-mozjs = %{version}-%{release}
Obsoletes: %{name}-mozjs < %{version}-%{release}
Provides: %{name}-webkitgtk4 = %{version}-%{release}
Obsoletes: %{name}-webkitgtk4 < %{version}-%{release}
%endif
# The Python 2 subpackage was removed. Remove in F32.
Obsoletes: python2-libproxy < %{version}-%{release}
%description
@ -55,7 +66,6 @@ libproxy offers the following features:
%package bin
Summary: Binary to test %{name}
Group: Applications/System
Requires: %{name}%{?_isa} = %{version}-%{release}
%description bin
@ -64,7 +74,6 @@ The %{name}-bin package contains the proxy binary for %{name}
%if ! 0%{?bootstrap}
%package -n python3-%{name}
Summary: Binding for %{name} and python3
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%{?python_provide:%python_provide python3-%{name}}
@ -74,36 +83,35 @@ The python3 binding for %{name}
%package gnome
Summary: Plugin for %{name} and gnome
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description gnome
The %{name}-gnome package contains the %{name} plugin for gnome.
%package networkmanager
Summary: Plugin for %{name} and networkmanager
Group: System Environment/Libraries
%if 0%{?fedora}
%package kde
Summary: Plugin for %{name} and kde
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: /usr/bin/kreadconfig5
%description networkmanager
The %{name}-networkmanager package contains the %{name} plugin
for networkmanager.
%description kde
The %{name}-kde package contains the %{name} plugin for kde.
%endif
%package webkitgtk4
Summary: Plugin for %{name} and webkitgtk3
Group: System Environment/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
Provides: %{name}-pac = %{version}-%{release}
Obsoletes: %{name}-mozjs <= %{version}-%{release}
%description webkitgtk4
The %{name}-webkitgtk4 package contains the %{name} plugin for
webkitgtk3.
%endif
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
@ -115,26 +123,32 @@ developing applications that use %{name}.
%build
export CXXFLAGS="-std=c++14 $RPM_OPT_FLAGS"
%{cmake} \
-DMODULE_INSTALL_DIR=%{_libdir}/%{name}/%{version}/modules \
-DWITH_PERL=OFF \
-DWITH_PYTHON2=OFF \
-DBIPR=OFF \
%if 0%{?fedora}
-DWITH_KDE=ON \
%else
-DWITH_KDE=OFF \
%endif
-DWITH_MOZJS=OFF \
-DBIPR=0 \
-DWITH_PERL=OFF \
%if ! 0%{?bootstrap}
-DWITH_GNOME3=ON \
-DWITH_PYTHON2=OFF \
-DWITH_PYTHON3=ON \
-DWITH_WEBKIT3=ON \
%else
-DWITH_PYTHON2=OFF \
-DWITH_PYTHON3=OFF \
%endif
.
%make_build
%cmake_build
%install
%make_install INSTALL="install -p"
%cmake_install
#In case all modules are disabled
mkdir -p %{buildroot}%{_libdir}/%{name}/%{version}/modules
@ -142,18 +156,19 @@ mkdir -p %{buildroot}%{_libdir}/%{name}/%{version}/modules
# Man page.
install -Dpm 0644 %{SOURCE1} %{buildroot}/%{_mandir}/man1/proxy.1
# CMake license (for FindPython[2,3]Interp.cmake)
install -Dpm 0644 %{SOURCE2} %{buildroot}%{_datadir}/licenses/libproxy/Copyright.txt
%check
make test
%ctest
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%ldconfig_scriptlets
%files
%doc AUTHORS README
%license COPYING
%license Copyright.txt
%{_libdir}/*.so.*
%dir %{_libdir}/%{name}
%dir %{_libdir}/%{name}/%{version}
@ -172,8 +187,10 @@ make test
%{_libdir}/%{name}/%{version}/modules/config_gnome3.so
%{_libexecdir}/pxgsettings
%files networkmanager
%{_libdir}/%{name}/%{version}/modules/network_networkmanager.so
%if 0%{?fedora}
%files kde
%{_libdir}/%{name}/%{version}/modules/config_kde.so
%endif
%files webkitgtk4
%{_libdir}/%{name}/%{version}/modules/pacrunner_webkit.so
@ -187,23 +204,104 @@ make test
%changelog
* Thu Aug 15 2024 Michael Santana <msantana@redhat.com> - 0.4.15-5.5
- Bump up version number
* Wed Aug 25 2021 Michael Santana <msantana@redhat.com> - 0.4.15-35
- Drop networkmanager subpackage. Resolves: rhbz#1996028
* Tue Jul 30 2024 Michael Santana <msantana@redhat.com> - 0.4.15-5.4
- Fix PAC buffer overflow (#1869639)
* Wed Aug 18 2021 Michael Santana <msantana@redhat.com> - 0.4.15-34
- Drop pacrunner subpackage. Resolves: rhbz#1990974
* Tue Jul 30 2024 Michael Santana <msantana@redhat.com> - 0.4.15-5.3
- Fix CVE-2020-25219 (#1880349)
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.4.15-33
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Thu May 31 2018 Dan Winship <danw@redhat.com> - 0.4.15-5.2
- Drop pacrunner-mozjs (#1571640)
* Tue Jul 27 2021 Michael Santana <msantana@redhat.com> - 0.4.15-32
- Add Copyright.txt. Resolves: rhbz#1986586
* Wed May 30 2018 Dan Winship <danw@redhat.com> - 0.4.15-5.1
- Drop python2 subpackage (#1559092)
- Drop PAC runner based on the "pacrunner" package (#1569023)
- Replace pacrunner-crash-fix patch with version from RHEL7
- Drop kde subpackage (#1538147)
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 0.4.15-31
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-30
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Nov 30 2020 David King <amigadave@amigadave.com> - 0.4.15-29
- Tweak KDE conditionals to only apply at runtime
* Mon Nov 30 2020 David King <amigadave@amigadave.com> - 0.4.15-28
- Depend on KDE only on Fedora (#1902608)
* Tue Oct 06 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 0.4.15-27
- Disable mozjs backend by default, obsolete it by webkit subpackage
* Tue Sep 29 2020 David King <amigadave@amigadave.com> - 0.4.15-26
- Fix PAC buffer overflow (#1883584)
* Fri Sep 18 2020 David King <amigadave@amigadave.com> - 0.4.15-25
- Fix CVE-2020-25219 (#1880350)
* Tue Aug 18 2020 Jeff Law <law@redhat.com> - 0.4.15-24
- Force C++14 as this code is not C++17 ready
* Tue Aug 04 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 0.4.15-23
- build with mozjs68
- backport use after free fix for mozjs backend
* Tue Aug 04 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 0.4.15-22
- Fix build by switching to cmake macros instead of make
* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-21
- Second attempt - Rebuilt for
https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.4.15-19
- Rebuilt for Python 3.9
* Thu Feb 13 2020 David King <amigadave@amigadave.com> - 0.4.15-18
- Fix build against Python 3.9 (#1791942)
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.15-16
- Rebuilt for Python 3.8.0rc1 (#1748018)
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.4.15-15
- Rebuilt for Python 3.8
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 08 2019 Kalev Lember <klember@redhat.com> - 0.4.15-13
- Build with mozjs60
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Thu Nov 22 2018 David King <amigadave@amigadave.com> - 0.4.15-11
- Add Obsoletes on old Python 2 subpackage (#1634211)
* Thu Sep 20 2018 David King <amigadave@amigadave.com> - 0.4.15-10
- Remove Python 2 subpackage (#1631331)
* Sun Aug 26 2018 Peter Robinson <pbrobinson@fedoraproject.org> 0.4.15-9
- Add patch and build against mozjs 52
* Fri Jul 20 2018 David King <amigadave@amigadave.com> - 0.4.15-8
- Provide direct path to Python 2 (#1604646)
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.4.15-7
- Rebuilt for Python 3.7
* Fri May 04 2018 David King <amigadave@amigadave.com> - 0.4.15-6
- Resurrect an old patch (#1459779)
- Add BuildRequires on gcc-c++
- Switch to %%ldconfig_scriptlets
- Remove obsolete Group tags
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.15-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild