libjson-rpc-cpp-0.6.0.ebuild 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit cmake-utils
  5. DESCRIPTION="JSON-RPC (1.0 & 2.0) framework for C++"
  6. HOMEPAGE="https://github.com/cinemast/libjson-rpc-cpp"
  7. SRC_URI="https://github.com/cinemast/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="MIT"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="doc +http-client +http-server +stubgen test"
  12. RDEPEND="
  13. dev-libs/jsoncpp:=
  14. http-client? ( net-misc/curl:= )
  15. http-server? ( net-libs/libmicrohttpd:= )
  16. stubgen? ( dev-libs/argtable:= )"
  17. DEPEND="${RDEPEND}
  18. doc? ( app-doc/doxygen )
  19. test? ( dev-cpp/catch )"
  20. RESTRICT="!test? ( test )"
  21. src_prepare() {
  22. default
  23. # https://github.com/cinemast/libjson-rpc-cpp/pull/161
  24. sed -i -e '/DESTINATION/s:lib:lib${LIB_SUFFIX}:' \
  25. src/jsonrpccpp/CMakeLists.txt || die
  26. }
  27. src_configure() {
  28. local mycmakeargs=(
  29. -DHTTP_CLIENT=$(usex http-client)
  30. -DHTTP_SERVER=$(usex http-server)
  31. # they are not installed but required for tests to build
  32. -DCOMPILE_EXAMPLES=$(usex test)
  33. -DCOMPILE_STUBGEN=$(usex stubgen)
  34. -DCOMPILE_TESTS=$(usex test)
  35. -DCATCH_INCLUDE_DIR="${EPREFIX}/usr/include/catch"
  36. )
  37. cmake-utils_src_configure
  38. }
  39. src_compile() {
  40. cmake-utils_src_compile
  41. use doc && emake -C "${BUILD_DIR}" doc
  42. }
  43. src_install() {
  44. cmake-utils_src_install
  45. use doc && dodoc -r "${BUILD_DIR}"/doc/html
  46. }