commit:     eb13aa137fcda3e70a82a877aef671a9c7860634
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 11 09:22:26 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sun Oct 11 09:22:26 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb13aa13

net-libs/libproxy: fix build on c++17 compiler (gcc-11)

Closes: https://bugs.gentoo.org/732700
Package-Manager: Portage-3.0.8, Repoman-3.0.1
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../libproxy/files/libproxy-0.4.15-gcc-11.patch    | 118 +++++++++++++++++++++
 net-libs/libproxy/libproxy-0.4.15-r2.ebuild        |  86 +++++++++++++++
 2 files changed, 204 insertions(+)

diff --git a/net-libs/libproxy/files/libproxy-0.4.15-gcc-11.patch 
b/net-libs/libproxy/files/libproxy-0.4.15-gcc-11.patch
new file mode 100644
index 00000000000..2d40a6c1600
--- /dev/null
+++ b/net-libs/libproxy/files/libproxy-0.4.15-gcc-11.patch
@@ -0,0 +1,118 @@
+https://bugs.gentoo.org/732700
+https://github.com/libproxy/libproxy/issues/127
+
+--- a/libproxy/extension_config.hpp
++++ b/libproxy/extension_config.hpp
+@@ -31,7 +31,7 @@ using namespace libmodman;
+ class DLL_PUBLIC config_extension : public extension<config_extension> {
+ public:
+       // Abstract methods
+-      virtual vector<url>      get_config(const url &dst) throw 
(runtime_error)=0;
++      virtual vector<url>      get_config(const url &dst)=0;
+ 
+       // Virtual methods
+       virtual string   get_ignore(const url &dst);
+--- a/libproxy/extension_pacrunner.cpp
++++ b/libproxy/extension_pacrunner.cpp
+@@ -30,7 +30,7 @@ pacrunner_extension::~pacrunner_extension() {
+       if (this->pr) delete this->pr;
+ }
+ 
+-pacrunner* pacrunner_extension::get(string pac, const url& pacurl) throw 
(bad_alloc) {
++pacrunner* pacrunner_extension::get(string pac, const url& pacurl) {
+       if (this->pr) {
+               if (this->last == pac)
+                       return this->pr;
+--- a/libproxy/extension_pacrunner.hpp
++++ b/libproxy/extension_pacrunner.hpp
+@@ -26,7 +26,7 @@
+ #define PX_PACRUNNER_MODULE_EZ(name, symb, smod) \
+       class name ## _pacrunner_extension : public pacrunner_extension { \
+       protected: \
+-              virtual pacrunner* create(string pac, const url& pacurl) throw 
(bad_alloc) { \
++              virtual pacrunner* create(string pac, const url& pacurl) { \
+                       return new name ## _pacrunner(pac, pacurl); \
+               } \
+       }; \
+@@ -41,13 +41,13 @@ class DLL_PUBLIC pacrunner {
+ public:
+       pacrunner(string pac, const url& pacurl);
+       virtual ~pacrunner() {};
+-      virtual string run(const url& url) throw (bad_alloc)=0;
++      virtual string run(const url& url)=0;
+ };
+ 
+ class DLL_PUBLIC pacrunner_extension : public extension<pacrunner_extension, 
true> {
+ public:
+       // Virtual methods
+-      virtual pacrunner* get(string pac, const url& pacurl) throw (bad_alloc);
++      virtual pacrunner* get(string pac, const url& pacurl);
+       virtual ~pacrunner_extension();
+ 
+       // Final methods
+@@ -55,7 +55,7 @@ public:
+ 
+ protected:
+       // Abstract methods
+-      virtual pacrunner* create(string pac, const url& pacurl) throw 
(bad_alloc)=0;
++      virtual pacrunner* create(string pac, const url& pacurl)=0;
+ 
+ private:
+       pacrunner* pr;
+--- a/libproxy/modules/config_envvar.cpp
++++ b/libproxy/modules/config_envvar.cpp
+@@ -24,7 +24,7 @@ using namespace libproxy;
+ 
+ class envvar_config_extension : public config_extension {
+ public:
+-      vector<url> get_config(const url &dst) throw (runtime_error) {
++      vector<url> get_config(const url &dst) {
+               const char *proxy = NULL;
+                 vector<url> response;
+ 
+--- a/libproxy/modules/config_sysconfig.cpp
++++ b/libproxy/modules/config_sysconfig.cpp
+@@ -124,7 +124,7 @@ public:
+       ~sysconfig_config_extension() {
+       }
+    
+-      vector<url> get_config(const url &dst) throw (runtime_error) {
++      vector<url> get_config(const url &dst) {
+               map<string,string>::const_iterator it = 
_data.find("PROXY_ENABLED");
+               vector<url> response;
+ 
+--- a/libproxy/url.cpp
++++ b/libproxy/url.cpp
+@@ -115,7 +115,7 @@ string url::encode(const string &data, const string 
&valid_reserved) {
+       return encoded.str();
+ }
+ 
+-url::url(const string &url) throw(parse_error)
++url::url(const string &url)
+       : m_orig(url), m_port(0), m_ips(NULL) {
+       size_t idx = 0;
+       size_t hier_part_start, hier_part_end;
+@@ -298,7 +298,7 @@ url& url::operator=(const url& url) {
+       return *this;
+ }
+ 
+-url& url::operator=(string strurl) throw (parse_error) {
++url& url::operator=(string strurl) {
+       url tmp(strurl);
+       *this = tmp;
+       return *this;
+--- a/libproxy/url.hpp
++++ b/libproxy/url.hpp
+@@ -50,10 +50,10 @@ public:
+ 
+       ~url();
+       url(const url& url);
+-      url(const string& url) throw (parse_error);
++      url(const string& url);
+       bool operator==(const url& url) const;
+       url& operator=(const url& url);
+-      url& operator=(string url) throw (parse_error);
++      url& operator=(string url);
+ 
+       string   get_host()     const;
+       sockaddr const* const* get_ips(bool usedns);

diff --git a/net-libs/libproxy/libproxy-0.4.15-r2.ebuild 
b/net-libs/libproxy/libproxy-0.4.15-r2.ebuild
new file mode 100644
index 00000000000..cbec1147443
--- /dev/null
+++ b/net-libs/libproxy/libproxy-0.4.15-r2.ebuild
@@ -0,0 +1,86 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS=cmake
+inherit cmake-multilib flag-o-matic mono-env
+
+DESCRIPTION="Library for automatic proxy configuration management"
+HOMEPAGE="https://github.com/libproxy/libproxy";
+SRC_URI="https://github.com/libproxy/libproxy/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 
~amd64-linux ~x86-linux ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="gnome kde mono networkmanager spidermonkey test webkit"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+       virtual/pkgconfig
+"
+DEPEND="
+       gnome? ( dev-libs/glib:2[${MULTILIB_USEDEP}] )
+       mono? ( dev-lang/mono )
+       networkmanager? ( sys-apps/dbus:0[${MULTILIB_USEDEP}] )
+       spidermonkey? ( >=dev-lang/spidermonkey-52.0.0:= )
+       webkit? ( net-libs/webkit-gtk:4 )
+"
+RDEPEND="${DEPEND}
+       kde? ( kde-frameworks/kconfig:5 )
+"
+# avoid dependency loop, bug #467696
+PDEPEND="networkmanager? ( net-misc/networkmanager )"
+
+PATCHES=(
+       # get-pac-test freezes when run by the ebuild, succeeds when building
+       # manually; virtualx.eclass doesn't help :(
+       "${FILESDIR}/${PN}-0.4.10-disable-pac-test.patch"
+
+       # https://github.com/libproxy/libproxy/issues/27
+       "${FILESDIR}/${PN}-0.4.12-macosx.patch"
+
+       # prevent dependency loop with networkmanager, libsoup, 
glib-networking; bug #467696
+       # https://github.com/libproxy/libproxy/issues/28
+       "${FILESDIR}/${P}-avoid-nm-build-dep.patch"
+
+       # backports from git master:
+       "${FILESDIR}"/${P}-python-3.7.patch # find python-3.7 and 3.8 as well
+       "${FILESDIR}"/${P}-mozjs-52-{1,2}.patch
+       "${FILESDIR}"/${P}-gcc-11.patch
+)
+
+multilib_src_configure() {
+       local mycmakeargs=(
+               -DCMAKE_C_FLAGS="${CFLAGS}"
+               -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
+               -DWITH_NATUS=OFF
+               -DWITH_PYTHON2=OFF
+               # WITH_VALA just copies the .vapi file over and needs no deps,
+               # hence always enable it unconditionally
+               -DWITH_VALA=ON
+               -DWITH_WEBKIT=OFF
+               $(multilib_is_native_abi && usex mono 
-DGMCS_EXECUTABLE="${EPREFIX}"/usr/bin/mcs)
+               -DWITH_GNOME3=$(usex gnome)
+               -DWITH_KDE=$(usex kde)
+               -DWITH_DOTNET=$(multilib_is_native_abi && usex mono || echo OFF)
+               -DWITH_NM=$(usex networkmanager)
+               -DWITH_PERL=OFF # bug 705410, uses reserved target name "test"
+               -DWITH_PYTHON3=OFF # Major issue: 
https://github.com/libproxy/libproxy/issues/65
+               -DWITH_MOZJS=$(multilib_is_native_abi && usex spidermonkey || 
echo OFF)
+               -DBUILD_TESTING=$(usex test)
+               -DWITH_WEBKIT3=$(multilib_is_native_abi && usex webkit || echo 
OFF)
+       )
+       cmake_src_configure
+}
+
+src_configure() {
+       [[ ${CHOST} == *-solaris* ]] && append-libs -lsocket -lnsl
+
+       multilib-minimal_src_configure
+}
+
+multilib_src_install_all() {
+       doman "${FILESDIR}"/proxy.1
+}

Reply via email to