NAME="jsoncpp"
DESC="A C++ library for interacting with JSON"
VERSION="1.9.5"
FILES=("https://github.com/open-source-parsers/jsoncpp/archive/refs/tags/$VERSION.tar.gz")
HASHES=("1d06e044759b1e1a4cc4960189dd7e001a0a4389d7239a6d59295af995a553518e4e0337b4b4b817e70da5d9731a4c98655af90791b6287870b5ff8d73ad8873")
DEPENDS=("gcc-libs")

PACKAGE() {
  tar xf $VERSION.tar.gz
  cd $NAME-$VERSION

  echo "$VERSION" > version
  python3 doxybuild.py                \
    --doxygen="$(command -v doxygen)" \
    --with-dot

  install -dm 755 "$ROOTDIR/usr/share/doc/jsoncpp"
  cp -a dist/doxygen/jsoncpp-api-html-$VERSION "$ROOTDIR/usr/share/doc/jsoncpp/html"

  mkdir build
  cd    build

  meson --prefix=/usr --default-library shared ..
  ninja && DESTDIR="$ROOTDIR" ninja install
  
  cd ../.. && rm -r $NAME-$VERSION
}
