commit:     5e19b9fce12ec9abab5948ddfccaf74b620e93d9
Author:     Nelo-T. Wallus <nelo <AT> wallus <DOT> de>
AuthorDate: Wed Nov  7 20:40:33 2018 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Thu Nov  8 09:49:15 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e19b9fc

x11-wm/i3: Bump to v4.16

Closes: https://bugs.gentoo.org/670570
Package-Manager: Portage-2.3.51, Repoman-2.3.10

Signed-off-by: Nelo-Thara Nahum Nathanael Wallus <nelo <AT> wallus.de>
Closes: https://github.com/gentoo/gentoo/pull/10357
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 x11-wm/i3/Manifest                            |   1 +
 x11-wm/i3/files/i3-4.16-musl-GLOB_TILDE.patch |  86 ++++++++++++++++++++
 x11-wm/i3/i3-4.16.ebuild                      | 110 ++++++++++++++++++++++++++
 3 files changed, 197 insertions(+)

diff --git a/x11-wm/i3/Manifest b/x11-wm/i3/Manifest
index 918f8f2a026..37fd66cefdd 100644
--- a/x11-wm/i3/Manifest
+++ b/x11-wm/i3/Manifest
@@ -2,3 +2,4 @@ DIST i3-4.13.tar.bz2 1121298 BLAKE2B 
94f3940406d43083c8dc577b4216a32a08ad4c4b58e
 DIST i3-4.14.1.tar.bz2 1173560 BLAKE2B 
96a0e1d75be13098fd530c3970464ce7710063f517c0d538939de6e7c799ab6b3ec005fb50216b1db4ccefd44584c584b263ac359bd9a86be53418d8f8d4beba
 SHA512 
ef628af002947b40e1c88b0e872c6e93d4377a9674a120bd9adc3f323a38570b05124cd3047b5a26659e72070de2d00d83fb93186510c74ad8ddbf4f3df85472
 DIST i3-4.14.tar.gz 3936748 BLAKE2B 
42678130be56bc695e5700e978ddbd34bfdaeda7a65252a05568581d76fe613e80e710f3a507110e7988077fe62048bf984d4009e722d877b178206cef600221
 SHA512 
fe3db78813987a15ed93d182968bcd5139e1d03f29d3e8effd9fce59f87bc8309407af0b2fa5f1cd83b8583e50ea0ade6b8eafc5dda6dea9161832dc9cebfdfe
 DIST i3-4.15.tar.bz2 1196263 BLAKE2B 
36f20327202957dba30aface91af4d2c6261979e726584712a508a11cb4a612d812e771dc9f28ec4cfcbf3ebc9d92c72f5e940048516cca0f185eab20f95ae32
 SHA512 
60ab61b7e380342126bea12fb4371f98fcf18f6435f79a9519d3f59cfabdb170634366036e1aa20c5592da0832b03140ad1f0c72bad3cfaace0b7c57ad01dfc4
+DIST i3-4.16.tar.bz2 1213251 BLAKE2B 
a65d15278a83bac9903a611628ea53c64cd554ab9fff2a8864e649fd962858b2f3e77fe69d0dc70affc93dc69b3cbbd7b3ee670a2af9d697e28e9e4ea3323f67
 SHA512 
99abd15349ee8e61c084b3664ef3a189c92ea07812ac59eb6a5441df7cebea8211be52204e39bddcc33d8c714447fddbbe2c5c8a25b756a96e2dc6732526cbf8

