Gentoo Archives: gentoo-commits

From: Johannes Huber <johu@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: x11-wm/i3-gaps/, x11-wm/i3-gaps/files/
Date: Sat, 28 Sep 2019 10:46:11
Message-Id: 1569667553.be3b270d9e1ae89d12875793595eab3ff82eb37d.johu@gentoo
1 commit: be3b270d9e1ae89d12875793595eab3ff82eb37d
2 Author: Johannes Huber <johu <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 28 10:45:16 2019 +0000
4 Commit: Johannes Huber <johu <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 28 10:45:53 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be3b270d
7
8 x11-wm/i3-gaps: Version bump 4.17.1
9
10 Reported-by: Marcin Kowalski <yoshi3 <AT> autograf.pl>
11 Closes: https://bugs.gentoo.org/693822
12 Package-Manager: Portage-2.3.76, Repoman-2.3.17
13 Signed-off-by: Johannes Huber <johu <AT> gentoo.org>
14
15 x11-wm/i3-gaps/Manifest | 1 +
16 x11-wm/i3-gaps/files/i3-gaps-4.17-musl.patch | 71 +++++++++++++++++++++++
17 x11-wm/i3-gaps/i3-gaps-4.17.1.ebuild | 87 ++++++++++++++++++++++++++++
18 3 files changed, 159 insertions(+)
19
20 diff --git a/x11-wm/i3-gaps/Manifest b/x11-wm/i3-gaps/Manifest
21 index 4d354175686..652f73bdb1d 100644
22 --- a/x11-wm/i3-gaps/Manifest
23 +++ b/x11-wm/i3-gaps/Manifest
24 @@ -1 +1,2 @@
25 DIST i3-gaps-4.16.1.tar.gz 3983420 BLAKE2B f0d5a85b06ce33e1cc177af6da29f9cdf42ed754bb767aa9eaa5ab52f3b9f4f688d251f2a16fb222fc8cf5052e79859891c4185b1325b2ef6c1a813aa220468c SHA512 904c2f63c6a35573f13fd216625c1349ac71de70ae8f0440667c9d76048cdaf30a398ab358f2366d5f46502d87e801713b625cb509a05f39dbca1371d2b8d0e9
26 +DIST i3-gaps-4.17.1.tar.gz 3991747 BLAKE2B e5ff8293abf41ffbd15c35590a0594861d7c8b70c0f42886ef7f15fb34b8da57a92cf9bcae76576e7db6db9bacc2356722e5653b1cf35b8446716f8845468b4b SHA512 31e47487f6f662f27b2642925f4ddfc553f1fd075e612d0d2661db723897b12eeae0a2bcefa8a43e7f1d4c15aec2222d3a63e37c8f7e1f9fc96567faa380ebff
27
28 diff --git a/x11-wm/i3-gaps/files/i3-gaps-4.17-musl.patch b/x11-wm/i3-gaps/files/i3-gaps-4.17-musl.patch
29 new file mode 100644
30 index 00000000000..d4f9113e6b1
31 --- /dev/null
32 +++ b/x11-wm/i3-gaps/files/i3-gaps-4.17-musl.patch
33 @@ -0,0 +1,71 @@
34 +--- a/i3bar/src/main.c
35 ++++ b/i3bar/src/main.c
36 +@@ -48,14 +48,20 @@ void debuglog(char *fmt, ...) {
37 + *
38 + */
39 + static char *expand_path(char *path) {
40 +- static glob_t globbuf;
41 +- if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) {
42 +- ELOG("glob() failed\n");
43 +- exit(EXIT_FAILURE);
44 ++ char *home, *expanded;
45 ++
46 ++ if (strncmp(path, "~/", 2) == 0) {
47 ++ home = getenv("HOME");
48 ++ if (home != NULL) {
49 ++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */
50 ++ expanded = scalloc(strlen(home)+strlen(path), 1);
51 ++ strcpy(expanded, home);
52 ++ strcat(expanded, path+1);
53 ++ return expanded;
54 ++ }
55 + }
56 +- char *result = sstrdup(globbuf.gl_pathc > 0 ? globbuf.gl_pathv[0] : path);
57 +- globfree(&globbuf);
58 +- return result;
59 ++
60 ++ return sstrdup(path);
61 + }
62 +
63 + void print_usage(char *elf_name) {
64 +--- a/libi3/resolve_tilde.c
65 ++++ b/libi3/resolve_tilde.c
66 +@@ -19,28 +19,18 @@
67 + *
68 + */
69 + char *resolve_tilde(const char *path) {
70 +- static glob_t globbuf;
71 +- char *head, *tail, *result;
72 ++ char *home, *expanded;
73 +
74 +- tail = strchr(path, '/');
75 +- head = sstrndup(path, tail ? (size_t)(tail - path) : strlen(path));
76 +-
77 +- int res = glob(head, GLOB_TILDE, NULL, &globbuf);
78 +- free(head);
79 +- /* no match, or many wildcard matches are bad */
80 +- if (res == GLOB_NOMATCH || globbuf.gl_pathc != 1)
81 +- result = sstrdup(path);
82 +- else if (res != 0) {
83 +- err(EXIT_FAILURE, "glob() failed");
84 +- } else {
85 +- head = globbuf.gl_pathv[0];
86 +- result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1, 1);
87 +- strcpy(result, head);
88 +- if (tail) {
89 +- strcat(result, tail);
90 ++ if (strncmp(path, "~/", 2) == 0) {
91 ++ home = getenv("HOME");
92 ++ if (home != NULL) {
93 ++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */
94 ++ expanded = scalloc(strlen(home)+strlen(path), 1);
95 ++ strcpy(expanded, home);
96 ++ strcat(expanded, path+1);
97 ++ return expanded;
98 + }
99 + }
100 +- globfree(&globbuf);
101 +
102 +- return result;
103 ++ return sstrdup(path);
104 + }
105
106 diff --git a/x11-wm/i3-gaps/i3-gaps-4.17.1.ebuild b/x11-wm/i3-gaps/i3-gaps-4.17.1.ebuild
107 new file mode 100644
108 index 00000000000..0f5113ed0c6
109 --- /dev/null
110 +++ b/x11-wm/i3-gaps/i3-gaps-4.17.1.ebuild
111 @@ -0,0 +1,87 @@
112 +# Copyright 1999-2019 Gentoo Authors
113 +# Distributed under the terms of the GNU General Public License v2
114 +
115 +EAPI=7
116 +
117 +inherit autotools out-of-source
118 +
119 +DESCRIPTION="i3 fork with gaps and some more features"
120 +HOMEPAGE="https://github.com/Airblader/i3"
121 +SRC_URI="https://github.com/Airblader/i3/archive/${PV}.tar.gz -> ${P}.tar.gz"
122 +
123 +LICENSE="BSD"
124 +SLOT="0"
125 +KEYWORDS="~amd64 ~x86"
126 +IUSE="doc"
127 +
128 +DEPEND="
129 + dev-libs/glib:2
130 + dev-libs/libev
131 + dev-libs/libpcre
132 + dev-libs/yajl
133 + x11-libs/cairo[X,xcb]
134 + x11-libs/libxcb[xkb]
135 + x11-libs/libxkbcommon[X]
136 + x11-libs/pango[X]
137 + x11-libs/startup-notification
138 + x11-libs/xcb-util
139 + x11-libs/xcb-util-cursor
140 + x11-libs/xcb-util-keysyms
141 + x11-libs/xcb-util-wm
142 + x11-libs/xcb-util-xrm
143 +"
144 +BDEPEND="
145 + app-text/asciidoc
146 + app-text/xmlto
147 + dev-lang/perl
148 + virtual/pkgconfig
149 +"
150 +RDEPEND="${DEPEND}
151 + dev-lang/perl
152 + dev-perl/AnyEvent-I3
153 + dev-perl/JSON-XS
154 + !x11-wm/i3
155 +"
156 +
157 +S=${WORKDIR}/i3-${PV}
158 +
159 +DOCS=( RELEASE-NOTES-$(ver_cut 1-3) )
160 +
161 +PATCHES=( "${FILESDIR}/${PN}-$(ver_cut 1-2)-musl.patch" )
162 +
163 +src_prepare() {
164 + default
165 + eautoreconf
166 + cat <<- EOF > "${T}"/i3wm
167 + #!/bin/sh
168 + exec /usr/bin/i3
169 + EOF
170 +}
171 +
172 +my_src_configure() {
173 + # disable sanitizer: otherwise injects -O0 -g
174 + local myeconfargs=(
175 + $(use_enable doc docs)
176 + --enable-debug=no
177 + --enable-mans
178 + --disable-sanitizers
179 + )
180 + econf "${myeconfargs[@]}"
181 +}
182 +
183 +my_src_install_all() {
184 + doman "${BUILD_DIR}"/man/*.1
185 + einstalldocs
186 +
187 + exeinto /etc/X11/Sessions
188 + doexe "${T}"/i3wm
189 +}
190 +
191 +pkg_postinst() {
192 + einfo "There are several packages that you may find useful with ${PN} and"
193 + einfo "their usage is suggested by the upstream maintainers, namely:"
194 + einfo " x11-misc/dmenu"
195 + einfo " x11-misc/i3lock"
196 + einfo " x11-misc/i3status"
197 + einfo "Please refer to their description for additional info."
198 +}