commit:     1f4a1195b593d50b161b0b8d5c75968788f3a92d
Author:     Lino Bigatti <linobigatti <AT> protonmail <DOT> com>
AuthorDate: Tue Aug 31 13:43:15 2021 +0000
Commit:     Lino Bigatti <linobigatti <AT> protonmail <DOT> com>
CommitDate: Tue Aug 31 13:43:39 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=1f4a1195

x11-wm/i3-rounded: Added i3-rounded

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Lino Bigatti <linobigatti <AT> protonmail.com>

 x11-wm/i3-rounded/Manifest                         |  1 +
 x11-wm/i3-rounded/files/i3-rounded-4.18-musl.patch | 74 ++++++++++++++++++
 .../files/i3-rounded-4.19-fix-docdir.patch         | 22 ++++++
 x11-wm/i3-rounded/i3-rounded-4.19.1.ebuild         | 87 ++++++++++++++++++++++
 x11-wm/i3-rounded/metadata.xml                     | 11 +++
 5 files changed, 195 insertions(+)

diff --git a/x11-wm/i3-rounded/Manifest b/x11-wm/i3-rounded/Manifest
new file mode 100644
index 000000000..08e109094
--- /dev/null
+++ b/x11-wm/i3-rounded/Manifest
@@ -0,0 +1 @@
+DIST i3-rounded-4.19.1.tar.gz 4190542 BLAKE2B 
d79895caea1eae9c8ed9acd89152904933d02342aff24ce3960ecb395eb8add067990f68e55a54032fc73c16a6d4c7fd4da9822eebb012a32f0f7346f13410f0
 SHA512 
9513eda800ab7bb95b583064dd0b820e6e26326c18709d3ea4082d36a390307b4f2e3c3d1ee0a9dde99eb85b4e9bda2c41d1af6671e1673e75adf6a799e3ff99

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
new file mode 100644
index 000000000..bf59b32e3
--- /dev/null
+++ b/x11-wm/i3-rounded/files/i3-rounded-4.18-musl.patch
@@ -0,0 +1,74 @@
+--- a/i3bar/src/main.c
++++ b/i3bar/src/main.c
+@@ -45,14 +45,20 @@ void debuglog(char *fmt, ...) {
+  *
+  */
+ static char *expand_path(char *path) {
+-    static glob_t globbuf;
+-    if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) {
+-        ELOG("glob() failed\n");
+-        exit(EXIT_FAILURE);
++    char *home, *expanded;
++
++    if (strncmp(path, "~/", 2) == 0) {
++        home = getenv("HOME");
++        if (home != NULL) {
++            /* new length: sum - 1 (omit '~') + 1 (for '\0') */
++            expanded = scalloc(strlen(home)+strlen(path), 1);
++            strcpy(expanded, home);
++            strcat(expanded, path+1);
++            return expanded;
++        }
+     }
+-    char *result = sstrdup(globbuf.gl_pathc > 0 ? globbuf.gl_pathv[0] : path);
+-    globfree(&globbuf);
+-    return result;
++
++    return sstrdup(path);
+ }
+ 
+ static void print_usage(char *elf_name) {
+--- a/libi3/resolve_tilde.c
++++ b/libi3/resolve_tilde.c
+@@ -19,28 +19,18 @@
+  *
+  */
+ char *resolve_tilde(const char *path) {
+-    static glob_t globbuf;
+-    char *head, *tail, *result;
++    char *home, *expanded;
+ 
+-    tail = strchr(path, '/');
+-    head = sstrndup(path, tail ? (size_t)(tail - path) : strlen(path));
+-
+-    int res = glob(head, GLOB_TILDE, NULL, &globbuf);
+-    free(head);
+-    /* no match, or many wildcard matches are bad */
+-    if (res == GLOB_NOMATCH || globbuf.gl_pathc != 1)
+-        result = sstrdup(path);
+-    else if (res != 0) {
+-        err(EXIT_FAILURE, "glob() failed");
+-    } else {
+-        head = globbuf.gl_pathv[0];
+-        result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1, 1);
+-        strcpy(result, head);
+-        if (tail) {
+-            strcat(result, tail);
++    if (strncmp(path, "~/", 2) == 0) {
++        home = getenv("HOME");
++        if (home != NULL) {
++            /* new length: sum - 1 (omit '~') + 1 (for '\0') */
++            expanded = scalloc(strlen(home)+strlen(path), 1);
++            strcpy(expanded, home);
++            strcat(expanded, path+1);
++            return expanded;
+         }
+     }
+-    globfree(&globbuf);
+ 
+-    return result;
++    return sstrdup(path);
+ }
+-- 
+2.27.0
+

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
new file mode 100644
index 000000000..6917aa091
--- /dev/null
+++ b/x11-wm/i3-rounded/files/i3-rounded-4.19-fix-docdir.patch
@@ -0,0 +1,22 @@
+diff --git a/meson.build b/meson.build
+index 11541e21..a6f8974e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -642,7 +642,7 @@ if get_option('docs')
+       '@OUTPUT@',
+     ],
+     install: true,
+-    install_dir: join_paths(get_option('datadir'), 'doc', 'i3'),
++    install_dir: docdir,
+   )
+ 
+   custom_target(
+@@ -655,7 +655,7 @@ if get_option('docs')
+       '@OUTPUT@',
+     ],
+     install: true,
+-    install_dir: join_paths(get_option('datadir'), 'doc', 'i3'),
++    install_dir: docdir,
+   )
+ endif
+ 

