Skip to contentSkip to conversation

valijson: Add recipe

PATCH Superseded James Feist 2 participants 2 messages Oct 9, 2018 – Oct 10, 2018

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 valijson: Add recipe

valijson is a header only c++ library for JSON
schema validation.

---
 .../recipes-devtools/valijson/valijson_git.bb | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/valijson/valijson_git.bb
meta-oe/recipes-devtools/valijson/valijson_git.bb new file +27 -0
new file mode 100644
index 000000000..bcceb6884
@@ -0,0 +1,27 @@
+SUMMARY = "Header-only C++ library for JSON Schema validation"
+HOMEPAGE = "https://github.com/tristanpenman/valijson"
+LICENSE = "BSD"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=015106c62262b2383f6c72063f0998f2"
+
+SRC_URI = "git://github.com/tristanpenman/valijson.git"
+PV = "0.1+git${SRCPV}"
+
+SRCREV = "c2f22fddf599d04dc33fcd7ed257c698a05345d9"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DINSTALL_HEADERS=1 -DBUILD_TESTS=0"
+
+# valijson is a header only C++ library, so the main package will be empty.
+
+RDEPENDS_${PN}-dev = ""
+
+BBCLASSEXTEND = "native nativesdk"
+
+# valijson expects json.hpp where nlohmann-json_git.bb installs
+# nlohmann/json.hpp, this allows usage via json.hpp
+do_install_append() {
+    ln -rs ${D}${includedir}/nlohmann/json.hpp ${D}${includedir}/json.hpp
+}
Signature · 1 line
2.17.1
#1 lore raw
Quoted 22 lines

-----Original Message-----
From: [email protected] <openembedded- [email protected]> On Behalf Of James Feist
Sent: den 9 oktober 2018 22:12
To: [email protected]
Subject: [oe] [meta-oe][PATCH] valijson: Add recipe

valijson is a header only c++ library for JSON
schema validation.

---
 .../recipes-devtools/valijson/valijson_git.bb | 27 +++++++++++++++++++
 1 file changed, 27 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/valijson/valijson_git.bb
meta-oe/recipes-devtools/valijson/valijson_git.bb new file +0 -0
new file mode 100644
index 000000000..bcceb6884

meta-oe/recipes-devtools/valijson/valijson_git.bb line 3

Quoted 3 lines
meta-oe/recipes-devtools/valijson/valijson_git.bb new file +3 -0
@@ -0,0 +1,27 @@
+SUMMARY = "Header-only C++ library for JSON Schema validation"
+HOMEPAGE = "https://github.com/tristanpenman/valijson"
+LICENSE = "BSD"

Change "BSD" to "BSD-2-Clause".

Quoted 5 lines
meta-oe/recipes-devtools/valijson/valijson_git.bb new file +5 -0
+LIC_FILES_CHKSUM = "file://LICENSE;md5=015106c62262b2383f6c72063f0998f2"
+
+SRC_URI = "git://github.com/tristanpenman/valijson.git"
+PV = "0.1+git${SRCPV}"
+

meta-oe/recipes-devtools/valijson/valijson_git.bb line 18

Quoted 10 lines
meta-oe/recipes-devtools/valijson/valijson_git.bb new file +10 -0
+SRCREV = "c2f22fddf599d04dc33fcd7ed257c698a05345d9"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DINSTALL_HEADERS=1 -DBUILD_TESTS=0"
+
+# valijson is a header only C++ library, so the main package will be empty.
+

I suggest removing this empty line to make it more clear that the comment above relates to the RDEPENDS line below.

meta-oe/recipes-devtools/valijson/valijson_git.bb line 26

Quoted 8 lines
meta-oe/recipes-devtools/valijson/valijson_git.bb new file +8 -0
+RDEPENDS_${PN}-dev = ""
+
+BBCLASSEXTEND = "native nativesdk"
+
+# valijson expects json.hpp where nlohmann-json_git.bb installs
+# nlohmann/json.hpp, this allows usage via json.hpp
+do_install_append() {
+    ln -rs ${D}${includedir}/nlohmann/json.hpp ${D}${includedir}/json.hpp

Since the prefix is the same in both cases, you can avoid the -r option by using:

    ln -s nlohmann/json.hpp ${D}${includedir}/json.hpp
Quoted 3 lines
meta-oe/recipes-devtools/valijson/valijson_git.bb new file +1 -1
+}
--

2.17.1

//Peter