aboutsummaryrefslogtreecommitdiff
path: root/ports/jwt-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ports/jwt-cpp')
-rw-r--r--ports/jwt-cpp/CONTROL3
-rw-r--r--ports/jwt-cpp/fix-picojson.patch12
-rw-r--r--ports/jwt-cpp/fix-warning.patch31
-rw-r--r--ports/jwt-cpp/portfile.cmake23
4 files changed, 69 insertions, 0 deletions
diff --git a/ports/jwt-cpp/CONTROL b/ports/jwt-cpp/CONTROL
new file mode 100644
index 000000000..4f44063fe
--- /dev/null
+++ b/ports/jwt-cpp/CONTROL
@@ -0,0 +1,3 @@
+Source: jwt-cpp
+Version: 2019-05-07
+Description: A header only library for creating and validating json web tokens in c++ \ No newline at end of file
diff --git a/ports/jwt-cpp/fix-picojson.patch b/ports/jwt-cpp/fix-picojson.patch
new file mode 100644
index 000000000..44c04fe58
--- /dev/null
+++ b/ports/jwt-cpp/fix-picojson.patch
@@ -0,0 +1,12 @@
+diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h
+index ec56810..a26fd97 100644
+--- a/include/jwt-cpp/jwt.h
++++ b/include/jwt-cpp/jwt.h
+@@ -1,6 +1,6 @@
+ #pragma once
+ #define PICOJSON_USE_INT64
+-#include "picojson.h"
++#include "picojson/picojson.h"
+ #include "base.h"
+ #include <set>
+ #include <chrono>
diff --git a/ports/jwt-cpp/fix-warning.patch b/ports/jwt-cpp/fix-warning.patch
new file mode 100644
index 000000000..d013a7782
--- /dev/null
+++ b/ports/jwt-cpp/fix-warning.patch
@@ -0,0 +1,31 @@
+diff --git a/include/jwt-cpp/base.h b/include/jwt-cpp/base.h
+index dfca7fc..4d05c0b 100644
+--- a/include/jwt-cpp/base.h
++++ b/include/jwt-cpp/base.h
+@@ -2,6 +2,10 @@
+ #include <string>
+ #include <array>
+
++#ifdef _MSC_VER
++#pragma warning(disable : 4267)
++#endif
++
+ namespace jwt {
+ namespace alphabet {
+ struct base64 {
+diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h
+index ec56810..313cef2 100644
+--- a/include/jwt-cpp/jwt.h
++++ b/include/jwt-cpp/jwt.h
+@@ -12,6 +12,11 @@
+ #include <openssl/ec.h>
+ #include <openssl/err.h>
+
++#ifdef _MSC_VER
++#pragma warning(disable : 4267)
++#pragma warning(disable : 4067)
++#endif
++
+ //If openssl version less than 1.1
+ #if OPENSSL_VERSION_NUMBER < 269484032
+ #define OPENSSL10
diff --git a/ports/jwt-cpp/portfile.cmake b/ports/jwt-cpp/portfile.cmake
new file mode 100644
index 000000000..89ff9b04c
--- /dev/null
+++ b/ports/jwt-cpp/portfile.cmake
@@ -0,0 +1,23 @@
+#header-only library
+include(vcpkg_common_functions)
+
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/jwt-cpp)
+
+vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH
+ REPO Thalhammer/jwt-cpp
+ REF 1d2b1bac13e54f99df4f890cd674ec149c135762
+ SHA512 a45f12104e38a8b05a0ea5b5f91034b65d85dd048664bbda4f2909df32688726d599161e3d6541fd6f36c784d21c24a4d2666f670c3281b9e9130bc8a96fce39
+ HEAD_REF master
+ PATCHES fix-picojson.patch
+ fix-warning.patch)
+
+# Copy the header files
+file(GLOB HEADER_FILES ${SOURCE_PATH}/include/jwt-cpp/*)
+file(COPY ${HEADER_FILES}
+ DESTINATION ${CURRENT_PACKAGES_DIR}/include/jwt-cpp
+ REGEX "\.(gitattributes|gitignore|picojson.h)$" EXCLUDE)
+
+# Put the licence file where vcpkg expects it
+file(COPY ${SOURCE_PATH}/LICENSE
+ DESTINATION ${CURRENT_PACKAGES_DIR}/share/jwt-cpp)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/jwt-cpp/LICENSE ${CURRENT_PACKAGES_DIR}/share/jwt-cpp/copyright) \ No newline at end of file