1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
8 inherit cmake-utils python-any-r1
10 DESCRIPTION="C++ JSON reader and writer"
11 HOMEPAGE="https://github.com/open-source-parsers/jsoncpp"
12 SRC_URI="https://github.com/open-source-parsers/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
14 LICENSE="|| ( public-domain MIT )"
16 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86"
29 RESTRICT="!test? ( test )"
32 if use doc || use test; then
33 python-any-r1_pkg_setup
39 -DJSONCPP_WITH_TESTS=$(usex test)
40 -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF
41 -DJSONCPP_WITH_CMAKE_PACKAGE=ON
43 -DBUILD_SHARED_LIBS=ON
45 # Follow Debian, Ubuntu, Arch convention for headers location
47 -DCMAKE_INSTALL_INCLUDEDIR=include/jsoncpp
49 # Disable implicit ccache use
52 cmake-utils_src_configure
56 cmake-utils_src_compile
59 cp "${BUILD_DIR}"/version . || die
60 "${EPYTHON}" doxybuild.py --doxygen="${EPREFIX}"/usr/bin/doxygen || die
61 HTML_DOCS=( dist/doxygen/jsoncpp*/. )
66 cmake-utils_src_make jsoncpp_check