commit:     0947131eabed1130003372fc4039c89b0fe2f103
Author:     Johannes Huber <johu <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 23 12:19:58 2019 +0000
Commit:     Johannes Huber <johu <AT> gentoo <DOT> org>
CommitDate: Sun Jun 23 12:20:37 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0947131e

x11-misc/polybar: Fix build w/ gcc-9

Closes: https://bugs.gentoo.org/686994
Thanks-to: Ivan Bagaev <gmiramir <AT> gmail.com>
Package-Manager: Portage-2.3.67, Repoman-2.3.15
Signed-off-by: Johannes Huber <johu <AT> gentoo.org>

 x11-misc/polybar/files/polybar-3.3.1-gcc9.patch    | 43 ++++++++++++++++++++++
 .../polybar/files/polybar-3.3.1-i3ipcpp-gcc9.patch | 29 +++++++++++++++
 .../polybar/files/polybar-3.3.1-xpp-gcc9.patch     | 23 ++++++++++++
 x11-misc/polybar/polybar-3.3.1.ebuild              |  7 +++-
 4 files changed, 101 insertions(+), 1 deletion(-)

diff --git a/x11-misc/polybar/files/polybar-3.3.1-gcc9.patch 
b/x11-misc/polybar/files/polybar-3.3.1-gcc9.patch
new file mode 100644
index 00000000000..7df7b99fa65
--- /dev/null
+++ b/x11-misc/polybar/files/polybar-3.3.1-gcc9.patch
@@ -0,0 +1,43 @@
+From 8b648b9265ed6f09802bd749ec8bf74181032b39 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=B4me=20BOULMIER?= <jerome.boulm...@outlook.fr>
+Date: Sun, 7 Apr 2019 02:10:38 -0400
+Subject: [PATCH] fix(window): remove useless operator= and add default copy
+ cstr
+
+---
+ include/x11/window.hpp | 3 +--
+ src/x11/window.cpp     | 5 -----
+ 2 files changed, 1 insertion(+), 7 deletions(-)
+
+diff --git a/include/x11/window.hpp b/include/x11/window.hpp
+index 9490c3760..9ddfe9f45 100644
+--- a/include/x11/window.hpp
++++ b/include/x11/window.hpp
+@@ -12,10 +12,9 @@ class connection;
+ 
+ class window : public xpp::window<connection&> {
+  public:
++  window(const window&) = default;
+   using xpp::window<class connection&>::window;
+ 
+-  window& operator=(const xcb_window_t win);
+-
+   window reconfigure_geom(unsigned short int w, unsigned short int h, short 
int x = 0, short int y = 0);
+   window reconfigure_pos(short int x, short int y);
+   window reconfigure_struts(unsigned short int w, unsigned short int h, short 
int x, bool bottom = false);
+diff --git a/src/x11/window.cpp b/src/x11/window.cpp
+index e22e4451e..35393ddc8 100644
+--- a/src/x11/window.cpp
++++ b/src/x11/window.cpp
+@@ -7,11 +7,6 @@
+ 
+ POLYBAR_NS
+ 
+-window& window::operator=(const xcb_window_t win) {
+-  resource(connection(), win);
+-  return *this;
+-}
+-
+ /**
+  * Reconfigure the window geometry
+  */

diff --git a/x11-misc/polybar/files/polybar-3.3.1-i3ipcpp-gcc9.patch 
b/x11-misc/polybar/files/polybar-3.3.1-i3ipcpp-gcc9.patch
new file mode 100644
index 00000000000..beb0461885b
--- /dev/null
+++ b/x11-misc/polybar/files/polybar-3.3.1-i3ipcpp-gcc9.patch
@@ -0,0 +1,29 @@
+From d4e4786be35b48d72dc7e59cf85ec34a90d129b5 Mon Sep 17 00:00:00 2001
+From: patrick96 <p.ziegle...@gmail.com>
+Date: Sun, 6 May 2018 18:25:32 +0200
+Subject: [PATCH] fix(gcc): Fix -Wstringop-truncation warning
+
+As mentioned in [1], gcc >=8 will complain, if strncpy truncates the
+source string or gcc can prove there is no NUL terminating byte.
+
+The header_t.magic field is a non-NUL terminated 6 byte string, so we
+use memcpy here
+
+[1] https://github.com/jaagr/polybar/issues/1215
+---
+ src/ipc-util.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/ipc-util.cpp b/src/ipc-util.cpp
+index 2e8ac8e..d9851ee 100644
+--- a/lib/i3ipcpp/src/ipc-util.cpp
++++ b/lib/i3ipcpp/src/ipc-util.cpp
+@@ -34,7 +34,7 @@ buf_t::buf_t(uint32_t  payload_size) : size(sizeof(header_t) 
+ payload_size) {
+       data = new uint8_t[size];
+       header = (header_t*)data;
+       payload = (char*)(data + sizeof(header_t));
+-      strncpy(header->magic, g_i3_ipc_magic.c_str(), sizeof(header->magic));
++      memcpy(header->magic, g_i3_ipc_magic.c_str(), sizeof(header->magic));
+       header->size = payload_size;
+       header->type = 0x0;
+ }

diff --git a/x11-misc/polybar/files/polybar-3.3.1-xpp-gcc9.patch 
b/x11-misc/polybar/files/polybar-3.3.1-xpp-gcc9.patch
new file mode 100644
index 00000000000..f80a72f1279
--- /dev/null
+++ b/x11-misc/polybar/files/polybar-3.3.1-xpp-gcc9.patch
@@ -0,0 +1,23 @@
+From d2ff2aaba6489f606bbcc090c0a78a8a3f9fcd1f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=A9r=C3=B4me=20BOULMIER?= <jerome.boulm...@outlook.fr>
+Date: Sun, 7 Apr 2019 10:34:32 -0400
+Subject: [PATCH] fix(window): add default copy cstr (#16)
+
+The copy constructor must be declared explicitly since the implicit 
declaration is deprecated.
+Ref jaagr/polybar#1729.
+---
+ include/xpp/window.hpp | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/include/xpp/window.hpp b/include/xpp/window.hpp
+index e5c6503..3e53074 100644
+--- a/lib/xpp/include/xpp/window.hpp
++++ b/lib/xpp/include/xpp/window.hpp
+@@ -23,6 +23,7 @@ class window
+     {}
+ 
+   public:
++    window(const window&) = default;
+     using base::base;
+     using base::operator=;
+ 

diff --git a/x11-misc/polybar/polybar-3.3.1.ebuild 
b/x11-misc/polybar/polybar-3.3.1.ebuild
index ec73759fe76..304f98fa0c1 100644
--- a/x11-misc/polybar/polybar-3.3.1.ebuild
+++ b/x11-misc/polybar/polybar-3.3.1.ebuild
@@ -46,7 +46,12 @@ DEPEND="
 
 RDEPEND="${DEPEND}"
 
-PATCHES=( "${FILESDIR}/${P}-eventstruct.patch" )
+PATCHES=(
+       "${FILESDIR}/${P}-eventstruct.patch"
+       "${FILESDIR}/${P}-gcc9.patch"
+       "${FILESDIR}/${P}-xpp-gcc9.patch"
+       "${FILESDIR}/${P}-i3ipcpp-gcc9.patch"
+)
 
 src_prepare() {
        if [[ ${PV} != *9999* ]]; then

Reply via email to