x11-misc/polybar: Replace sed w/ patch
authorJohannes Huber <johu@gentoo.org>
Sun, 23 Jun 2019 11:53:47 +0000 (13:53 +0200)
committerJohannes Huber <johu@gentoo.org>
Sun, 23 Jun 2019 12:20:34 +0000 (14:20 +0200)
Package-Manager: Portage-2.3.67, Repoman-2.3.15
Signed-off-by: Johannes Huber <johu@gentoo.org>
x11-misc/polybar/files/polybar-3.3.1-eventstruct.patch [new file with mode: 0644]
x11-misc/polybar/polybar-3.3.1.ebuild
x11-misc/polybar/polybar-9999.ebuild

diff --git a/x11-misc/polybar/files/polybar-3.3.1-eventstruct.patch b/x11-misc/polybar/files/polybar-3.3.1-eventstruct.patch
new file mode 100644 (file)
index 0000000..93bf034
--- /dev/null
@@ -0,0 +1,44 @@
+From 00165e1a6d5dd61bc153e1352b21ec07fc81245d Mon Sep 17 00:00:00 2001
+From: patrick96 <p.ziegler96@gmail.com>
+Date: Sun, 11 Feb 2018 21:27:52 +0100
+Subject: [PATCH] fix(generators): Add support for eventstruct
+
+Newer xcb-proto commits after the 1.12 release require the 'eventstruct'
+key in the output dictionary, otherwise the generator crashes.
+
+I don't see a need for xpp to actually support the eventstruct key and
+thus it uses a NOP lambda function
+---
+ generators/cpp_client.py | 19 ++++++++++---------
+ 1 file changed, 10 insertions(+), 9 deletions(-)
+
+diff --git a/generators/cpp_client.py b/generators/cpp_client.py
+index 20d116f..709e8d8 100644
+--- a/lib/xpp/generators/cpp_client.py
++++ b/lib/xpp/generators/cpp_client.py
+@@ -3130,15 +3130,16 @@ def cpp_type_classes():
+ #           }
+ # Must create an "output" dictionary before any xcbgen imports.
+-output = {'open'    : c_open,
+-          'close'   : c_close,
+-          'simple'  : c_simple, # lambda x, y: None,
+-          'enum'    : lambda x, y: None,
+-          'struct'  : lambda x, y: None,
+-          'union'   : lambda x, y: None,
+-          'request' : c_request,
+-          'event'   : cpp_event,
+-          'error'   : cpp_error,
++output = {'open'          : c_open,
++          'close'         : c_close,
++          'simple'        : c_simple, # lambda x, y: None,
++          'enum'          : lambda x, y: None,
++          'struct'        : lambda x, y: None,
++          'union'         : lambda x, y: None,
++          'request'       : c_request,
++          'event'         : cpp_event,
++          'error'         : cpp_error,
++          'eventstruct'   : lambda x, y: None,
+           }
+ # Boilerplate below this point
index d90ec9a2e765efa3a9b154175733ae964719916f..ec73759fe768b02fcfdc72d80ac9c6e346d40811 100644 (file)
@@ -46,18 +46,18 @@ DEPEND="
 
 RDEPEND="${DEPEND}"
 
-src_prepare() {
-       cmake-utils_src_prepare
+PATCHES=( "${FILESDIR}/${P}-eventstruct.patch" )
 
+src_prepare() {
        if [[ ${PV} != *9999* ]]; then
                rmdir "${S}"/lib/xpp || die
                mv "${WORKDIR}"/xpp-$XPP_VERSION "${S}"/lib/xpp || die
 
                rmdir "${S}"/lib/i3ipcpp || die
                mv "${WORKDIR}"/i3ipcpp-$I3IPCPP_VERSION "${S}"/lib/i3ipcpp || die
-
-               sed -i "s/.*cpp_error,.*/&\n\t  'eventstruct'   : lambda x, y: None,/" lib/xpp/generators/cpp_client.py || die "sed failed"
        fi
+
+       cmake-utils_src_prepare
 }
 
 src_configure() {
index 70e8d426aaf5b23c5097540b4ec7e7b8136ed1c1..adddc936af657412d0e06e42e18eedbeaf7d45bb 100644 (file)
@@ -47,17 +47,15 @@ DEPEND="
 RDEPEND="${DEPEND}"
 
 src_prepare() {
-       cmake-utils_src_prepare
-
        if [[ ${PV} != *9999* ]]; then
                rmdir "${S}"/lib/xpp || die
                mv "${WORKDIR}"/xpp-$XPP_VERSION "${S}"/lib/xpp || die
 
                rmdir "${S}"/lib/i3ipcpp || die
                mv "${WORKDIR}"/i3ipcpp-$I3IPCPP_VERSION "${S}"/lib/i3ipcpp || die
-
-               sed -i "s/.*cpp_error,.*/&\n\t  'eventstruct'   : lambda x, y: None,/" lib/xpp/generators/cpp_client.py || die "sed failed"
        fi
+
+       cmake-utils_src_prepare
 }
 
 src_configure() {