Gentoo Archives: gentoo-commits

From: Sven Wegener <swegener@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-dns/pdns-recursor/, net-dns/pdns-recursor/files/
Date: Wed, 20 May 2020 21:32:57
Message-Id: 1590010302.04738da286478377dba8c13b33f7a470698a3d84.swegener@gentoo
1 commit: 04738da286478377dba8c13b33f7a470698a3d84
2 Author: Sven Wegener <swegener <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 20 21:27:05 2020 +0000
4 Commit: Sven Wegener <swegener <AT> gentoo <DOT> org>
5 CommitDate: Wed May 20 21:31:42 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=04738da2
7
8 net-dns/pdns-recursor: Fix building with boost-1.73, bug #719926
9
10 Closes: https://bugs.gentoo.org/719926
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Sven Wegener <swegener <AT> gentoo.org>
13
14 .../files/pdns-recursor-4.3.1-boost-1.73.0.patch | 89 ++++++++++++++++++++++
15 net-dns/pdns-recursor/pdns-recursor-4.3.1.ebuild | 4 +
16 2 files changed, 93 insertions(+)
17
18 diff --git a/net-dns/pdns-recursor/files/pdns-recursor-4.3.1-boost-1.73.0.patch b/net-dns/pdns-recursor/files/pdns-recursor-4.3.1-boost-1.73.0.patch
19 new file mode 100644
20 index 00000000000..02b8df751ef
21 --- /dev/null
22 +++ b/net-dns/pdns-recursor/files/pdns-recursor-4.3.1-boost-1.73.0.patch
23 @@ -0,0 +1,89 @@
24 +From 71246536642590e8e8b21c11307ec4bd0e165066 Mon Sep 17 00:00:00 2001
25 +From: Remi Gacogne <remi.gacogne@××××××××.com>
26 +Date: Tue, 28 Apr 2020 17:51:47 +0200
27 +Subject: [PATCH] Replace boost's placeholders with the ones from the std
28 + namespace
29 +
30 +Boost 1.73 moved boost::bind placeholders to the placeholders
31 +namespace which did not exist before 1.60, let's switch to
32 +std::bind and std::placeholders instead of doing per-version handling.
33 +---
34 + pdns/ixfrdist-web.cc | 2 +-
35 + pdns/webserver.cc | 6 +++---
36 + pdns/ws-auth.cc | 4 ++--
37 + pdns/ws-recursor.cc | 12 ++++++------
38 + 4 files changed, 12 insertions(+), 12 deletions(-)
39 +
40 +diff --git a/webserver.cc b/webserver.cc
41 +index eafd3059a0..b47cc6d7e0 100644
42 +--- a/webserver.cc
43 ++++ b/webserver.cc
44 +@@ -107,7 +107,7 @@ static void bareHandlerWrapper(WebServer::HandlerFunction handler, YaHTTP::Reque
45 +
46 + void WebServer::registerBareHandler(const string& url, HandlerFunction handler)
47 + {
48 +- YaHTTP::THandlerFunction f = boost::bind(&bareHandlerWrapper, handler, _1, _2);
49 ++ YaHTTP::THandlerFunction f = std::bind(&bareHandlerWrapper, handler, std::placeholders::_1, std::placeholders::_2);
50 + YaHTTP::Router::Any(url, f);
51 + }
52 +
53 +@@ -179,7 +179,7 @@ void WebServer::apiWrapper(WebServer::HandlerFunction handler, HttpRequest* req,
54 + }
55 +
56 + void WebServer::registerApiHandler(const string& url, HandlerFunction handler, bool allowPassword) {
57 +- HandlerFunction f = boost::bind(&WebServer::apiWrapper, this, handler, _1, _2, allowPassword);
58 ++ HandlerFunction f = std::bind(&WebServer::apiWrapper, this, handler, std::placeholders::_1, std::placeholders::_2, allowPassword);
59 + registerBareHandler(url, f);
60 + }
61 +
62 +@@ -196,7 +196,7 @@ void WebServer::webWrapper(WebServer::HandlerFunction handler, HttpRequest* req,
63 + }
64 +
65 + void WebServer::registerWebHandler(const string& url, HandlerFunction handler) {
66 +- HandlerFunction f = boost::bind(&WebServer::webWrapper, this, handler, _1, _2);
67 ++ HandlerFunction f = std::bind(&WebServer::webWrapper, this, handler, std::placeholders::_1, std::placeholders::_2);
68 + registerBareHandler(url, f);
69 + }
70 +
71 +diff --git a/ws-recursor.cc b/ws-recursor.cc
72 +index cd8997309f..a074460c2f 100644
73 +--- a/ws-recursor.cc
74 ++++ b/ws-recursor.cc
75 +@@ -382,9 +382,9 @@ static void apiServerCacheFlush(HttpRequest* req, HttpResponse* resp) {
76 + DNSName canon = apiNameToDNSName(req->getvars["domain"]);
77 + bool subtree = (req->getvars.count("subtree") > 0 && req->getvars["subtree"].compare("true") == 0);
78 +
79 +- int count = broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeCache, canon, subtree));
80 +- count += broadcastAccFunction<uint64_t>(boost::bind(pleaseWipePacketCache, canon, subtree));
81 +- count += broadcastAccFunction<uint64_t>(boost::bind(pleaseWipeAndCountNegCache, canon, subtree));
82 ++ int count = broadcastAccFunction<uint64_t>(std::bind(pleaseWipeCache, canon, subtree));
83 ++ count += broadcastAccFunction<uint64_t>(std::bind(pleaseWipePacketCache, canon, subtree));
84 ++ count += broadcastAccFunction<uint64_t>(std::bind(pleaseWipeAndCountNegCache, canon, subtree));
85 + resp->setBody(Json::object {
86 + { "count", count },
87 + { "result", "Flushed cache." }
88 +@@ -512,7 +512,7 @@ RecursorWebServer::RecursorWebServer(FDMultiplexer* fdm)
89 + d_ws->bind();
90 +
91 + // legacy dispatch
92 +- d_ws->registerApiHandler("/jsonstat", boost::bind(&RecursorWebServer::jsonstat, this, _1, _2), true);
93 ++ d_ws->registerApiHandler("/jsonstat", std::bind(&RecursorWebServer::jsonstat, this, std::placeholders::_1, std::placeholders::_2), true);
94 + d_ws->registerApiHandler("/api/v1/servers/localhost/cache/flush", &apiServerCacheFlush);
95 + d_ws->registerApiHandler("/api/v1/servers/localhost/config/allow-from", &apiServerConfigAllowFrom);
96 + d_ws->registerApiHandler("/api/v1/servers/localhost/config", &apiServerConfig);
97 +@@ -664,7 +664,7 @@ void AsyncServerNewConnectionMT(void *p) {
98 + void AsyncServer::asyncWaitForConnections(FDMultiplexer* fdm, const newconnectioncb_t& callback)
99 + {
100 + d_asyncNewConnectionCallback = callback;
101 +- fdm->addReadFD(d_server_socket.getHandle(), boost::bind(&AsyncServer::newConnection, this));
102 ++ fdm->addReadFD(d_server_socket.getHandle(), std::bind(&AsyncServer::newConnection, this));
103 + }
104 +
105 + void AsyncServer::newConnection()
106 +@@ -743,5 +743,5 @@ void AsyncWebServer::go() {
107 + auto server = std::dynamic_pointer_cast<AsyncServer>(d_server);
108 + if (!server)
109 + return;
110 +- server->asyncWaitForConnections(d_fdm, boost::bind(&AsyncWebServer::serveConnection, this, _1));
111 ++ server->asyncWaitForConnections(d_fdm, std::bind(&AsyncWebServer::serveConnection, this, std::placeholders::_1));
112 + }
113
114 diff --git a/net-dns/pdns-recursor/pdns-recursor-4.3.1.ebuild b/net-dns/pdns-recursor/pdns-recursor-4.3.1.ebuild
115 index fa5437a3d38..76d5e9e950d 100644
116 --- a/net-dns/pdns-recursor/pdns-recursor-4.3.1.ebuild
117 +++ b/net-dns/pdns-recursor/pdns-recursor-4.3.1.ebuild
118 @@ -34,6 +34,10 @@ BDEPEND="virtual/pkgconfig"
119
120 S="${WORKDIR}"/${P/_/-}
121
122 +PATCHES=(
123 + "${FILESDIR}"/${P}-boost-1.73.0.patch
124 +)
125 +
126 pkg_setup() {
127 filter-flags -ftree-vectorize
128 }