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