archrelease: copy trunk to extra-x86_64
[arch-packages.git] / jsoncpp / trunk / PKGBUILD
blob1d0dc47dcf9326b0abc51ec382f5aa8ffa2140b6
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>
6 pkgbase=jsoncpp
7 pkgname=('jsoncpp' 'jsoncpp-doc')
8 pkgver=1.9.5
9 pkgrel=2
10 pkgdesc='C++ library for interacting with JSON'
11 url='https://github.com/open-source-parsers/jsoncpp'
12 arch=('x86_64')
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')
20 prepare() {
21   cd ${pkgbase}-${pkgver}
22   echo "${pkgver}" > version
25 build() {
26   cd ${pkgbase}-${pkgver}
27   echo "Building shared library..."
28   arch-meson --default-library shared build
29   ninja -C build
31   echo "Building static library..."
32   CXXFLAGS="$CXXFLAGS -ffat-lto-objects" \
33   arch-meson --default-library static build-static
34   ninja -C build-static
36   echo "Building docs..."
37   python doxybuild.py \
38     --doxygen="$(command -v doxygen)" \
39     --with-dot
42 check() {
43   cd ${pkgbase}-${pkgver}
44   ninja -C build test
45   cd test
46   python runjsontests.py ../build/jsontestrunner
47   python rununittests.py ../build/jsoncpp_test
50 package_jsoncpp() {
51   depends=('gcc-libs')
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"
72 # vim: ts=2 sw=2 et: