aboutsummaryrefslogtreecommitdiffstats
path: root/main/jsoncpp/APKBUILD
blob: f95fb0a1877920d069473dc633ac374ef34dbd36 (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
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=jsoncpp
pkgver=1.8.1
pkgrel=1
pkgdesc="JSON C++ library"
url="https://github.com/open-source-parsers/jsoncpp"
arch="all"
license="PublicDomain"
makedepends="scons python2-dev"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/open-source-parsers/jsoncpp/archive/$pkgver.tar.gz"
builddir="$srcdir"/jsoncpp-$pkgver

build() {
	cd "$builddir"
	# we cannot use cmake since jsoncpp is a dependency for cmake which
	# means we would get circular buildtime deps
	scons platform=linux-gcc

	# build a proper shared lib
	g++ -o libjsoncpp.so.0.0.0 -shared -Wl,-soname,libjsoncpp.so.0 \
		buildscons/linux-gcc-*/src/lib_json/*.os -lpthread

}

check() {
	cd "$builddir"
	scons check platform=linux-gcc
}

package() {
	cd "$builddir"

	mkdir -p "$pkgdir"/usr/lib
	cp "$builddir"/libjsoncpp.so.0.0.0 "$pkgdir"/usr/lib/
	ln -s libjsoncpp.so.0.0.0 "$pkgdir"/usr/lib/libjsoncpp.so.0
	ln -s libjsoncpp.so.0.0.0 "$pkgdir"/usr/lib/libjsoncpp.so

	mkdir -p "$pkgdir"/usr/include/jsoncpp
	cp -r "$builddir"/include/json/* "$pkgdir"/usr/include/jsoncpp/
	ln -s jsoncpp "$pkgdir"/usr/include/json

	mkdir -p "$pkgdir"/usr/lib/pkgconfig
	sed -e 's:@CMAKE_INSTALL_PREFIX@:/usr:g' \
		-e 's:@LIBRARY_INSTALL_DIR@:lib:g' \
		-e 's:@INCLUDE_INSTALL_DIR@:include/jsoncpp:g'\
		-e "s:@JSONCPP_VERSION@:$pkgver:g"\
		pkg-config/jsoncpp.pc.in \
		> "$pkgdir"/usr/lib/pkgconfig/jsoncpp.pc
}

sha512sums="4203826fca4c366b51d28ffc928399c914ffaba8be1cada64ff118b5742e6b469d3fc3e59344587d851447857b479794c5697d4fd11a9a55b32a3a7a801b745b  jsoncpp-1.8.1.tar.gz"