app-shells/bash-completion: add 2.16.0
[gentoo/gentoo.git] / dev-cpp / libjson-rpc-cpp / libjson-rpc-cpp-1.4.0.ebuild
blobe80e82ba596428d546ade90e8c220edabc64bbae
1 # Copyright 1999-2022 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=8
6 inherit cmake
8 DESCRIPTION="JSON-RPC (1.0 & 2.0) framework for C++"
9 HOMEPAGE="https://github.com/cinemast/libjson-rpc-cpp/"
10 SRC_URI="
11         https://github.com/cinemast/${PN}/archive/v${PV}.tar.gz
12                 -> ${P}.tar.gz
15 LICENSE="MIT"
16 SLOT="0/1"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="+http-client +http-server redis-client redis-server +stubgen test"
19 RESTRICT="!test? ( test )"
21 DEPEND="
22         dev-libs/jsoncpp:=
23         http-client? ( net-misc/curl:= )
24         http-server? ( net-libs/libmicrohttpd:= )
25         redis-client? ( dev-libs/hiredis:= )
26         redis-server? ( dev-libs/hiredis:= )
27         stubgen? ( dev-libs/argtable:= )
29 RDEPEND="
30         ${DEPEND}
32 BDEPEND="
33         test? (
34                 <dev-cpp/catch-3
35         )
38 src_configure() {
39         local mycmakeargs=(
40                 -DHTTP_CLIENT=$(usex http-client)
41                 -DHTTP_SERVER=$(usex http-server)
42                 -DREDIS_CLIENT=$(usex redis-client)
43                 -DREDIS_SERVER=$(usex redis-server)
44                 # they have no deps
45                 -DTCP_SOCKET_CLIENT=ON
46                 -DTCP_SOCKET_SERVER=ON
47                 -DSERIAL_PORT_CLIENT=ON
48                 -DSERIAL_PORT_SERVER=ON
49                 -DUNIX_DOMAIN_SOCKET_CLIENT=ON
50                 -DUNIX_DOMAIN_SOCKET_SERVER=ON
51                 # they are not installed
52                 -DCOMPILE_EXAMPLES=OFF
53                 -DCOMPILE_STUBGEN=$(usex stubgen)
54                 -DCOMPILE_TESTS=$(usex test)
55                 # disable coverage-related flags
56                 -DWITH_COVERAGE=OFF
57         )
58         use test && mycmakeargs+=(
59                 -DCATCH_INCLUDE_DIR="${EPREFIX}/usr/include"
60         )
62         cmake_src_configure
65 src_test() {
66         # Tests fail randomly when run in parallel
67         local MAKEOPTS=-j1
68         cmake_src_test