aboutsummaryrefslogtreecommitdiffstats
path: root/community/xerces-c/APKBUILD
blob: 19fe69f2496756fc61844a38a1e5ec71bf3c3457 (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
# Contributor: Andrew Bell <andrew.bell.ia@gmail.com>
# Maintainer: Andrew Bell <andrew.bell.ia@gmail.com>
pkgname=xerces-c
pkgver=3.2.2
pkgrel=3
pkgdesc="A validating XML parser written in a portable subset of C++"
url="https://xerces.apache.org/index.html"
arch="all"
license="Apache-2.0"
makedepends="
	cmake
	curl-dev
	icu-dev
	"
subpackages="$pkgname-samples $pkgname-doc $pkgname-dev"
_pkgver=${pkgver//./_}
_srcname="Xerces-C_$_pkgver"
source="https://github.com/apache/xerces-c/archive/$_srcname.tar.gz"
builddir="$srcdir/$pkgname-$_srcname"

build() {
	mkdir build && cd build

	local thread_support=-Dthreads:BOOL=ON
	case "$CARCH" in
		s390x) thread_support=-Dthreads:BOOL=OFF ;;
	esac
	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX="$pkgdir"/usr \
		$thread_support \
		-Dnetwork-accessor=curl \
		-Dmessage-loader=icu \
		-Dtranscoder=icu
	cmake --build .
}

package() {
	cd "$builddir"/build
	cmake  --build . --target install --config Release
}

samples() {
	pkgdesc="$pkgdesc (compiled samples)"

	mkdir -p $subpkgdir/usr
	mv $pkgdir/usr/bin $subpkgdir/usr
}

check() {
	cd "$builddir"/build
	ctest
}
sha512sums="66f60fe9194376ac0ca99d13ea5bce23ada86e0261dde30686c21ceb5499e754dab8eb0a98adadd83522bda62709377715501f6dac49763e3a686f9171cc63ea  Xerces-C_3_2_2.tar.gz"