Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dev-cpp/nlohmann_json/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIST json-3.11.3.tar.gz 8053911 BLAKE2B 299b92e56282ae0565bd388cfc945daa959c4d1d230ea7c3b458bad723f84c1921677905032d5607e6e5663b09ae2f0ed130f6fb18b7351f058bcac7d73540e7 SHA512 6f210c7c03965cc1f9dd4e8379476167c1a2abd0adea68ebb925de5dd4c74815fae125e54a5dfa3385f3948e475fddded4e18878c9ec06603fcda7159aab2c8c
DIST json-3.12.0.tar.gz 9679546 BLAKE2B f70b4c52be993e672daeda1931392a4ab408b6621c99d781497508fd4cf96e3ad2362af0d07ed12633753d65373657dc9f9c1c6abe5913b51e7c3dbb98b58a26 SHA512 0cae97c8319e71edf5f01c45ffdd615224779f55f7a680815a0a412c7a72ae8392b3da93e829fba40ed764b456c73f667ae6b5e9abe48304009a55eba5effe37
DIST json_test_data-3.1.0.tar.gz 115036765 BLAKE2B 2b0a9f1e89bdbefc1b9264b14f3698f3a6c0878f950da6a86c474484fbe601ffa44daa02fddae032b62283e09905da293a52bfe2fe1f4cf6c73fcd0ffc164c23 SHA512 995802882f98c639e5a746240ad6d17d92865606a946dc4137b6c49d90ac827a4a9519c7625f462476b1f452a197b1ab013cb6da225578994bbd7e5c2ec31081
80 changes: 80 additions & 0 deletions dev-cpp/nlohmann_json/nlohmann_json-3.12.0.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit cmake

DESCRIPTION="JSON for Modern C++"
HOMEPAGE="https://github.com/nlohmann/json"
SRC_URI="
https://api.github.com/repos/nlohmann/json/tarball/v3.12.0 -> json-3.12.0.tar.gz
test? ( https://api.github.com/repos/nlohmann/json_test_data/tarball/v3.1.0 -> json_test_data-3.1.0.tar.gz )
"

LICENSE="MIT"
SLOT="0"
KEYWORDS="*"
IUSE="doc test"

BDEPEND="doc? ( app-doc/doxygen )"

DOCS=( ChangeLog.md README.md )

S="${WORKDIR}/json-3.12.0"

fix_src_dirs() {
# We need this because the top dir in the tarballs use the first part of the
# corresponding commit which changes every release

pushd "${WORKDIR}"
mv nlohmann-json-* json-3.12.0
mv nlohmann-json_test_data-* json_test_data-3.1.0
popd
}

src_unpack() {
default
fix_src_dirs
}

src_configure() {

# Just remove cmake_fetch_content test because even after passing -LE git_required
# per https://github.com/nlohmann/json/issues/2189 it still tries to run those tests for
# whatever reason.
pushd "${S}/test"
sed -i '/add_subdirectory(cmake_fetch_content)/'d CMakeLists.txt
popd

# 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="${WORKDIR}"/json_test_data-3.1.0 )

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
}
Loading