From 1f07d885f1aa269fd050ff1fe2e49c93e113b798 Mon Sep 17 00:00:00 2001 From: Phoebe <20694052+PhoebeHui@users.noreply.github.com> Date: Tue, 2 Jun 2020 09:34:07 +0800 Subject: [PATCH] [jwt-cpp] Update to v0.4.0 (#11625) --- ports/jwt-cpp/CONTROL | 4 ++- ports/jwt-cpp/fix-picojson.patch | 12 ------- ports/jwt-cpp/fix-warning.patch | 62 ++++++++++++++++---------------- ports/jwt-cpp/portfile.cmake | 20 +++++------ 4 files changed, 42 insertions(+), 56 deletions(-) delete mode 100644 ports/jwt-cpp/fix-picojson.patch diff --git a/ports/jwt-cpp/CONTROL b/ports/jwt-cpp/CONTROL index 7815f16408..7cc3d44963 100644 --- a/ports/jwt-cpp/CONTROL +++ b/ports/jwt-cpp/CONTROL @@ -1,3 +1,5 @@ Source: jwt-cpp -Version: 2019-05-07-1 +Version: 0.4.0 +Homepage: https://github.com/Thalhammer/jwt-cpp Description: A header only library for creating and validating json web tokens in c++ +Build-Depends: picojson \ No newline at end of file diff --git a/ports/jwt-cpp/fix-picojson.patch b/ports/jwt-cpp/fix-picojson.patch deleted file mode 100644 index 44c04fe58d..0000000000 --- a/ports/jwt-cpp/fix-picojson.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 - #include diff --git a/ports/jwt-cpp/fix-warning.patch b/ports/jwt-cpp/fix-warning.patch index d013a7782b..4c2e166c3a 100644 --- a/ports/jwt-cpp/fix-warning.patch +++ b/ports/jwt-cpp/fix-warning.patch @@ -1,31 +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 - #include - -+#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 - #include - -+#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/include/jwt-cpp/base.h b/include/jwt-cpp/base.h +index 375e0eb..4023709 100644 +--- a/include/jwt-cpp/base.h ++++ b/include/jwt-cpp/base.h +@@ -2,6 +2,10 @@ + #include + #include + ++#ifdef _MSC_VER ++#pragma warning(disable : 4267) ++#endif ++ + #ifdef __has_cpp_attribute + #if __has_cpp_attribute(fallthrough) + #define JWT_FALLTHROUGH [[fallthrough]] +diff --git a/include/jwt-cpp/jwt.h b/include/jwt-cpp/jwt.h +index 6e55729..4579310 100644 +--- a/include/jwt-cpp/jwt.h ++++ b/include/jwt-cpp/jwt.h +@@ -12,6 +12,11 @@ + #include + #include + ++#ifdef _MSC_VER ++#pragma warning(disable : 4267) ++#pragma warning(disable : 4067) ++#endif ++ + //If openssl version less than 1.1 + #if OPENSSL_VERSION_NUMBER < 0x10100000L + #define OPENSSL10 diff --git a/ports/jwt-cpp/portfile.cmake b/ports/jwt-cpp/portfile.cmake index 3ac1a02a4f..00c4496c91 100644 --- a/ports/jwt-cpp/portfile.cmake +++ b/ports/jwt-cpp/portfile.cmake @@ -1,13 +1,12 @@ -#header-only library -include(vcpkg_common_functions) - -vcpkg_from_github(OUT_SOURCE_PATH SOURCE_PATH +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH REPO Thalhammer/jwt-cpp - REF 1d2b1bac13e54f99df4f890cd674ec149c135762 - SHA512 a45f12104e38a8b05a0ea5b5f91034b65d85dd048664bbda4f2909df32688726d599161e3d6541fd6f36c784d21c24a4d2666f670c3281b9e9130bc8a96fce39 + REF 34bb0644ea613cfcbc09c148db9de8aa6c5612b5 # v0.4.0 + SHA512 773007fc7a73a831e292451d7a38feb9434f7c11c653d43b9f3679c564f64805a1cbd1baab6b13107c42cc06549ad7cd08aebd6658d8ee0022f5b8d601fa94cc HEAD_REF master - PATCHES fix-picojson.patch - fix-warning.patch) + PATCHES + fix-warning.patch +) # Copy the header files file(GLOB HEADER_FILES ${SOURCE_PATH}/include/jwt-cpp/*) @@ -15,7 +14,4 @@ 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) +file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)