From ca513f3f7ebc0d441f2d7089b909b2c0068fd708 Mon Sep 17 00:00:00 2001 From: prspkt Date: Sun, 11 Mar 2018 01:02:12 +0000 Subject: testing/i3wm-gaps: upgrade to 4.15, clarify license --- testing/i3wm-gaps/APKBUILD | 40 +++++++-------- testing/i3wm-gaps/i3wm-musl-glob-tilde.patch | 73 ++++++++++++++++++++++++++++ testing/i3wm-gaps/musl.patch | 73 ---------------------------- 3 files changed, 94 insertions(+), 92 deletions(-) create mode 100644 testing/i3wm-gaps/i3wm-musl-glob-tilde.patch delete mode 100644 testing/i3wm-gaps/musl.patch (limited to 'testing') diff --git a/testing/i3wm-gaps/APKBUILD b/testing/i3wm-gaps/APKBUILD index 7133f06f3e1..399eeb4e18b 100644 --- a/testing/i3wm-gaps/APKBUILD +++ b/testing/i3wm-gaps/APKBUILD @@ -1,11 +1,11 @@ # Maintainer: pkgname=i3wm-gaps -pkgver=4.14.1 +pkgver=4.15 pkgrel=0 -pkgdesc="A tiling window manager with gaps and other additional features" +pkgdesc="Improved dynamic tiling window manager with additional features" url="https://github.com/Airblader/i3" arch="all" -license="BSD" +license="BSD-3-Clause" replaces="i3wm" makedepends="bison flex libxcb-dev xcb-util-cursor-dev xcb-util-keysyms-dev xcb-util-wm-dev libev-dev pango-dev cairo-dev @@ -13,30 +13,32 @@ makedepends="bison flex libxcb-dev xcb-util-cursor-dev xcb-util-xrm-dev asciidoc perl xmlto autoconf automake libtool" subpackages="$pkgname-doc" source="i3wm-$pkgver.tar.gz::https://github.com/Airblader/i3/archive/$pkgver.tar.gz - musl.patch" - + i3wm-musl-glob-tilde.patch + " builddir="$srcdir/i3-$pkgver" build() { cd "$srcdir/i3-$pkgver" - autoreconf -fi - ./configure --prefix="/usr" --sysconfdir="/etc" --disable-builddir - make -} - -package() { - cd "$builddir" - make DESTDIR="$pkgdir/" install - - install -d "$pkgdir/usr/share/man/man1" - install -m644 man/*.1 "$pkgdir"/usr/share/man/man1/ + autoreconf -fi + ./configure \ + --prefix="/usr" \ + --sysconfdir="/etc" \ + --disable-builddir + make } check() { cd "$builddir" - ./i3 --version + ./i3 --version > /dev/null } +package() { + cd "$builddir" + make DESTDIR="$pkgdir/" install + + install -d "$pkgdir/usr/share/man/man1" + install -m644 man/*.1 "$pkgdir"/usr/share/man/man1/ +} -sha512sums="1f8ce8d886e38ea940d6b134c156d77d1e95367fd82bb750f9797a8a915d295846ecfbd1884a241676fba2e23f507775d9943a640553671ae9deaf87b705acd4 i3wm-4.14.1.tar.gz -8ce7d00371c43b93dabbe0dadf9caf7c58a68f4a0079f5a9b9552c15c55bfa0df16d7e87a281595af2ac5254632ba28ccf82a467cea16159b41490f6f2910299 musl.patch" +sha512sums="83a36a1db7099f8a9a6f9ad1c7434a187a75ccd8f6fd4e4442a912a3409b851fb8153d9c3e72d68dcfaedce8b6f0ad249e08226238c82873bc0691dbf94c7fda i3wm-4.15.tar.gz +8ce7d00371c43b93dabbe0dadf9caf7c58a68f4a0079f5a9b9552c15c55bfa0df16d7e87a281595af2ac5254632ba28ccf82a467cea16159b41490f6f2910299 i3wm-musl-glob-tilde.patch" diff --git a/testing/i3wm-gaps/i3wm-musl-glob-tilde.patch b/testing/i3wm-gaps/i3wm-musl-glob-tilde.patch new file mode 100644 index 00000000000..82ad6195b8e --- /dev/null +++ b/testing/i3wm-gaps/i3wm-musl-glob-tilde.patch @@ -0,0 +1,73 @@ +diff -urp i3-4.11/i3bar/src/main.c i3-4.11.new/i3bar/src/main.c +--- i3-4.11/i3bar/src/main.c 2015-09-30 07:55:10.000000000 +0100 ++++ i3-4.11.new/i3bar/src/main.c 2016-02-08 20:03:41.777392482 +0000 +@@ -45,14 +45,20 @@ void debuglog(char *fmt, ...) { + * + */ + 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) { +diff -urp i3-4.11/libi3/resolve_tilde.c i3-4.11.new/libi3/resolve_tilde.c +--- i3-4.11/libi3/resolve_tilde.c 2015-09-30 07:55:10.000000000 +0100 ++++ i3-4.11.new/libi3/resolve_tilde.c 2016-02-08 20:03:47.849230953 +0000 +@@ -19,27 +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); +- strncpy(result, head, strlen(head)); +- if (tail) +- strncat(result, tail, strlen(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/testing/i3wm-gaps/musl.patch b/testing/i3wm-gaps/musl.patch deleted file mode 100644 index 82ad6195b8e..00000000000 --- a/testing/i3wm-gaps/musl.patch +++ /dev/null @@ -1,73 +0,0 @@ -diff -urp i3-4.11/i3bar/src/main.c i3-4.11.new/i3bar/src/main.c ---- i3-4.11/i3bar/src/main.c 2015-09-30 07:55:10.000000000 +0100 -+++ i3-4.11.new/i3bar/src/main.c 2016-02-08 20:03:41.777392482 +0000 -@@ -45,14 +45,20 @@ void debuglog(char *fmt, ...) { - * - */ - 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) { -diff -urp i3-4.11/libi3/resolve_tilde.c i3-4.11.new/libi3/resolve_tilde.c ---- i3-4.11/libi3/resolve_tilde.c 2015-09-30 07:55:10.000000000 +0100 -+++ i3-4.11.new/libi3/resolve_tilde.c 2016-02-08 20:03:47.849230953 +0000 -@@ -19,27 +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); -- strncpy(result, head, strlen(head)); -- if (tail) -- strncat(result, tail, strlen(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); - } -- cgit v1.2.3