Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-wm/wmfs/, x11-wm/wmfs/files/
Date: Mon, 27 Jan 2020 18:40:56
Message-Id: 1580150441.76fd4de2a8574b255cb8c84fd769a2eabc8b3aca.jer@gentoo
1 commit: 76fd4de2a8574b255cb8c84fd769a2eabc8b3aca
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 27 18:02:11 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 27 18:40:41 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76fd4de2
7
8 x11-wm/wmfs: Fix CFLAGS=-fno-common
9
10 - EAPI=7
11 - Convert sed script to patch
12 - Fix W and event_handle for CFLAGS=-fno-common
13 - Respect CC
14 - Apply one lingering upstream patch
15
16 Package-Manager: Portage-2.3.85, Repoman-2.3.20
17 Closes: https://bugs.gentoo.org/show_bug.cgi?id=706654
18 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
19
20 x11-wm/wmfs/files/wmfs-99999999-Debian.patch | 11 +++
21 x11-wm/wmfs/files/wmfs-99999999-fno-common.patch | 92 ++++++++++++++++++++++++
22 x11-wm/wmfs/files/wmfs-99999999-strncat.patch | 20 ++++++
23 x11-wm/wmfs/wmfs-99999999.ebuild | 19 +++--
24 4 files changed, 132 insertions(+), 10 deletions(-)
25
26 diff --git a/x11-wm/wmfs/files/wmfs-99999999-Debian.patch b/x11-wm/wmfs/files/wmfs-99999999-Debian.patch
27 new file mode 100644
28 index 00000000000..dde3497e640
29 --- /dev/null
30 +++ b/x11-wm/wmfs/files/wmfs-99999999-Debian.patch
31 @@ -0,0 +1,11 @@
32 +--- a/configure
33 ++++ b/configure
34 +@@ -81,7 +81,7 @@ fi
35 + [ -n "$USE_XFT" ] && CFLAGS="$CFLAGS -DHAVE_XFT"
36 +
37 + # Debian hardening options http://wiki.debian.org/Hardening
38 +-which dpkg-buildflags > /dev/null 2>&1
39 ++false
40 + if [ $? -eq 0 ];
41 + then
42 + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2 `dpkg-buildflags --get CFLAGS`"
43
44 diff --git a/x11-wm/wmfs/files/wmfs-99999999-fno-common.patch b/x11-wm/wmfs/files/wmfs-99999999-fno-common.patch
45 new file mode 100644
46 index 00000000000..0ff0ce0ebc9
47 --- /dev/null
48 +++ b/x11-wm/wmfs/files/wmfs-99999999-fno-common.patch
49 @@ -0,0 +1,92 @@
50 +--- a/src/client.c
51 ++++ b/src/client.c
52 +@@ -12,6 +12,7 @@
53 + #include "draw.h"
54 + #include "screen.h"
55 + #include "mouse.h"
56 ++#include "wmfs.h"
57 +
58 + #define CLIENT_RESIZE_DIR(D) \
59 + void uicb_client_resize_##D(Uicb cmd) \
60 +--- a/src/event.c
61 ++++ b/src/event.c
62 +@@ -21,6 +21,9 @@
63 + if(!m->use_area || (m->use_area && INAREA(ev->x, ev->y, m->area))) \
64 + if(m->func) \
65 + m->func(m->cmd);
66 ++
67 ++void (*event_handle[MAX_EV])(XEvent*);
68 ++
69 + static void
70 + event_buttonpress(XEvent *e)
71 + {
72 +--- a/src/event.h
73 ++++ b/src/event.h
74 +@@ -17,6 +17,6 @@
75 +
76 + void event_init(void);
77 +
78 +-void (*event_handle[MAX_EV])(XEvent*);
79 ++extern void (*event_handle[MAX_EV])(XEvent*);
80 +
81 + #endif /* EVENT_H */
82 +--- a/src/ewmh.c
83 ++++ b/src/ewmh.c
84 +@@ -7,6 +7,7 @@
85 + #include "util.h"
86 + #include "screen.h"
87 + #include "client.h"
88 ++#include "wmfs.h"
89 +
90 + /* Taken From standards.freedesktop.org */
91 + #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
92 +--- a/src/mouse.c
93 ++++ b/src/mouse.c
94 +@@ -9,6 +9,7 @@
95 + #include "client.h"
96 + #include "layout.h"
97 + #include "draw.h"
98 ++#include "wmfs.h"
99 +
100 + #define _REV_SBORDER(c) draw_reversed_rect(W->root, c, false);
101 +
102 +--- a/src/status.c
103 ++++ b/src/status.c
104 +@@ -9,6 +9,7 @@
105 + #include "infobar.h"
106 + #include "util.h"
107 + #include "draw.h"
108 ++#include "wmfs.h"
109 +
110 + #include <string.h>
111 +
112 +--- a/src/wmfs.c
113 ++++ b/src/wmfs.c
114 +@@ -25,6 +25,8 @@
115 + #include "layout.h"
116 + #include "systray.h"
117 +
118 ++struct wmfs *W;
119 ++
120 + int
121 + wmfs_error_handler(Display *d, XErrorEvent *event)
122 + {
123 +@@ -617,8 +619,6 @@ main(int argc, char **argv)
124 + }
125 + }
126 +
127 +- W = (struct wmfs*)xcalloc(1, sizeof(struct wmfs));
128 +-
129 + /* Default path ~/.config/wmfs/wmfsrc */
130 + W->confpath = path;
131 +
132 +--- a/src/wmfs.h
133 ++++ b/src/wmfs.h
134 +@@ -444,6 +444,6 @@ void uicb_reload(Uicb cmd);
135 + void uicb_quit(Uicb cmd);
136 +
137 + /* Single global variable */
138 +-struct wmfs *W;
139 ++extern struct wmfs *W;
140 +
141 + #endif /* WMFS_H */
142
143 diff --git a/x11-wm/wmfs/files/wmfs-99999999-strncat.patch b/x11-wm/wmfs/files/wmfs-99999999-strncat.patch
144 new file mode 100644
145 index 00000000000..e55cd00121b
146 --- /dev/null
147 +++ b/x11-wm/wmfs/files/wmfs-99999999-strncat.patch
148 @@ -0,0 +1,20 @@
149 +--- a/src/launcher.c
150 ++++ b/src/launcher.c
151 +@@ -366,7 +366,7 @@
152 + if(pos && (end = complete(&cache, tmpbuf)))
153 + {
154 + strncpy(buf, tmpbuf, sizeof(buf));
155 +- strncat(buf, end, sizeof(buf));
156 ++ strncat(buf, end, sizeof(buf) - 1);
157 + found = true;
158 + }
159 +
160 +@@ -387,7 +387,7 @@
161 +
162 + default:
163 + lastwastab = false;
164 +- strncat(buf, tmp, sizeof(tmp));
165 ++ strncat(buf, tmp, sizeof(buf) - 1);
166 + ++pos;
167 + break;
168 + }
169
170 diff --git a/x11-wm/wmfs/wmfs-99999999.ebuild b/x11-wm/wmfs/wmfs-99999999.ebuild
171 index f152990663f..a2a1959136e 100644
172 --- a/x11-wm/wmfs/wmfs-99999999.ebuild
173 +++ b/x11-wm/wmfs/wmfs-99999999.ebuild
174 @@ -1,8 +1,8 @@
175 -# Copyright 1999-2018 Gentoo Foundation
176 +# Copyright 1999-2020 Gentoo Authors
177 # Distributed under the terms of the GNU General Public License v2
178
179 -EAPI=5
180 -inherit eutils git-r3
181 +EAPI=7
182 +inherit git-r3 toolchain-funcs
183
184 DESCRIPTION="Window Manager From Scratch, A tiling window manager highly configurable"
185 HOMEPAGE="https://github.com/xorg62/wmfs"
186 @@ -26,15 +26,14 @@ DEPEND="
187 virtual/pkgconfig
188 x11-base/xorg-proto
189 "
190 -
191 -src_prepare() {
192 - epatch \
193 - "${FILESDIR}"/${PN}-99999999-desktop.patch
194 -
195 - sed -i -e '/^which dpkg/s|.*|false|g' configure || die
196 -}
197 +PATCHES=(
198 + "${FILESDIR}"/${PN}-99999999-Debian.patch
199 + "${FILESDIR}"/${PN}-99999999-desktop.patch
200 + "${FILESDIR}"/${PN}-99999999-fno-common.patch
201 +)
202
203 src_configure() {
204 + tc-export CC
205 # not autotools based
206 local ECHO
207 for ECHO in echo ''; do