1 |
|
# Copyright 1999-2023 Gentoo Authors
|
|
1 |
# Copyright 1999-2022 Gentoo Authors
|
2 |
2 |
# Distributed under the terms of the GNU General Public License v2
|
3 |
3 |
|
4 |
4 |
EAPI=8
|
5 |
5 |
|
|
6 |
#DOCS_BUILDER="mkdocs"
|
|
7 |
# Needs unpackaged plantuml-markdown too
|
|
8 |
# ... but plantuml (Python bindings anyway) need network access to generate bits at runtime.
|
|
9 |
#DOCS_DEPEND="dev-python/mkdocs-material-extensions dev-python/mkdocs-minify-plugin"
|
|
10 |
#DOCS_DIR="doc/mkdocs"
|
6 |
11 |
inherit cmake
|
7 |
12 |
|
8 |
13 |
# Check https://github.com/nlohmann/json/blob/develop/cmake/download_test_data.cmake to find test archive version
|
9 |
|
TEST_VERSION="3.0.0"
|
|
14 |
TEST_VERSION="3.1.0"
|
10 |
15 |
DESCRIPTION="JSON for Modern C++"
|
11 |
16 |
HOMEPAGE="https://github.com/nlohmann/json https://nlohmann.github.io/json/"
|
12 |
17 |
SRC_URI="
|
13 |
18 |
https://github.com/nlohmann/json/archive/v${PV}.tar.gz -> ${P}.tar.gz
|
14 |
|
test? ( https://github.com/nlohmann/json_test_data/archive/v${TEST_VERSION}.tar.gz -> ${PN}-testdata-${TEST_VERSION}.tar.gz )
|
15 |
|
"
|
|
19 |
test? ( https://github.com/nlohmann/json_test_data/archive/v${TEST_VERSION}.tar.gz -> ${PN}-testdata-${TEST_VERSION}.tar.gz )"
|
16 |
20 |
S="${WORKDIR}/json-${PV}"
|
17 |
21 |
|
18 |
22 |
LICENSE="MIT"
|
19 |
23 |
SLOT="0"
|
20 |
|
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
|
21 |
|
IUSE="doc test"
|
22 |
|
#RESTRICT="!test? ( test )"
|
23 |
|
# Need to report failing tests upstream
|
24 |
|
# Tests only just added, large test suite, majority pass
|
25 |
|
RESTRICT="test"
|
26 |
|
|
27 |
|
BDEPEND="doc? ( app-doc/doxygen )"
|
|
24 |
KEYWORDS="amd64 ~arm arm64 ppc ppc64 ~riscv x86"
|
|
25 |
IUSE="test"
|
|
26 |
RESTRICT="!test? ( test )"
|
28 |
27 |
|
29 |
28 |
DOCS=( ChangeLog.md README.md )
|
30 |
29 |
|
|
30 |
src_prepare() {
|
|
31 |
if use test ; then
|
|
32 |
ln -s "${WORKDIR}"/json_test_data-${TEST_VERSION} "${S}"/json_test_data || die
|
|
33 |
fi
|
|
34 |
|
|
35 |
cmake_src_prepare
|
|
36 |
}
|
|
37 |
|
31 |
38 |
src_configure() {
|
32 |
39 |
# Tests are built by default so we can't group the test logic below
|
33 |
40 |
local mycmakeargs=(
|
... | ... | |
41 |
48 |
cmake_src_configure
|
42 |
49 |
}
|
43 |
50 |
|
44 |
|
src_compile() {
|
45 |
|
cmake_src_compile
|
46 |
|
|
47 |
|
if use doc; then
|
48 |
|
emake -C doc
|
49 |
|
HTML_DOCS=( doc/html/. )
|
50 |
|
fi
|
51 |
|
}
|
52 |
|
|
53 |
51 |
src_test() {
|
54 |
|
cd "${BUILD_DIR}/test" || die
|
|
52 |
cd "${BUILD_DIR}"/tests || die
|
55 |
53 |
|
|
54 |
# git_required:
|
56 |
55 |
# Skip certain tests needing git per upstream
|
57 |
56 |
# https://github.com/nlohmann/json/issues/2189
|
|
57 |
#
|
|
58 |
# cmake_fetch_content_configure, cmake_fetch_content2_configure:
|
|
59 |
# Needs network (bug #865027, bug #865105)
|
58 |
60 |
local myctestargs=(
|
59 |
|
"-LE git_required"
|
|
61 |
-E "(git_required|cmake_fetch_content_configure|cmake_fetch_content2_configure|cmake_fetch_content_build|cmake_fetch_content2_build)"
|
60 |
62 |
)
|
61 |
63 |
|
62 |
64 |
cmake_src_test
|