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/files/, x11-wm/i3-gaps/
Date: Wed, 09 May 2018 18:17:04
Message-Id: 1525889585.0cb1e8bf4d5d641aac0a330a96847815b02bea57.johu@gentoo
1 commit: 0cb1e8bf4d5d641aac0a330a96847815b02bea57
2 Author: Johannes Huber <johu <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 9 18:12:47 2018 +0000
4 Commit: Johannes Huber <johu <AT> gentoo <DOT> org>
5 CommitDate: Wed May 9 18:13:05 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0cb1e8bf
7
8 x11-wm/i3-gaps: New package
9
10 A popular clone[1] of the improved dynamic tiling window manager i3
11 which supports gaps and few additional features[2]. There are several
12 ebuilds already in user overlays available[3][4][5]. Ebuild taken from
13 oboeverlay, improved by me. The original ebuild is probably the original
14 x11-wm/i3.
15
16 [1] https://www.reddit.com/r/unixporn/search?q=gaps&restrict_sr=1
17 [2] https://github.com/Airblader/i3
18 [3] https://github.com/ChrisOboe/oboeverlay/tree/master/x11-wm/i3-gaps
19 [4] https://github.com/0x4d4c/gentoo-overlay/tree/master/x11-wm/i3-gaps
20 [5] https://github.com/SonicFrog/overlay/tree/master/x11-wm/i3-gaps
21
22 Closes: https://bugs.gentoo.org/654694
23 Package-Manager: Portage-2.3.36, Repoman-2.3.9
24
25 x11-wm/i3-gaps/Manifest | 1 +
26 x11-wm/i3-gaps/files/i3-gaps-4.15-musl.patch | 73 +++++++++++++++++++++++
27 x11-wm/i3-gaps/i3-gaps-4.15.0.1.ebuild | 87 ++++++++++++++++++++++++++++
28 x11-wm/i3-gaps/metadata.xml | 11 ++++
29 4 files changed, 172 insertions(+)
30
31 diff --git a/x11-wm/i3-gaps/Manifest b/x11-wm/i3-gaps/Manifest
32 new file mode 100644
33 index 00000000000..fe96407b113
34 --- /dev/null
35 +++ b/x11-wm/i3-gaps/Manifest
36 @@ -0,0 +1 @@
37 +DIST i3-gaps-4.15.0.1.tar.gz 3965631 BLAKE2B ea65886c40f377125bafbd80e2d56c1d66a4c5c06d942d645b2cb226323a0903e98aa58b67da9c31c60240b5d99d10ecc20864aeede95a5039ea0ffdff8dcb8b SHA512 76ff860e4ca0edd0e22bdff9ae9b1bc150df2b5bc15b0d7ea7a63d373e8d156a43bd91f8a40c48b4c771603f7de7c18c6d16c53fef582e53f51c53a197fa7a0a
38
39 diff --git a/x11-wm/i3-gaps/files/i3-gaps-4.15-musl.patch b/x11-wm/i3-gaps/files/i3-gaps-4.15-musl.patch
40 new file mode 100644
41 index 00000000000..82ad6195b8e
42 --- /dev/null
43 +++ b/x11-wm/i3-gaps/files/i3-gaps-4.15-musl.patch
44 @@ -0,0 +1,73 @@
45 +diff -urp i3-4.11/i3bar/src/main.c i3-4.11.new/i3bar/src/main.c
46 +--- i3-4.11/i3bar/src/main.c 2015-09-30 07:55:10.000000000 +0100
47 ++++ i3-4.11.new/i3bar/src/main.c 2016-02-08 20:03:41.777392482 +0000
48 +@@ -45,14 +45,20 @@ void debuglog(char *fmt, ...) {
49 + *
50 + */
51 + char *expand_path(char *path) {
52 +- static glob_t globbuf;
53 +- if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) {
54 +- ELOG("glob() failed\n");
55 +- exit(EXIT_FAILURE);
56 ++ char *home, *expanded;
57 ++
58 ++ if (strncmp(path, "~/", 2) == 0) {
59 ++ home = getenv("HOME");
60 ++ if (home != NULL) {
61 ++ /* new length: sum - 1 (omit '~') + 1 (for '\0') */
62 ++ expanded = scalloc(strlen(home)+strlen(path), 1);
63 ++ strcpy(expanded, home);
64 ++ strcat(expanded, path+1);
65 ++ return expanded;
66 ++ }
67 + }
68 +- char *result = sstrdup(globbuf.gl_pathc > 0 ? globbuf.gl_pathv[0] : path);
69 +- globfree(&globbuf);
70 +- return result;
71 ++
72 ++ return sstrdup(path);
73 + }
74 +
75 + void print_usage(char *elf_name) {
76 +diff -urp i3-4.11/libi3/resolve_tilde.c i3-4.11.new/libi3/resolve_tilde.c
77 +--- i3-4.11/libi3/resolve_tilde.c 2015-09-30 07:55:10.000000000 +0100
78 ++++ i3-4.11.new/libi3/resolve_tilde.c 2016-02-08 20:03:47.849230953 +0000
79 +@@ -19,27 +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 +- strncpy(result, head, strlen(head));
101 +- if (tail)
102 +- strncat(result, tail, strlen(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.15.0.1.ebuild b/x11-wm/i3-gaps/i3-gaps-4.15.0.1.ebuild
120 new file mode 100644
121 index 00000000000..54936b5b78b
122 --- /dev/null
123 +++ b/x11-wm/i3-gaps/i3-gaps-4.15.0.1.ebuild
124 @@ -0,0 +1,87 @@
125 +# Copyright 1999-2018 Gentoo Foundation
126 +# Distributed under the terms of the GNU General Public License v2
127 +
128 +EAPI=6
129 +
130 +inherit autotools eapi7-ver
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 +CDEPEND="
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 +DEPEND="${CDEPEND}
158 + virtual/pkgconfig
159 +"
160 +RDEPEND="${CDEPEND}
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 +}
212
213 diff --git a/x11-wm/i3-gaps/metadata.xml b/x11-wm/i3-gaps/metadata.xml
214 new file mode 100644
215 index 00000000000..1a5dfaf1b54
216 --- /dev/null
217 +++ b/x11-wm/i3-gaps/metadata.xml
218 @@ -0,0 +1,11 @@
219 +<?xml version="1.0" encoding="UTF-8"?>
220 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
221 +<pkgmetadata>
222 + <maintainer type="person">
223 + <email>johu@g.o</email>
224 + <name>Johannes Huber</name>
225 + </maintainer>
226 + <upstream>
227 + <remote-id type="github">Airblader/i3</remote-id>
228 + </upstream>
229 +</pkgmetadata>