# Contributor: William Pitcock # Maintainer: William Pitcock 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"