1 |
commit: c3da12df17dfa8f7959b80fa2cf7c1bb4d269de3 |
2 |
Author: Johannes Huber <johu <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Nov 17 09:52:33 2018 +0000 |
4 |
Commit: Johannes Huber <johu <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Nov 17 09:52:33 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3da12df |
7 |
|
8 |
x11-wm/i3-gaps: Version bump 4.16 |
9 |
|
10 |
Package-Manager: Portage-2.3.51, Repoman-2.3.12 |
11 |
Signed-off-by: Johannes Huber <johu <AT> gentoo.org> |
12 |
|
13 |
x11-wm/i3-gaps/Manifest | 1 + |
14 |
x11-wm/i3-gaps/files/i3-gaps-4.16-musl.patch | 86 +++++++++++++++++++++++++++ |
15 |
x11-wm/i3-gaps/i3-gaps-4.16.ebuild | 87 ++++++++++++++++++++++++++++ |
16 |
3 files changed, 174 insertions(+) |
17 |
|
18 |
diff --git a/x11-wm/i3-gaps/Manifest b/x11-wm/i3-gaps/Manifest |
19 |
index fe96407b113..302cf42bc0e 100644 |
20 |
--- a/x11-wm/i3-gaps/Manifest |
21 |
+++ b/x11-wm/i3-gaps/Manifest |
22 |
@@ -1 +1,2 @@ |
23 |
DIST i3-gaps-4.15.0.1.tar.gz 3965631 BLAKE2B ea65886c40f377125bafbd80e2d56c1d66a4c5c06d942d645b2cb226323a0903e98aa58b67da9c31c60240b5d99d10ecc20864aeede95a5039ea0ffdff8dcb8b SHA512 76ff860e4ca0edd0e22bdff9ae9b1bc150df2b5bc15b0d7ea7a63d373e8d156a43bd91f8a40c48b4c771603f7de7c18c6d16c53fef582e53f51c53a197fa7a0a |
24 |
+DIST i3-gaps-4.16.tar.gz 3985226 BLAKE2B da61ab6b476a30a4acab24590cd5ca51f0f51318988890e66530fdd76d99236378d9c678e1e37da99e22e70b0e5e0e5895b8146bd5a93b23957cb1e0178e08b1 SHA512 64a392d2b4175e063f0740ee04885156dbd2571262c22df6276e8eaac36765cd03822723208118a1998ff6cbbcd973fb7f6305df9744c477262d5d33b792ee23 |
25 |
|
26 |
diff --git a/x11-wm/i3-gaps/files/i3-gaps-4.16-musl.patch b/x11-wm/i3-gaps/files/i3-gaps-4.16-musl.patch |
27 |
new file mode 100644 |
28 |
index 00000000000..1e67ec2a3c4 |
29 |
--- /dev/null |
30 |
+++ b/x11-wm/i3-gaps/files/i3-gaps-4.16-musl.patch |
31 |
@@ -0,0 +1,86 @@ |
32 |
+From: Natanael Copa <ncopa@×××××××××××.org> |
33 |
+Patch-Source: https://git.alpinelinux.org/cgit/aports/tree/community/i3wm/musl.patch |
34 |
+Project-Bug-URL: https://github.com/i3/i3/issues/1859 |
35 |
+Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=609306 |
36 |
+ |
37 |
+Musl doesn't implement GLOB_TILDE, which is used by i3 when expanding paths. |
38 |
+ |
39 |
+This patch replaces usage of GLOB_TILDE in glob() by replacing tilde |
40 |
+with the content of $HOME - if set - manually. |
41 |
+ |
42 |
+As mentioned in the i3 bugtracker this is an issue that should be solved by musl. |
43 |
+ |
44 |
+A patch has been sent to musl upstream, but it hasn't been merged yet: |
45 |
+http://www.openwall.com/lists/musl/2017/01/17/1 |
46 |
+--- |
47 |
+--- a/i3bar/src/main.c |
48 |
++++ b/i3bar/src/main.c |
49 |
+@@ -48,14 +48,20 @@ void debuglog(char *fmt, ...) { |
50 |
+ * |
51 |
+ */ |
52 |
+ static char *expand_path(char *path) { |
53 |
+- static glob_t globbuf; |
54 |
+- if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) { |
55 |
+- ELOG("glob() failed\n"); |
56 |
+- exit(EXIT_FAILURE); |
57 |
++ char *home, *expanded; |
58 |
++ |
59 |
++ if (strncmp(path, "~/", 2) == 0) { |
60 |
++ home = getenv("HOME"); |
61 |
++ if (home != NULL) { |
62 |
++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */ |
63 |
++ expanded = scalloc(strlen(home)+strlen(path), 1); |
64 |
++ strcpy(expanded, home); |
65 |
++ strcat(expanded, path+1); |
66 |
++ return expanded; |
67 |
++ } |
68 |
+ } |
69 |
+- char *result = sstrdup(globbuf.gl_pathc > 0 ? globbuf.gl_pathv[0] : path); |
70 |
+- globfree(&globbuf); |
71 |
+- return result; |
72 |
++ |
73 |
++ return sstrdup(path); |
74 |
+ } |
75 |
+ |
76 |
+ void print_usage(char *elf_name) { |
77 |
+--- a/libi3/resolve_tilde.c |
78 |
++++ b/libi3/resolve_tilde.c |
79 |
+@@ -19,28 +19,18 @@ |
80 |
+ * |
81 |
+ */ |
82 |
+ char *resolve_tilde(const char *path) { |
83 |
+- static glob_t globbuf; |
84 |
+- char *head, *tail, *result; |
85 |
++ char *home, *expanded; |
86 |
+ |
87 |
+- tail = strchr(path, '/'); |
88 |
+- head = sstrndup(path, tail ? (size_t)(tail - path) : strlen(path)); |
89 |
+- |
90 |
+- int res = glob(head, GLOB_TILDE, NULL, &globbuf); |
91 |
+- free(head); |
92 |
+- /* no match, or many wildcard matches are bad */ |
93 |
+- if (res == GLOB_NOMATCH || globbuf.gl_pathc != 1) |
94 |
+- result = sstrdup(path); |
95 |
+- else if (res != 0) { |
96 |
+- err(EXIT_FAILURE, "glob() failed"); |
97 |
+- } else { |
98 |
+- head = globbuf.gl_pathv[0]; |
99 |
+- result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1, 1); |
100 |
+- strcpy(result, head); |
101 |
+- if (tail) { |
102 |
+- strcat(result, tail); |
103 |
++ if (strncmp(path, "~/", 2) == 0) { |
104 |
++ home = getenv("HOME"); |
105 |
++ if (home != NULL) { |
106 |
++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */ |
107 |
++ expanded = scalloc(strlen(home)+strlen(path), 1); |
108 |
++ strcpy(expanded, home); |
109 |
++ strcat(expanded, path+1); |
110 |
++ return expanded; |
111 |
+ } |
112 |
+ } |
113 |
+- globfree(&globbuf); |
114 |
+ |
115 |
+- return result; |
116 |
++ return sstrdup(path); |
117 |
+ } |
118 |
|
119 |
diff --git a/x11-wm/i3-gaps/i3-gaps-4.16.ebuild b/x11-wm/i3-gaps/i3-gaps-4.16.ebuild |
120 |
new file mode 100644 |
121 |
index 00000000000..d3e62d0fb17 |
122 |
--- /dev/null |
123 |
+++ b/x11-wm/i3-gaps/i3-gaps-4.16.ebuild |
124 |
@@ -0,0 +1,87 @@ |
125 |
+# Copyright 1999-2018 Gentoo Authors |
126 |
+# Distributed under the terms of the GNU General Public License v2 |
127 |
+ |
128 |
+EAPI=7 |
129 |
+ |
130 |
+inherit autotools |
131 |
+ |
132 |
+DESCRIPTION="i3 fork with gaps and some more features" |
133 |
+HOMEPAGE="https://github.com/Airblader/i3" |
134 |
+SRC_URI="https://github.com/Airblader/i3/archive/${PV}.tar.gz -> ${P}.tar.gz" |
135 |
+ |
136 |
+LICENSE="BSD" |
137 |
+SLOT="0" |
138 |
+KEYWORDS="~amd64 ~x86" |
139 |
+IUSE="" |
140 |
+ |
141 |
+DEPEND=" |
142 |
+ dev-libs/glib:2 |
143 |
+ dev-libs/libev |
144 |
+ dev-libs/libpcre |
145 |
+ dev-libs/yajl |
146 |
+ x11-libs/cairo[X,xcb] |
147 |
+ x11-libs/libxcb[xkb] |
148 |
+ x11-libs/libxkbcommon[X] |
149 |
+ x11-libs/pango[X] |
150 |
+ x11-libs/startup-notification |
151 |
+ x11-libs/xcb-util |
152 |
+ x11-libs/xcb-util-cursor |
153 |
+ x11-libs/xcb-util-keysyms |
154 |
+ x11-libs/xcb-util-wm |
155 |
+ x11-libs/xcb-util-xrm |
156 |
+" |
157 |
+BDEPEND=" |
158 |
+ virtual/pkgconfig |
159 |
+" |
160 |
+RDEPEND="${DEPEND} |
161 |
+ dev-lang/perl |
162 |
+ dev-perl/AnyEvent-I3 |
163 |
+ dev-perl/JSON-XS |
164 |
+ !x11-wm/i3 |
165 |
+" |
166 |
+ |
167 |
+S=${WORKDIR}/i3-${PV} |
168 |
+ |
169 |
+DOCS=( RELEASE-NOTES-$(ver_cut 1-2) ) |
170 |
+ |
171 |
+PATCHES=( "${FILESDIR}/${PN}-$(ver_cut 1-2)-musl.patch" ) |
172 |
+ |
173 |
+src_prepare() { |
174 |
+ default |
175 |
+ sed -e '/AC_PATH_PROG(\[PATH_ASCIIDOC/d' -i configure.ac || die |
176 |
+ eautoreconf |
177 |
+ cat <<- EOF > "${T}"/i3wm |
178 |
+ #!/bin/sh |
179 |
+ exec /usr/bin/i3 |
180 |
+ EOF |
181 |
+} |
182 |
+ |
183 |
+src_configure() { |
184 |
+ # disable sanitizer: otherwise injects -O0 -g |
185 |
+ local myeconfargs=( |
186 |
+ --enable-debug=no |
187 |
+ --disable-sanitizers |
188 |
+ ) |
189 |
+ econf "${myeconfargs[@]}" |
190 |
+} |
191 |
+ |
192 |
+src_compile() { |
193 |
+ emake -C "${CBUILD}" |
194 |
+} |
195 |
+ |
196 |
+src_install() { |
197 |
+ emake -C "${CBUILD}" DESTDIR="${D}" install |
198 |
+ einstalldocs |
199 |
+ |
200 |
+ exeinto /etc/X11/Sessions |
201 |
+ doexe "${T}"/i3wm |
202 |
+} |
203 |
+ |
204 |
+pkg_postinst() { |
205 |
+ einfo "There are several packages that you may find useful with ${PN} and" |
206 |
+ einfo "their usage is suggested by the upstream maintainers, namely:" |
207 |
+ einfo " x11-misc/dmenu" |
208 |
+ einfo " x11-misc/i3lock" |
209 |
+ einfo " x11-misc/i3status" |
210 |
+ einfo "Please refer to their description for additional info." |
211 |
+} |