| 3 |
3 |
|
| 4 |
4 |
EAPI=8
|
| 5 |
5 |
|
| 6 |
|
inherit cmake-multilib
|
|
6 |
inherit meson-multilib
|
| 7 |
7 |
|
| 8 |
8 |
DESCRIPTION="A JSON implementation in C"
|
| 9 |
9 |
HOMEPAGE="https://github.com/json-c/json-c/wiki"
|
| ... | ... | |
| 12 |
12 |
EGIT_REPO_URI="https://github.com/json-c/json-c.git"
|
| 13 |
13 |
inherit git-r3
|
| 14 |
14 |
else
|
|
15 |
# https://github.com/json-c/json-c/wiki#obtain-sources
|
| 15 |
16 |
SRC_URI="https://s3.amazonaws.com/json-c_releases/releases/${P}.tar.gz"
|
| 16 |
17 |
|
| 17 |
|
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~x64-solaris"
|
|
18 |
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-solaris"
|
| 18 |
19 |
fi
|
| 19 |
20 |
|
| 20 |
21 |
LICENSE="MIT"
|
| 21 |
22 |
# .1 is a fudge factor for 0.18 fixing compat w/ 0.16, drop on next
|
| 22 |
23 |
# SONAME change.
|
| 23 |
24 |
SLOT="0/5.1"
|
| 24 |
|
IUSE="cpu_flags_x86_rdrand doc static-libs test threads"
|
|
25 |
IUSE="cpu_flags_x86_rdrand static-libs test threads"
|
| 25 |
26 |
RESTRICT="!test? ( test )"
|
| 26 |
27 |
|
| 27 |
|
BDEPEND="doc? ( >=app-text/doxygen-1.8.13 )"
|
| 28 |
|
|
| 29 |
28 |
MULTILIB_WRAPPED_HEADERS=(
|
| 30 |
29 |
/usr/include/json-c/config.h
|
| 31 |
30 |
)
|
| 32 |
31 |
|
| 33 |
|
PATCHES=( "${FILESDIR}/0.18.0-cmake4.patch" )
|
|
32 |
PATCHES=(
|
|
33 |
"${FILESDIR}"/${PN}-0.19-meson.patch
|
|
34 |
"${FILESDIR}"/${PN}-0.19-meson-conditionally-build-tests-with-an-option-not-b.patch
|
|
35 |
"${FILESDIR}"/${PN}-0.19-meson-wire-up-disable_extra_libs-option.patch
|
|
36 |
"${FILESDIR}"/${PN}-0.19-meson-fix-version-numbers.patch
|
|
37 |
"${FILESDIR}"/${PN}-0.19-meson-fix-pkgconfig-file.patch
|
|
38 |
)
|
| 34 |
39 |
|
| 35 |
40 |
multilib_src_configure() {
|
| 36 |
41 |
# Tests use Valgrind automagically otherwise (bug #927027)
|
| 37 |
42 |
export USE_VALGRIND=0
|
| 38 |
43 |
|
| 39 |
|
local mycmakeargs=(
|
| 40 |
|
# apps are not installed, so disable unconditionally.
|
| 41 |
|
# https://github.com/json-c/json-c/blob/json-c-0.17-20230812/apps/CMakeLists.txt#L119...L121
|
| 42 |
|
-DBUILD_APPS=OFF
|
| 43 |
|
-DBUILD_STATIC_LIBS=$(usex static-libs)
|
| 44 |
|
-DDISABLE_EXTRA_LIBS=ON
|
| 45 |
|
-DDISABLE_WERROR=ON
|
| 46 |
|
-DENABLE_RDRAND=$(usex cpu_flags_x86_rdrand)
|
| 47 |
|
-DENABLE_THREADING=$(usex threads)
|
| 48 |
|
-DBUILD_TESTING=$(usex test)
|
|
44 |
local emesonargs=(
|
|
45 |
# apps are not installed, so disable w/o tests.
|
|
46 |
# https://github.com/json-c/json-c/blob/json-c-0.17-20230812/apps/mesonLists.txt#L119...L121
|
|
47 |
$(meson_use test build_apps)
|
|
48 |
$(meson_use test build_tests)
|
|
49 |
-Ddefault_library=$(multilib_native_usex static-libs both shared)
|
|
50 |
-Dextra_libs=disabled
|
|
51 |
$(meson_use cpu_flags_x86_rdrand enable_rdrand)
|
|
52 |
$(meson_use threads enable_threading)
|
| 49 |
53 |
)
|
| 50 |
54 |
|
| 51 |
|
cmake_src_configure
|
| 52 |
|
}
|
| 53 |
|
|
| 54 |
|
multilib_src_compile() {
|
| 55 |
|
cmake_src_compile
|
| 56 |
|
if use doc && multilib_is_native_abi; then
|
| 57 |
|
cmake_build doc
|
| 58 |
|
fi
|
| 59 |
|
}
|
| 60 |
|
|
| 61 |
|
multilib_src_test() {
|
| 62 |
|
multilib_is_native_abi && cmake_src_test
|
| 63 |
|
}
|
| 64 |
|
|
| 65 |
|
multilib_src_install() {
|
| 66 |
|
cmake_src_install
|
| 67 |
|
|
| 68 |
|
if multilib_is_native_abi; then
|
| 69 |
|
use doc && HTML_DOCS=( "${BUILD_DIR}"/doc/html/. )
|
| 70 |
|
einstalldocs
|
| 71 |
|
fi
|
|
55 |
meson_src_configure
|
| 72 |
56 |
}
|