From 00c39e4a2809927b8d11a6e69de739ad9acdbaba Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 17 Dec 2015 08:36:22 +0100 Subject: [PATCH] i3: use libglob to make GLOB_TILDE work as expected with musl. --- srcpkgs/i3/patches/musl.patch | 41 ----------------------------------- srcpkgs/i3/template | 16 +++++++++++++- 2 files changed, 15 insertions(+), 42 deletions(-) delete mode 100644 srcpkgs/i3/patches/musl.patch diff --git a/srcpkgs/i3/patches/musl.patch b/srcpkgs/i3/patches/musl.patch deleted file mode 100644 index 9f101821fe..0000000000 --- a/srcpkgs/i3/patches/musl.patch +++ /dev/null @@ -1,41 +0,0 @@ ---- ./libi3/resolve_tilde.c.orig 2015-10-07 20:13:31.744138877 -0400 -+++ ./libi3/resolve_tilde.c 2015-10-07 20:16:03.268127887 -0400 -@@ -18,6 +18,7 @@ - * or multiple matches are found, it just returns a copy of path as given. - * - */ -+#ifdef GLOB_TILDE - char *resolve_tilde(const char *path) { - static glob_t globbuf; - char *head, *tail, *result; -@@ -43,3 +44,8 @@ - - return result; - } -+#else -+char *resolve_tilde(const char *path) { -+ return strdup(path); -+} -+#endif ---- ./i3bar/src/main.c.orig 2015-10-07 20:17:02.226123611 -0400 -+++ ./i3bar/src/main.c 2015-10-07 20:20:58.476106477 -0400 -@@ -44,6 +44,7 @@ - * Glob path, i.e. expand ~ - * - */ -+#ifdef GLOB_TILDE - char *expand_path(char *path) { - static glob_t globbuf; - if (glob(path, GLOB_NOCHECK | GLOB_TILDE, NULL, &globbuf) < 0) { -@@ -54,6 +55,11 @@ - globfree(&globbuf); - return result; - } -+#else -+char *expand_path(char *path) { -+ return strdup(path); -+} -+#endif - - void print_usage(char *elf_name) { - printf("Usage: %s -b bar_id [-s sock_path] [-h] [-v]\n", elf_name); diff --git a/srcpkgs/i3/template b/srcpkgs/i3/template index e36bf5fdeb..e20dedaaa1 100644 --- a/srcpkgs/i3/template +++ b/srcpkgs/i3/template @@ -1,7 +1,7 @@ # Template file for 'i3' pkgname=i3 version=4.11 -revision=1 +revision=2 build_style=gnu-makefile hostmakedepends="pkg-config perl" makedepends="pcre-devel yajl-devel libxcb-devel libev-devel @@ -15,6 +15,20 @@ homepage="http://i3wm.org/" distfiles="${homepage}/downloads/${pkgname}-${version}.tar.bz2" checksum=78ce1e06fbd92fd63765bbe23faa7b8f929c17f99ed623f7abf2e568169d982f +case "$XBPS_TARGET_MACHINE" in + *-musl) makedepends+=" libglob-devel";; +esac + +pre_build() { + case "$XBPS_TARGET_MACHINE" in + *-musl) + sed -i '/LIBS =/s,-lm,& /usr/lib/libglob.a,g' common.mk + sed -i '/include/s,glob.h,libglob/glob.h,g' i3bar/src/main.c libi3/resolve_tilde.c + sed -i '/GLOB_TILDE/s/glob(/g_glob(/g' i3bar/src/main.c libi3/resolve_tilde.c + sed -i 's/globfree(/g_globfree(/g' i3bar/src/main.c libi3/resolve_tilde.c + ;; + esac +} post_install() { vlicense LICENSE vmkdir usr/share/man/man1