# Contributor: Eivind Uggedal # Maintainer: Natanael Copa pkgname=hiredis pkgver=0.14.0 pkgrel=3 pkgdesc="Minimalistic C client library for Redis" url="https://github.com/redis/hiredis" arch="all" license="BSD-3-Clause" checkdepends="redis" subpackages="$pkgname-dev" source="$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz musl-test.patch" builddir="$srcdir/$pkgname-$pkgver" build() { cd "$builddir" make PREFIX=/usr DEBUG="$CFLAGS" LDFLAGS="$LDFLAGS" } check() { redis-server --dir "$builddir" --unixsocket "$builddir"/redis.sock& local _redispid=$! # make sure socket is available before we start running tests local _n=100 # wait up to 10 sec while ! [ -e "$builddir"/redis.sock ] && [ $_n -gt 0 ]; do sleep 0.1s _n=$(( $_n - 1)) done make hiredis-test ./hiredis-test -s "$builddir"/redis.sock || (kill $_redispid && false) kill $_redispid } package() { cd "$builddir" make PREFIX="$pkgdir"/usr install } sha512sums="57a81a35b4750f0ca9dba830789483667f8ca1559f13b0ebdc3fab3e34ad16b2809f9734cf88157041263784e11447556b7a748bfb7ef318a60bb5dda3e358a0 hiredis-0.14.0.tar.gz a16c212e6c391a0434ffbd865b241cebfc6f46acc282ac6a651fb2dea7e30991fe5a2ef267dded03eb13c6d4012d7588f9d1224596da4782bc93b5fd6829c117 musl-test.patch"