[valijson] new port (#6354)

This commit is contained in:
WebFolder OÜ 2019-05-08 23:32:57 +03:00 committed by Griffin Downs
parent 0e1ea7576c
commit 7341945a32
5 changed files with 96 additions and 0 deletions

3
ports/valijson/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: valijson
Version: 2018-11-17
Description: Header-only C++ library for JSON Schema validation

View File

@ -0,0 +1,26 @@
diff --git a/include/valijson/adapters/nlohmann_json_adapter.hpp b/include/valijson/adapters/nlohmann_json_adapter.hpp
index f77a2bf..3f6fb5f 100644
--- a/include/valijson/adapters/nlohmann_json_adapter.hpp
+++ b/include/valijson/adapters/nlohmann_json_adapter.hpp
@@ -28,7 +28,7 @@
#define __VALIJSON_ADAPTERS_NLOHMANN_JSON_ADAPTER_HPP
#include <string>
-#include <json.hpp>
+#include <nlohmann/json.hpp>
#include <valijson/adapters/adapter.hpp>
#include <valijson/adapters/basic_adapter.hpp>
diff --git a/include/valijson/utils/nlohmann_json_utils.hpp b/include/valijson/utils/nlohmann_json_utils.hpp
index 01838d8..4a5b5e4 100644
--- a/include/valijson/utils/nlohmann_json_utils.hpp
+++ b/include/valijson/utils/nlohmann_json_utils.hpp
@@ -4,7 +4,7 @@
#include <iostream>
-#include <json.hpp>
+#include <nlohmann/json.hpp>
#include <valijson/utils/file_utils.hpp>
namespace valijson {

View File

@ -0,0 +1,13 @@
diff --git a/include/valijson/internal/optional.hpp b/include/valijson/internal/optional.hpp
index 8ff285c..84e9fd6 100644
--- a/include/valijson/internal/optional.hpp
+++ b/include/valijson/internal/optional.hpp
@@ -11,7 +11,7 @@ namespace opt = std;
# endif
# endif
#else
-# include <compat/optional.hpp>
+# include <valijson/compat/optional.hpp>
namespace opt = std::experimental;
#endif

View File

@ -0,0 +1,26 @@
diff --git a/include/valijson/adapters/picojson_adapter.hpp b/include/valijson/adapters/picojson_adapter.hpp
index b6d17c9..6d04c52 100644
--- a/include/valijson/adapters/picojson_adapter.hpp
+++ b/include/valijson/adapters/picojson_adapter.hpp
@@ -29,7 +29,7 @@
#include <string>
-#include <picojson.h>
+#include <picojson/picojson.h>
#include <valijson/adapters/adapter.hpp>
#include <valijson/adapters/basic_adapter.hpp>
diff --git a/include/valijson/utils/picojson_utils.hpp b/include/valijson/utils/picojson_utils.hpp
index 2ca4d46..b983648 100644
--- a/include/valijson/utils/picojson_utils.hpp
+++ b/include/valijson/utils/picojson_utils.hpp
@@ -4,7 +4,7 @@
#include <iostream>
-#include <picojson.h>
+#include <picojson/picojson.h>
#include <valijson/utils/file_utils.hpp>

View File

@ -0,0 +1,28 @@
#header-only library
include(vcpkg_common_functions)
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/valijson)
vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
REPO tristanpenman/valijson
REF dd084d747448bb56ddfeab5946b4f2f4617b99c4
SHA512 ee241eefc816360608f86792a4c25abadea79cbffc94d7e31a2dbd0a483ed4d7a303b6d2410b99ab7694e58a3d299f0df0baa52fa16f89e9233d90b190a4d799
HEAD_REF master
PATCHES fix-nlohmann-json.patch
fix-picojson.patch
fix-optional.patch
)
# Copy the header files
file(GLOB HEADER_FILES ${SOURCE_PATH}/include/valijson/*)
file(COPY ${HEADER_FILES}
DESTINATION ${CURRENT_PACKAGES_DIR}/include/valijson
REGEX "\.(gitattributes|gitignore)$" EXCLUDE)
file(COPY ${SOURCE_PATH}/include/compat/optional.hpp
DESTINATION ${CURRENT_PACKAGES_DIR}/include/valijson/compat)
# Put the licence file where vcpkg expects it
file(COPY ${SOURCE_PATH}/LICENSE
DESTINATION ${CURRENT_PACKAGES_DIR}/share/valijson)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/valijson/LICENSE ${CURRENT_PACKAGES_DIR}/share/valijson/copyright)