# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=czmq
pkgver=4.1.0
pkgrel=0
pkgdesc="High-level C binding for ZeroMQ"
url="http://czmq.zeromq.org/"
arch="all !s390x"  # zproxy test timeouts on s390x
license="MPL-2.0"
makedepends="cmake zeromq-dev"
subpackages="$pkgname-dev"
source="https://github.com/zeromq/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"

	# Note: One test segfaults when built with MinSizeRel (-Os).
	cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_VERBOSE_MAKEFILE=ON
	make
}

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

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

sha512sums="59104415c302768916412cec852d934bec70db2313ff25db68aefc3ddf2b18488d2bc314c4ce585839b9778e71008433e39f23ef6decc3e9a42801729187360e  czmq-4.1.0.tar.gz"
