# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=czmq
pkgver=4.1.1
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"
depends_dev="util-linux-dev zeromq-dev"
makedepends="$depends_dev cmake"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/zeromq/$pkgname/archive/v$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 install DESTDIR="$pkgdir"
}

sha512sums="c36d509e154a2142154f339294375bab0f6a2752f025a4489067bbddb22c4ef8f8e501797e755ac3779aa5c1c19397d32f7195ba80ae6b81e349f22c7634fb91  czmq-4.1.1.tar.gz"
