jsoncpp-1.8.0.ebuild 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. inherit cmake-utils python-any-r1
  6. DESCRIPTION="C++ JSON reader and writer"
  7. HOMEPAGE="https://github.com/open-source-parsers/jsoncpp"
  8. SRC_URI="https://github.com/open-source-parsers/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
  9. LICENSE="|| ( public-domain MIT )"
  10. SLOT="0/11"
  11. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
  12. IUSE="doc test"
  13. DEPEND="
  14. doc? (
  15. app-doc/doxygen
  16. ${PYTHON_DEPS}
  17. )
  18. test? (
  19. ${PYTHON_DEPS}
  20. )"
  21. RDEPEND=""
  22. RESTRICT="!test? ( test )"
  23. pkg_setup() {
  24. if use doc || use test; then
  25. python-any-r1_pkg_setup
  26. fi
  27. }
  28. src_configure() {
  29. local mycmakeargs=(
  30. -DJSONCPP_WITH_TESTS=$(usex test)
  31. -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF
  32. -DJSONCPP_WITH_CMAKE_PACKAGE=ON
  33. -DBUILD_SHARED_LIBS=ON
  34. -DBUILD_STATIC_LIBS=OFF
  35. # Follow Debian, Ubuntu, Arch convention for headers location
  36. # bug #452234
  37. -DCMAKE_INSTALL_INCLUDEDIR=include/jsoncpp
  38. # Disable implicit ccache use
  39. -DCCACHE_FOUND=OFF
  40. )
  41. cmake-utils_src_configure
  42. }
  43. src_compile() {
  44. cmake-utils_src_compile
  45. if use doc; then
  46. "${EPYTHON}" doxybuild.py --doxygen="${EPREFIX}"/usr/bin/doxygen || die
  47. HTML_DOCS=( dist/doxygen/jsoncpp*/. )
  48. fi
  49. }
  50. src_test() {
  51. emake -C "${BUILD_DIR}" jsoncpp_check
  52. }