jsoncpp-0.10.2-r1.ebuild 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  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. 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. PATCHES=(
  24. # fix broken path subst in .pc file
  25. "${FILESDIR}"/jsoncpp-1.6.2-fix-pkgconfig.patch
  26. "${FILESDIR}/${P}-arm.patch"
  27. )
  28. pkg_setup() {
  29. if use doc || use test; then
  30. python-any-r1_pkg_setup
  31. fi
  32. }
  33. src_configure() {
  34. local mycmakeargs=(
  35. -DJSONCPP_WITH_TESTS=$(usex test)
  36. -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF
  37. -DJSONCPP_WITH_CMAKE_PACKAGE=ON
  38. -DBUILD_SHARED_LIBS=ON
  39. # Follow Debian, Ubuntu, Arch convention for headers location
  40. # bug #452234
  41. -DINCLUDE_INSTALL_DIR="${EPREFIX}"/usr/include/jsoncpp
  42. )
  43. cmake-utils_src_configure
  44. }
  45. src_compile() {
  46. cmake-utils_src_compile
  47. if use doc; then
  48. "${EPYTHON}" doxybuild.py --doxygen=/usr/bin/doxygen || die
  49. fi
  50. }
  51. src_test() {
  52. emake -C "${BUILD_DIR}" jsoncpp_check
  53. }
  54. src_install() {
  55. cmake-utils_src_install
  56. if use doc; then
  57. dohtml dist/doxygen/jsoncpp*/*
  58. fi
  59. }