summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2021-09-25 19:04:31 +0100
committerSam James <sam@gentoo.org>2021-09-25 19:10:31 +0100
commitc9432932ce09503681f1da126c99b595e313dc47 (patch)
tree2b08e71dfc84bea6f900ae18adf5d607a42333c6 /dev-cpp/nlohmann_json/nlohmann_json-3.10.2.ebuild
parentdev-libs/crypto++: add 8.6.0 (diff)
downloadgentoo-c9432932ce09503681f1da126c99b595e313dc47.tar.gz
gentoo-c9432932ce09503681f1da126c99b595e313dc47.tar.bz2
gentoo-c9432932ce09503681f1da126c99b595e313dc47.zip
dev-cpp/nlohmann_json: add 3.10.2
Closes: https://bugs.gentoo.org/814833 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-cpp/nlohmann_json/nlohmann_json-3.10.2.ebuild')
-rw-r--r--dev-cpp/nlohmann_json/nlohmann_json-3.10.2.ebuild62
1 files changed, 62 insertions, 0 deletions
diff --git a/dev-cpp/nlohmann_json/nlohmann_json-3.10.2.ebuild b/dev-cpp/nlohmann_json/nlohmann_json-3.10.2.ebuild
new file mode 100644
index 000000000000..39a2c4c723af
--- /dev/null
+++ b/dev-cpp/nlohmann_json/nlohmann_json-3.10.2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit cmake
+
+# Check https://github.com/nlohmann/json/blob/develop/cmake/download_test_data.cmake to find test archive version
+TEST_VERSION="3.0.0"
+DESCRIPTION="JSON for Modern C++"
+HOMEPAGE="https://github.com/nlohmann/json https://nlohmann.github.io/json/"
+SRC_URI="
+ https://github.com/nlohmann/json/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ test? ( https://github.com/nlohmann/json_test_data/archive/v${TEST_VERSION}.tar.gz -> ${PN}-testdata-${TEST_VERSION}.tar.gz )"
+S="${WORKDIR}/json-${PV}"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
+IUSE="doc test"
+#RESTRICT="!test? ( test )"
+# Need to report failing tests upstream
+# Tests only just added, large test suite, majority pass
+RESTRICT="test"
+
+BDEPEND="doc? ( app-doc/doxygen )"
+
+DOCS=( ChangeLog.md README.md )
+
+src_configure() {
+ # Tests are built by default so we can't group the test logic below
+ local mycmakeargs=(
+ -DJSON_MultipleHeaders=ON
+ -DJSON_BuildTests=$(usex test)
+ )
+
+ # Define test data directory here to avoid unused var QA warning, bug #747826
+ use test && mycmakeargs+=( -DJSON_TestDataDirectory="${S}"/json_test_data )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+
+ if use doc; then
+ emake -C doc
+ HTML_DOCS=( doc/html/. )
+ fi
+}
+
+src_test() {
+ cd "${BUILD_DIR}/test" || die
+
+ # Skip certain tests needing git per upstream
+ # https://github.com/nlohmann/json/issues/2189
+ local myctestargs=(
+ "-LE git_required"
+ )
+
+ cmake_src_test
+}