nlohmann-json_3.12.0.bb 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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=3b489645de9825cca5beeb9a7e18b6eb"
  6. CVE_PRODUCT = "json-for-modern-cpp"
  7. SRC_URI = "git://github.com/nlohmann/json.git;branch=master;protocol=https \
  8. git://github.com/nlohmann/json_test_data.git;destsuffix=git/json_test_data;name=json-test-data;branch=master;protocol=https \
  9. file://run-ptest \
  10. "
  11. SRCREV = "55f93686c01528224f448c19128836e7df245f72"
  12. SRCREV_json-test-data = "a1375cea09d27cc1c4cadb8d00470375b421ac37"
  13. SRCREV_FORMAT .= "_json-test-data"
  14. S = "${WORKDIR}/git"
  15. inherit cmake ptest
  16. EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DJSON_BuildTests=ON -DJSON_TestDataDirectory=${PTEST_PATH}/json_test_data', '-DJSON_BuildTests=OFF', d)}"
  17. # nlohmann-json is a header only C++ library, so the main package will be empty.
  18. ALLOW_EMPTY:${PN} = "1"
  19. RDEPENDS:${PN}-dev = ""
  20. RDEPENDS:${PN}-ptest = "perl locale-base-de-de"
  21. BBCLASSEXTEND = "native nativesdk"
  22. do_install_ptest () {
  23. install -d ${D}${PTEST_PATH}/tests
  24. cp -r ${S}/json_test_data/ ${D}${PTEST_PATH}/
  25. cp -r ${B}/tests/test-* ${D}${PTEST_PATH}/tests
  26. rm -rf ${D}${PTEST_PATH}/json_test_data/.git
  27. }
  28. # other packages commonly reference the file directly as "json.hpp"
  29. # create symlink to allow this usage
  30. do_install:append() {
  31. ln -s nlohmann/json.hpp ${D}${includedir}/json.hpp
  32. }