Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | SUMMARY = "JSON for modern C++" |
| 2 | HOMEPAGE = "https://nlohmann.github.io/json/" |
| 3 | SECTION = "libs" |
| 4 | LICENSE = "MIT" |
| 5 | LIC_FILES_CHKSUM = "file://LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588" |
| 6 | |
| 7 | CVE_PRODUCT = "json-for-modern-cpp" |
| 8 | |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 9 | SRC_URI = "git://github.com/nlohmann/json.git;branch=develop;protocol=https \ |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 10 | git://github.com/nlohmann/json_test_data.git;destsuffix=git/json_test_data;name=json-test-data;branch=master;protocol=https \ |
| 11 | file://0001-custom-allocators-define-missing-rebind-type-3895.patch \ |
| 12 | file://0001-tests-unit-iterators2-use-std-ranges-equals-for-rang.patch \ |
| 13 | file://run-ptest \ |
| 14 | " |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 15 | |
| 16 | SRCREV = "bc889afb4c5bf1c0d8ee29ef35eaaf4c8bef8a5d" |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 17 | SRCREV_json-test-data = "a1375cea09d27cc1c4cadb8d00470375b421ac37" |
| 18 | |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 19 | SRCREV_FORMAT .= "_json-test-data" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 20 | |
| 21 | S = "${WORKDIR}/git" |
| 22 | |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 23 | inherit cmake ptest |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 24 | |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 25 | EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DJSON_BuildTests=ON -DJSON_TestDataDirectory=${PTEST_PATH}/json_test_data', '-DJSON_BuildTests=OFF', d)}" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 26 | |
| 27 | # nlohmann-json is a header only C++ library, so the main package will be empty. |
Andrew Geissler | 6aa7eec | 2023-03-03 12:41:14 -0600 | [diff] [blame] | 28 | ALLOW_EMPTY:${PN} = "1" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 29 | RDEPENDS:${PN}-dev = "" |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 30 | RDEPENDS:${PN}-ptest = "perl" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 31 | |
| 32 | BBCLASSEXTEND = "native nativesdk" |
| 33 | |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 34 | |
| 35 | do_install_ptest () { |
| 36 | install -d ${D}${PTEST_PATH}/tests |
| 37 | cp -r ${S}/json_test_data/ ${D}${PTEST_PATH}/ |
| 38 | cp -r ${B}/tests/test-* ${D}${PTEST_PATH}/tests |
Patrick Williams | da29531 | 2023-12-05 16:48:56 -0600 | [diff] [blame] | 39 | rm -rf ${D}${PTEST_PATH}/json_test_data/.git |
Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 43 | # other packages commonly reference the file directly as "json.hpp" |
| 44 | # create symlink to allow this usage |
| 45 | do_install:append() { |
| 46 | ln -s nlohmann/json.hpp ${D}${includedir}/json.hpp |
| 47 | } |