diff --git a/x11-wm/i3/files/i3-4.16-musl-GLOB_TILDE.patch 
b/x11-wm/i3/files/i3-4.16-musl-GLOB_TILDE.patch
new file mode 100644
index 00000000000..1e67ec2a3c4
--- /dev/null
+++ b/x11-wm/i3/files/i3-4.16-musl-GLOB_TILDE.patch
@@ -0,0 +1,86 @@
+From: Natanael Copa <[email protected]>
+Patch-Source: 
https://git.alpinelinux.org/cgit/aports/tree/community/i3wm/musl.patch
+Project-Bug-URL: https://github.com/i3/i3/issues/1859
+Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=609306
+
+Musl doesn't implement GLOB_TILDE, which is used by i3 when expanding paths.
+
+This patch replaces usage of GLOB_TILDE in glob() by replacing tilde
+with the content of $HOME - if set - manually.
+
+As mentioned in the i3 bugtracker this is an issue that should be solved by 
musl.
+
+A patch has been sent to musl upstream, but it hasn't been merged yet:
+http://www.openwall.com/lists/musl/2017/01/17/1
+---
+--- a/i3bar/src/main.c
++++ b/i3bar/src/main.c
+@@ -48,14 +48,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);
+ }
+
+ 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);
+ }

diff --git a/x11-wm/i3/i3-4.16.ebuild b/x11-wm/i3/i3-4.16.ebuild
new file mode 100644
index 00000000000..270dae55f6a
--- /dev/null
+++ b/x11-wm/i3/i3-4.16.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools out-of-source virtualx
+
+DESCRIPTION="An improved dynamic tiling window manager"
+HOMEPAGE="https://i3wm.org/";
+SRC_URI="https://i3wm.org/downloads/${P}.tar.bz2";
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="doc debug test"
+
+CDEPEND="dev-libs/libev
+       dev-libs/libpcre
+       >=dev-libs/yajl-2.0.3
+       x11-libs/libxcb[xkb]
+       x11-libs/libxkbcommon[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
+       x11-misc/xkeyboard-config
+       >=x11-libs/cairo-1.14.4[X,xcb]
+       >=x11-libs/pango-1.30.0[X]"
+DEPEND="${CDEPEND}
+       test? (
+               dev-perl/AnyEvent
+               >=dev-perl/X11-XCB-0.120.0
+               dev-perl/Inline
+               dev-perl/Inline-C
+               dev-perl/IPC-Run
+               dev-perl/ExtUtils-PkgConfig
+               dev-perl/local-lib
+               >=virtual/perl-Test-Simple-0.940.0
+               x11-base/xorg-server[xephyr]
+       )
+       virtual/pkgconfig"
+RDEPEND="${CDEPEND}
+       dev-lang/perl
+       dev-perl/AnyEvent-I3
+       dev-perl/JSON-XS"
+
+# Test without debug will apply optimization levels, which results
+# in type-punned pointers - which in turn causes test failures.
+REQUIRED_USE="test? ( debug )"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-4.16-musl-GLOB_TILDE.patch"
+)
+
+# https://github.com/i3/i3/issues/3013
+RESTRICT="test"
+
+src_prepare() {
+       default
+
+       cat <<- EOF > "${T}"/i3wm
+               #!/bin/sh
+               exec /usr/bin/i3
+       EOF
+
+       eautoreconf
+}
+
+my_src_configure() {
+       local myeconfargs=(
+               $(use_enable debug)
+       )
+       econf "${myeconfargs[@]}"
+}
+
+my_src_test() {
+       emake \
+               test.commands_parser \
+               test.config_parser \
+               test.inject_randr15
+
+       virtx perl \
+               -I "${S}/testcases/lib" \
+               -I "${BUILD_DIR}/testcases/lib" \
+               testcases/complete-run.pl
+}
+
+my_src_install_all() {
+       doman man/*.1
+
+       einstalldocs
+       use doc && dodoc -r docs "RELEASE-NOTES-${PV}"
+
+       exeinto /etc/X11/Sessions
+       doexe "${T}/i3wm"
+}
+
+pkg_postinst() {
+       # Only show the elog information on a new install
+       if [[ ! ${REPLACING_VERSIONS} ]]; then
+               elog "There are several packages that you may find useful with 
${PN} and"
+               elog "their usage is suggested by the upstream maintainers, 
namely:"
+               elog "  x11-misc/dmenu"
+               elog "  x11-misc/i3status"
+               elog "  x11-misc/i3lock"
+               elog "Please refer to their description for additional info."
+       fi
+}

Reply via email to