summaryrefslogtreecommitdiff
path: root/testing/pulsar-client-cpp/APKBUILD
blob: 0ce1fc63f21b701f5a6aa1fc47492e8ad3485ab4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Contributor: Alex Yam <alex@alexyam.com>
# Maintainer: Alex Yam <alex@alexyam.com>
pkgname=pulsar-client-cpp
pkgver=2.10.1
pkgrel=1
pkgdesc="Apache Pulsar C++ client"
url="https://pulsar.apache.org/docs/en/client-libraries-cpp/"
arch="all"
#    Apache-2.0	: pulsar
#  BSD-2-Clause	: pulsar-client-cpp/lib/lz4/lz4.{h,c}
# 	   Zlib	: pulsar-client-cpp/lib/checksum/crc32c_sw.cc
license="Apache-2.0 AND BSD-2-Clause AND Zlib"
subpackages="$pkgname-static $pkgname-dev py3-pulsar-client-cpp:_py3"
options="!check" # test requires docker/java/pulsar-server
depends_dev="$pkgname"
makedepends="
	boost-dev
	cmake
	curl-dev
	openssl-dev
	protobuf-dev
	py3-setuptools
	python3-dev
	samurai
	snappy-dev
	zstd-dev
	"
source="apache-pulsar-$pkgver-src.tar.gz::https://www.apache.org/dyn/mirrors/mirrors.cgi?action=download&filename=pulsar/pulsar-$pkgver/apache-pulsar-$pkgver-src.tar.gz"
builddir="$srcdir/apache-pulsar-$pkgver-src/pulsar-client-cpp"

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_SKIP_BUILD_RPATH=true \
		-DBUILD_DYNAMIC_LIB=ON \
		-DBUILD_PERF_TOOLS=OFF \
		-DBUILD_PYTHON_WRAPPER=ON \
		-DBUILD_STATIC_LIB=ON \
		-DBUILD_TESTS=OFF \
		$CMAKE_CROSSOPTS .
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

_py3() {
	pkgdesc="Python bindings for Apache Pulsar C++ client"
	depends="python3"
	cd "$builddir"/python
	mv ../build/python/_pulsar.so .
	python3 setup.py install --prefix=/usr --root="$subpkgdir"
}

sha512sums="
19c078f65b9105728adda3926a9a1527d6498f0e2337d37497a6d965a38acf94e217e58939bc5b0a8b8166511ae9ee176ee3d0c764d4777e285b7bcaeb2731e1  apache-pulsar-2.10.1-src.tar.gz
"