diff --git a/x11-wm/i3-rounded/i3-rounded-4.19.1.ebuild 
b/x11-wm/i3-rounded/i3-rounded-4.19.1.ebuild
new file mode 100644
index 000000000..b5eb41159
--- /dev/null
+++ b/x11-wm/i3-rounded/i3-rounded-4.19.1.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit meson optfeature
+
+DESCRIPTION="i3-gaps fork with rounded corners support."
+HOMEPAGE="https://github.com/linobigatti/i3-rounded";
+SRC_URI="https://github.com/linobigatti/i3-rounded/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc64 ~x86"
+IUSE="doc test"
+RESTRICT="!test? ( test )"
+
+COMMON_DEPEND="dev-libs/glib:2
+       dev-libs/libev
+       dev-libs/libpcre
+       dev-libs/yajl
+       x11-libs/cairo[X,xcb(+)]
+       x11-libs/libxcb[xkb]
+       x11-libs/libxkbcommon[X]
+       x11-libs/pango[X]
+       x11-libs/startup-notification
+       x11-libs/xcb-util
+       x11-libs/xcb-util-cursor
+       x11-libs/xcb-util-keysyms
+       x11-libs/xcb-util-wm
+       x11-libs/xcb-util-xrm"
+DEPEND="${COMMON_DEPEND}
+       test? (
+               dev-perl/ExtUtils-PkgConfig
+               dev-perl/IPC-Run
+               dev-perl/Inline
+               dev-perl/Inline-C
+               dev-perl/X11-XCB
+               dev-perl/XS-Object-Magic
+               x11-apps/xhost
+               x11-base/xorg-server[xephyr,xvfb]
+               x11-misc/xvfb-run
+       )"
+BDEPEND="app-text/asciidoc
+       app-text/xmlto
+       dev-lang/perl
+       virtual/pkgconfig"
+RDEPEND="${COMMON_DEPEND}
+       dev-lang/perl
+       dev-perl/AnyEvent-I3
+       dev-perl/JSON-XS
+       !x11-wm/i3"
+
+#S="${WORKDIR}/i3-rounded-${PV}"
+
+DOCS=( RELEASE-NOTES-$(ver_cut 1-3) )
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.18-musl.patch"
+       "${FILESDIR}/${PN}-4.19-fix-docdir.patch"
+)
+
+src_configure() {
+       local emesonargs=(
+               -Ddocdir="/usr/share/doc/${PF}"
+               -Ddocs=$(usex doc true false)
+               -Dmans=true
+       )
+
+       meson_src_configure
+}
+
+src_install() {
+       meson_src_install
+
+       exeinto /etc/X11/Sessions
+       newexe - i3wm <<- EOF
+               #!/usr/bin/env sh
+               exec /usr/bin/i3
+       EOF
+}
+
+pkg_postinst() {
+       optfeature "Application launcher" x11-misc/dmenu
+       optfeature "Simple screen locker" x11-misc/i3lock
+       optfeature "Status bar generator" x11-misc/i3status
+}

diff --git a/x11-wm/i3-rounded/metadata.xml b/x11-wm/i3-rounded/metadata.xml
new file mode 100644
index 000000000..5069f4b0c
--- /dev/null
+++ b/x11-wm/i3-rounded/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+       <maintainer type="person">
+               <email>[email protected]</email>
+               <name>Lino Bigatti</name>
+       </maintainer>
+       <upstream>
+               <remote-id type="github">linobigatti/i3-rounded</remote-id>
+       </upstream>
+</pkgmetadata>

Reply via email to