*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-libs / jsoncpp / jsoncpp-1.9.2-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8} )
7
8 inherit cmake-utils python-any-r1
9
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"
13
14 LICENSE="|| ( public-domain MIT )"
15 SLOT="0/22"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 DEPEND="
21         doc? (
22                 app-doc/doxygen
23                 ${PYTHON_DEPS}
24         )
25         test? (
26                 ${PYTHON_DEPS}
27         )"
28 RDEPEND=""
29
30 pkg_setup() {
31         if use doc || use test; then
32                 python-any-r1_pkg_setup
33         fi
34 }
35
36 src_configure() {
37         local mycmakeargs=(
38                 -DJSONCPP_WITH_TESTS=$(usex test)
39                 -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF
40                 -DJSONCPP_WITH_CMAKE_PACKAGE=ON
41
42                 -DBUILD_SHARED_LIBS=ON
43
44                 # Follow Debian, Ubuntu, Arch convention for headers location
45                 # bug #452234
46                 -DCMAKE_INSTALL_INCLUDEDIR=include/jsoncpp
47
48                 # Disable implicit ccache use
49                 -DCCACHE_FOUND=OFF
50         )
51         cmake-utils_src_configure
52 }
53
54 src_compile() {
55         cmake-utils_src_compile
56
57         if use doc; then
58                 cp "${BUILD_DIR}"/version . || die
59                 "${EPYTHON}" doxybuild.py --doxygen="${EPREFIX}"/usr/bin/doxygen || die
60                 HTML_DOCS=( dist/doxygen/jsoncpp*/. )
61         fi
62 }
63
64 src_test() {
65         cmake-utils_src_make jsoncpp_check
66 }