Gentoo Archives: gentoo-commits

From: Lino Bigatti <linobigatti@××××××××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: x11-wm/i3-rounded/, x11-wm/i3-rounded/files/
Date: Tue, 31 Aug 2021 13:49:04
Message-Id: 1630417419.1f4a1195b593d50b161b0b8d5c75968788f3a92d.linobigatti@gentoo
1 commit: 1f4a1195b593d50b161b0b8d5c75968788f3a92d
2 Author: Lino Bigatti <linobigatti <AT> protonmail <DOT> com>
3 AuthorDate: Tue Aug 31 13:43:15 2021 +0000
4 Commit: Lino Bigatti <linobigatti <AT> protonmail <DOT> com>
5 CommitDate: Tue Aug 31 13:43:39 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1f4a1195
7
8 x11-wm/i3-rounded: Added i3-rounded
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Lino Bigatti <linobigatti <AT> protonmail.com>
12
13 x11-wm/i3-rounded/Manifest | 1 +
14 x11-wm/i3-rounded/files/i3-rounded-4.18-musl.patch | 74 ++++++++++++++++++
15 .../files/i3-rounded-4.19-fix-docdir.patch | 22 ++++++
16 x11-wm/i3-rounded/i3-rounded-4.19.1.ebuild | 87 ++++++++++++++++++++++
17 x11-wm/i3-rounded/metadata.xml | 11 +++
18 5 files changed, 195 insertions(+)
19
20 diff --git a/x11-wm/i3-rounded/Manifest b/x11-wm/i3-rounded/Manifest
21 new file mode 100644
22 index 000000000..08e109094
23 --- /dev/null
24 +++ b/x11-wm/i3-rounded/Manifest
25 @@ -0,0 +1 @@
26 +DIST i3-rounded-4.19.1.tar.gz 4190542 BLAKE2B d79895caea1eae9c8ed9acd89152904933d02342aff24ce3960ecb395eb8add067990f68e55a54032fc73c16a6d4c7fd4da9822eebb012a32f0f7346f13410f0 SHA512 9513eda800ab7bb95b583064dd0b820e6e26326c18709d3ea4082d36a390307b4f2e3c3d1ee0a9dde99eb85b4e9bda2c41d1af6671e1673e75adf6a799e3ff99
27
28 diff --git a/x11-wm/i3-rounded/files/i3-rounded-4.18-musl.patch b/x11-wm/i3-rounded/files/i3-rounded-4.18-musl.patch
29 new file mode 100644
30 index 000000000..bf59b32e3
31 --- /dev/null
32 +++ b/x11-wm/i3-rounded/files/i3-rounded-4.18-musl.patch
33 @@ -0,0 +1,74 @@
34 +--- a/i3bar/src/main.c
35 ++++ b/i3bar/src/main.c
36 +@@ -45,14 +45,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 + static 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 +2.27.0
107 +
108
109 diff --git a/x11-wm/i3-rounded/files/i3-rounded-4.19-fix-docdir.patch b/x11-wm/i3-rounded/files/i3-rounded-4.19-fix-docdir.patch
110 new file mode 100644
111 index 000000000..6917aa091
112 --- /dev/null
113 +++ b/x11-wm/i3-rounded/files/i3-rounded-4.19-fix-docdir.patch
114 @@ -0,0 +1,22 @@
115 +diff --git a/meson.build b/meson.build
116 +index 11541e21..a6f8974e 100644
117 +--- a/meson.build
118 ++++ b/meson.build
119 +@@ -642,7 +642,7 @@ if get_option('docs')
120 + '@OUTPUT@',
121 + ],
122 + install: true,
123 +- install_dir: join_paths(get_option('datadir'), 'doc', 'i3'),
124 ++ install_dir: docdir,
125 + )
126 +
127 + custom_target(
128 +@@ -655,7 +655,7 @@ if get_option('docs')
129 + '@OUTPUT@',
130 + ],
131 + install: true,
132 +- install_dir: join_paths(get_option('datadir'), 'doc', 'i3'),
133 ++ install_dir: docdir,
134 + )
135 + endif
136 +
137
138 diff --git a/x11-wm/i3-rounded/i3-rounded-4.19.1.ebuild b/x11-wm/i3-rounded/i3-rounded-4.19.1.ebuild
139 new file mode 100644
140 index 000000000..b5eb41159
141 --- /dev/null
142 +++ b/x11-wm/i3-rounded/i3-rounded-4.19.1.ebuild
143 @@ -0,0 +1,87 @@
144 +# Copyright 1999-2021 Gentoo Authors
145 +# Distributed under the terms of the GNU General Public License v2
146 +
147 +EAPI=7
148 +
149 +inherit meson optfeature
150 +
151 +DESCRIPTION="i3-gaps fork with rounded corners support."
152 +HOMEPAGE="https://github.com/linobigatti/i3-rounded"
153 +SRC_URI="https://github.com/linobigatti/i3-rounded/archive/${PV}.tar.gz -> ${P}.tar.gz"
154 +
155 +LICENSE="BSD"
156 +SLOT="0"
157 +KEYWORDS="~amd64 ~ppc64 ~x86"
158 +IUSE="doc test"
159 +RESTRICT="!test? ( test )"
160 +
161 +COMMON_DEPEND="dev-libs/glib:2
162 + dev-libs/libev
163 + dev-libs/libpcre
164 + dev-libs/yajl
165 + x11-libs/cairo[X,xcb(+)]
166 + x11-libs/libxcb[xkb]
167 + x11-libs/libxkbcommon[X]
168 + x11-libs/pango[X]
169 + x11-libs/startup-notification
170 + x11-libs/xcb-util
171 + x11-libs/xcb-util-cursor
172 + x11-libs/xcb-util-keysyms
173 + x11-libs/xcb-util-wm
174 + x11-libs/xcb-util-xrm"
175 +DEPEND="${COMMON_DEPEND}
176 + test? (
177 + dev-perl/ExtUtils-PkgConfig
178 + dev-perl/IPC-Run
179 + dev-perl/Inline
180 + dev-perl/Inline-C
181 + dev-perl/X11-XCB
182 + dev-perl/XS-Object-Magic
183 + x11-apps/xhost
184 + x11-base/xorg-server[xephyr,xvfb]
185 + x11-misc/xvfb-run
186 + )"
187 +BDEPEND="app-text/asciidoc
188 + app-text/xmlto
189 + dev-lang/perl
190 + virtual/pkgconfig"
191 +RDEPEND="${COMMON_DEPEND}
192 + dev-lang/perl
193 + dev-perl/AnyEvent-I3
194 + dev-perl/JSON-XS
195 + !x11-wm/i3"
196 +
197 +#S="${WORKDIR}/i3-rounded-${PV}"
198 +
199 +DOCS=( RELEASE-NOTES-$(ver_cut 1-3) )
200 +
201 +PATCHES=(
202 + "${FILESDIR}/${PN}-4.18-musl.patch"
203 + "${FILESDIR}/${PN}-4.19-fix-docdir.patch"
204 +)
205 +
206 +src_configure() {
207 + local emesonargs=(
208 + -Ddocdir="/usr/share/doc/${PF}"
209 + -Ddocs=$(usex doc true false)
210 + -Dmans=true
211 + )
212 +
213 + meson_src_configure
214 +}
215 +
216 +src_install() {
217 + meson_src_install
218 +
219 + exeinto /etc/X11/Sessions
220 + newexe - i3wm <<- EOF
221 + #!/usr/bin/env sh
222 + exec /usr/bin/i3
223 + EOF
224 +}
225 +
226 +pkg_postinst() {
227 + optfeature "Application launcher" x11-misc/dmenu
228 + optfeature "Simple screen locker" x11-misc/i3lock
229 + optfeature "Status bar generator" x11-misc/i3status
230 +}
231
232 diff --git a/x11-wm/i3-rounded/metadata.xml b/x11-wm/i3-rounded/metadata.xml
233 new file mode 100644
234 index 000000000..5069f4b0c
235 --- /dev/null
236 +++ b/x11-wm/i3-rounded/metadata.xml
237 @@ -0,0 +1,11 @@
238 +<?xml version="1.0" encoding="UTF-8"?>
239 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
240 +<pkgmetadata>
241 + <maintainer type="person">
242 + <email>linobigatti@××××××××××.com</email>
243 + <name>Lino Bigatti</name>
244 + </maintainer>
245 + <upstream>
246 + <remote-id type="github">linobigatti/i3-rounded</remote-id>
247 + </upstream>
248 +</pkgmetadata>