diff options
author | A. Wilcox <awilcox@wilcox-tech.com> | 2019-02-16 14:11:50 +0000 |
---|---|---|
committer | A. Wilcox <awilcox@wilcox-tech.com> | 2019-02-16 14:11:50 +0000 |
commit | 0ea9f15945803c23e6bf9ce4016d643eef081ff3 (patch) | |
tree | 62fac57545c8fbbdeba8afcbddb1fa9c291051c0 | |
parent | e1253201e3e6a772f2eff75bdc62d6166d0ffece (diff) | |
parent | 86bc76ab639608f85d71c8858173661ae2726c95 (diff) | |
download | packages-0ea9f15945803c23e6bf9ce4016d643eef081ff3.tar.gz packages-0ea9f15945803c23e6bf9ce4016d643eef081ff3.tar.bz2 packages-0ea9f15945803c23e6bf9ce4016d643eef081ff3.tar.xz packages-0ea9f15945803c23e6bf9ce4016d643eef081ff3.zip |
Merge branch 'i3status' into 'master'
New packages: i3status and confuse
See merge request !154
-rw-r--r-- | user/confuse/APKBUILD | 41 | ||||
-rw-r--r-- | user/i3status/APKBUILD | 35 | ||||
-rw-r--r-- | user/i3status/glob_tilde.patch | 59 |
3 files changed, 135 insertions, 0 deletions
diff --git a/user/confuse/APKBUILD b/user/confuse/APKBUILD new file mode 100644 index 000000000..3fe8f33b4 --- /dev/null +++ b/user/confuse/APKBUILD @@ -0,0 +1,41 @@ +# Contributor: Luis Ressel <aranea@aixah.de> +# Maintainer: Luis Ressel <aranea@aixah.de> +pkgname=confuse +pkgver=3.2.2 +pkgrel=0 +pkgdesc="Small configuration file parser library for C" +url="https://github.com/martinh/libconfuse" +arch="all" +options="!checkroot" +license="ISC" +depends="" +makedepends="" +subpackages="$pkgname-dev $pkgname-doc $pkgname-lang" +source="$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.xz" + +build() { + cd "$builddir" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --disable-rpath \ + --disable-examples \ + --enable-nls + make +} + +check() { + cd "$builddir" + make check +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install +} + +sha512sums="c6baea65e064fe7f2d1bde187c6dcbb7f03c31f5d777cb04576f9cc2d94e9c96b7ee202e030e9a2c7eb619deb240d9e76fb12b3528ae5aa0d3abe231354d12c9 confuse-3.2.2.tar.xz" diff --git a/user/i3status/APKBUILD b/user/i3status/APKBUILD new file mode 100644 index 000000000..554916af7 --- /dev/null +++ b/user/i3status/APKBUILD @@ -0,0 +1,35 @@ +# Contributor: Luis Ressel <aranea@aixah.de> +# Maintainer: Luis Ressel <aranea@aixah.de> +pkgname=i3status +pkgver=2.12 +pkgrel=0 +pkgdesc="Status bar generator for dzen2, xmobar or similar" +url="https://i3wm.org/i3status/" +arch="all" +options="!check" # No test suite +license="MIT" +depends="" +makedepends="alsa-lib-dev confuse-dev libnl3-dev pkgconf pulseaudio-dev yajl-dev" +subpackages="$pkgname-doc" +source="$url/$pkgname-$pkgver.tar.bz2 + glob_tilde.patch" + +prepare() { + cd "$builddir" + default_prepare + # TODO: The setcap part can be dropped after the 2.13 release + sed -i -e '/^CFLAGS+=-g$/d' -e '/setcap/d' Makefile +} + +build() { + cd "$builddir" + make i3status +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install +} + +sha512sums="687a880a65cb8df46f5e9d2256b59724ba3424c502e9a0fb3ca71b070875df5f4008ee501c554bc716f2d728a5cf813a36d22d7377d42c3c46b14381d385bab3 i3status-2.12.tar.bz2 +2a0a85dba02b9e9962f13d4bc151fd1672f215292800d9eeff5a10bd363b74f422d3b320851f31b73062ceeded974f5b105aec914c84f78ba418312bed189aa4 glob_tilde.patch" diff --git a/user/i3status/glob_tilde.patch b/user/i3status/glob_tilde.patch new file mode 100644 index 000000000..b1f2ba667 --- /dev/null +++ b/user/i3status/glob_tilde.patch @@ -0,0 +1,59 @@ +diff --git i/i3status.c w/i3status.c +index 5088c96..3c18214 100644 +--- i/i3status.c ++++ w/i3status.c +@@ -210,29 +210,19 @@ static int valid_color(const char *value) { + * + */ + static char *resolve_tilde(const char *path) { +- static glob_t globbuf; +- char *head, *tail, *result = NULL; +- +- tail = strchr(path, '/'); +- head = strndup(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) { +- die("glob() failed"); +- } else { +- head = globbuf.gl_pathv[0]; +- result = scalloc(strlen(head) + (tail ? strlen(tail) : 0) + 1); +- strncpy(result, head, strlen(head)); +- if (tail) +- strncat(result, tail, strlen(tail)); ++ char *home, *result = NULL; ++ ++ if (strncmp(path, "~/", 2) == 0) { ++ home = getenv("HOME"); ++ if (home != NULL) { ++ result = scalloc(strlen(home) + strlen(path)); ++ strcpy(result, home); ++ strcat(result, path+1); ++ return result; ++ } + } +- globfree(&globbuf); + +- return result; ++ return sstrdup(path); + } + + static char *get_config_path(void) { +diff --git i/include/i3status.h w/include/i3status.h +index 9ac471d..27ecae4 100644 +--- i/include/i3status.h ++++ w/include/i3status.h +@@ -236,4 +236,9 @@ extern cfg_t *cfg, *cfg_general, *cfg_section; + extern void **cur_instance; + + extern pthread_t main_thread; ++ ++#ifndef GLOB_TILDE ++#define GLOB_TILDE 0 ++#endif ++ + #endif |