1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Contributor: Andrea Scarpino <andrea@archlinux.org>
3 # Contributor: Jonahtan Schaeffer <joschaeffer@gmail.com>
4 # COntributor: Drake Arconis <lightdrake@gmail.com>
7 pkgname=('jsoncpp' 'jsoncpp-doc')
10 pkgdesc='C++ library for interacting with JSON'
11 url='https://github.com/open-source-parsers/jsoncpp'
13 license=('MIT' 'custom:Public_Domain')
14 makedepends=('gcc-libs' 'doxygen' 'graphviz' 'python' 'meson')
15 options=('staticlibs')
16 source=(https://github.com/open-source-parsers/${pkgbase}/archive/${pkgver}/${pkgbase}-${pkgver}.tar.gz)
17 sha512sums=('1d06e044759b1e1a4cc4960189dd7e001a0a4389d7239a6d59295af995a553518e4e0337b4b4b817e70da5d9731a4c98655af90791b6287870b5ff8d73ad8873')
18 b2sums=('744275297647be8f1ac7bbf6c818e5106fc122591b3fb68c37cf33f5b3b7d6666e8429bb7ca2ae693202a5a83c274303804e21ebb27f05ba235568bf75a9b375')
21 cd ${pkgbase}-${pkgver}
22 echo "${pkgver}" > version
26 cd ${pkgbase}-${pkgver}
27 echo "Building shared library..."
28 arch-meson --default-library shared build
31 echo "Building static library..."
32 CXXFLAGS="$CXXFLAGS -ffat-lto-objects" \
33 arch-meson --default-library static build-static
36 echo "Building docs..."
38 --doxygen="$(command -v doxygen)" \
43 cd ${pkgbase}-${pkgver}
46 python runjsontests.py ../build/jsontestrunner
47 python rununittests.py ../build/jsoncpp_test
52 optdepends=('jsoncpp-doc: documentation')
53 provides=('libjsoncpp.so')
55 cd ${pkgbase}-${pkgver}
56 DESTDIR="${pkgdir}" ninja -C build install
57 DESTDIR="${pkgdir}" ninja -C build-static install
58 install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
59 install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
62 package_jsoncpp-doc() {
63 pkgdesc+=' (documentation)'
64 optdepends=('jsoncpp')
66 cd ${pkgbase}-${pkgver}
67 install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
68 install -dm 755 "${pkgdir}/usr/share/doc/${pkgbase}"
69 cp -a dist/doxygen/jsoncpp-api-html-${pkgver} "${pkgdir}/usr/share/doc/${pkgbase}/html"