# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=nanomsg
pkgver=1.1.2
pkgrel=1
pkgdesc="A socket library that provides several common communication patterns"
url="http://nanomsg.org/"
arch="all !armhf"  # armhf: segfaults in 2 tests
license="MIT"
depends_dev="asciidoctor xmlto"
makedepends="$depends_dev cmake"
options="libtool"
subpackages="$pkgname-dev $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/$pkgver.tar.gz"

builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib .
	make
}

check() {
	cd "$builddir"
	make test
}

package() {
	cd "$builddir"
	make DESTDIR="${pkgdir}" install
	install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}

sha512sums="f95ce24b34c25d139cf3de46585f6354e0311a9d5e7135ad71df62b8bb5df26f81a58b9773c39c320df2d0e97cd2905a8576f9f00b0a4d33774f1b610271cee5  nanomsg-1.1.2.tar.gz"
