# Maintainer: Jose-Luis Rivas <me@ghostbar.co>
pkgname=libuv
pkgver=1.12.0
_sover=${pkgver%.*}
pkgrel=0
pkgdesc="Cross-platform asychronous I/O"
url="http://libuv.org"
arch="all"
license="MIT and BSD and ISC"
depends=""
depends_dev=""
makedepends="$depends_dev automake autoconf \
	libtool linux-headers"
install=""
subpackages="$pkgname-dev"
source="http://dist.libuv.org/dist/v$pkgver/libuv-v$pkgver.tar.gz"
_builddir="$srcdir"/libuv-v$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	sh autogen.sh
	./configure --prefix=/usr
	make CFLAGS="$CFLAGS -D__USE_MISC" BUILDTYPE=Release
	install -Dm644 LICENSE \
		"$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="42a360f94aa00fa8be2c1ee68708ce947e26dc1e866f8053e2f3f719418bb27a84285ed2ebd1290d34b56ba78b9c921d2379407f5c52c4653d00e3f5f176afee  libuv-v1.12.0.tar.gz"
