Skip to content

Commit

Permalink
[mbedtls/nana] Update to the latest version (microsoft#13672)
Browse files Browse the repository at this point in the history
* [mbedtls/nana] Update to the latest version

* [nana] Remove unused patch and update patch EOF
  • Loading branch information
NancyLi1013 authored Sep 28, 2020
1 parent 7a05bde commit dcc7ddc
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 56 deletions.
2 changes: 1 addition & 1 deletion ports/mbedtls/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: mbedtls
Version: 2.16.3-1
Version: 2.24.0
Homepage: https://github.com/ARMmbed/mbedtls
Description: An open source, portable, easy to use, readable and flexible SSL library

Expand Down
40 changes: 22 additions & 18 deletions ports/mbedtls/enable-pthread.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f7d0d886..d65cfeb2b 100644
index 8833246..f68ab02 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ endif()
@@ -28,6 +28,7 @@ set(MBEDTLS_DIR ${CMAKE_CURRENT_SOURCE_DIR})

option(USE_PKCS11_HELPER_LIBRARY "Build mbed TLS with the pkcs11-helper library." OFF)
option(ENABLE_ZLIB_SUPPORT "Build mbed TLS with zlib library." OFF)
+option(ENABLE_PTHREAD "Build mbed TLS with pthread" OFF)

option(ENABLE_PROGRAMS "Build mbed TLS programs." ON)

@@ -174,6 +175,7 @@ else()
@@ -231,6 +232,8 @@ else()
set(LIB_INSTALL_DIR lib)
endif()

include_directories(include/)
+include_directories(${CMAKE_CURRENT_BINARY_DIR}/include/)
+
if(ENABLE_ZLIB_SUPPORT)
find_package(ZLIB)
@@ -183,6 +185,17 @@ if(ENABLE_ZLIB_SUPPORT)

@@ -239,6 +242,17 @@ if(ENABLE_ZLIB_SUPPORT)
endif(ZLIB_FOUND)
endif(ENABLE_ZLIB_SUPPORT)

Expand All @@ -33,33 +34,35 @@ index 5f7d0d886..d65cfeb2b 100644
+ set(LINK_WITH_PTHREAD ON)
+endif()
+
add_subdirectory(library)
add_subdirectory(include)

add_subdirectory(3rdparty)
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index c2f2bd4e6..e110cd50c 100644
index 62c0f62..7923202 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,9 +1,13 @@
@@ -1,10 +1,14 @@
option(INSTALL_MBEDTLS_HEADERS "Install mbed TLS headers." ON)

+configure_file(mbedtls/config_threading.h.in mbedtls/config_threading.h)
+
if(INSTALL_MBEDTLS_HEADERS)

file(GLOB headers "mbedtls/*.h")

file(GLOB psa_headers "psa/*.h")
-
+
+ set(headers ${headers} ${CMAKE_CURRENT_BINARY_DIR}/mbedtls/config_threading.h)
+
+
install(FILES ${headers}
DESTINATION include/mbedtls
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h
index 5df962ef6..f205bf599 100644
index 1e6e052..51c20da 100644
--- a/include/mbedtls/config.h
+++ b/include/mbedtls/config.h
@@ -26,6 +26,8 @@
* This file is part of mbed TLS (https://tls.mbed.org)
@@ -24,6 +24,8 @@
* limitations under the License.
*/

+#include "mbedtls/config_threading.h"
Expand All @@ -69,7 +72,7 @@ index 5df962ef6..f205bf599 100644

diff --git a/include/mbedtls/config_threading.h.in b/include/mbedtls/config_threading.h.in
new file mode 100644
index 000000000..f6286ed9c
index 0000000..9d5d42e
--- /dev/null
+++ b/include/mbedtls/config_threading.h.in
@@ -0,0 +1,6 @@
Expand All @@ -79,11 +82,12 @@ index 000000000..f6286ed9c
+#define MBEDTLS_THREADING_C
+#define MBEDTLS_THREADING_PTHREAD
+#endif
\ No newline at end of file
diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt
index 9330cff9b..54a815ee7 100644
index 33e2cfc..4b99331 100644
--- a/library/CMakeLists.txt
+++ b/library/CMakeLists.txt
@@ -128,7 +128,11 @@ if(ENABLE_ZLIB_SUPPORT)
@@ -137,7 +137,11 @@ if(ENABLE_ZLIB_SUPPORT)
endif(ENABLE_ZLIB_SUPPORT)

if(LINK_WITH_PTHREAD)
Expand All @@ -95,4 +99,4 @@ index 9330cff9b..54a815ee7 100644
+ endif()
endif()

if (NOT USE_STATIC_MBEDTLS_LIBRARY AND NOT USE_SHARED_MBEDTLS_LIBRARY)
if(LINK_WITH_TRUSTED_STORAGE)
12 changes: 6 additions & 6 deletions ports/mbedtls/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set(VCPKG_LIBRARY_LINKAGE static)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ARMmbed/mbedtls
REF mbedtls-2.16.3
SHA512 3d798f7de9c33325585d5d7c8608cc16acdcf42c246d283b2fb8a29f5e419f2899342965ff297432ef2ab20c91eaee28d6ca53349f5a68b0a4fd29d6905fc64c
REF 523f0554b6cdc7ace5d360885c3f5bbcc73ec0e8 # mbedtls-2.24.0
SHA512 1ce78f34e8d87c2ce0454e0a08f4c6e5b3129d4b24cfa44162af21c2e8b5dc7feabf849e4fa547ce3781b5ce11aaf675cfed47412bae40091fbdd87bbcdbee07
HEAD_REF master
PATCHES
enable-pthread.patch
Expand All @@ -13,7 +13,7 @@ vcpkg_from_github(
vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
pthreads ENABLE_PTHREAD
pthreads ENABLE_PTHREAD
)

vcpkg_configure_cmake(
Expand All @@ -29,10 +29,10 @@ vcpkg_install_cmake()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/mbedtls RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

if(WIN32 AND pthreads IN_LIST FEATURES)
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/mbedtls)
file(INSTALL ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
endif()

vcpkg_copy_pdbs()
vcpkg_copy_pdbs()
2 changes: 1 addition & 1 deletion ports/nana/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2 FATAL_ERROR)
project(nana VERSION 1.7.2 LANGUAGES CXX)
project(nana VERSION 1.7.4 LANGUAGES CXX)

option(NANA_ENABLE_PNG "Enable PNG support" OFF)
option(NANA_ENABLE_JPEG "Enable JPEG support" OFF)
Expand Down
3 changes: 1 addition & 2 deletions ports/nana/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
Source: nana
Version: 1.7.2
Port-Version: 4
Version: 1.7.4
Homepage: https://github.com/cnjinhao/nana
Description: Cross-platform library for GUI programming in modern C++ style.
Build-Depends: libpng, libjpeg-turbo, freetype (!uwp&&!windows), fontconfig (!uwp&&!windows)
12 changes: 0 additions & 12 deletions ports/nana/fix-addstdexcept.patch

This file was deleted.

23 changes: 12 additions & 11 deletions ports/nana/fix-build-error.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
diff --git a/include/nana/filesystem/filesystem.hpp b/include/nana/filesystem/filesystem.hpp
index 86b907a..ea8db75 100644
--- a/include/nana/filesystem/filesystem.hpp
+++ b/include/nana/filesystem/filesystem.hpp
@@ -30,6 +30,7 @@
#ifndef NANA_FILESYSTEM_HPP
#define NANA_FILESYSTEM_HPP
#include <nana/push_ignore_diagnostic>
+#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING
diff --git a/source/system/split_string.cpp b/source/system/split_string.cpp
index 8269db6..c40016b 100644
--- a/source/system/split_string.cpp
+++ b/source/system/split_string.cpp
@@ -18,7 +18,7 @@ std::vector<split_string_type> split_string (const split_string_type& text, char
sep_pos = text.find(sep, sep_pos);
sep_pos = (text.npos == sep_pos ? text.size() : sep_pos);
const std::size_t end = sep_pos;
- while (sep_pos < text.size() and sep == text[sep_pos]) {
+ while (sep_pos < text.size() && sep == text[sep_pos]) {
++sep_pos;
}

//Filesystem Selection
#include <nana/config.hpp>
9 changes: 4 additions & 5 deletions ports/nana/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_TARGET_IS_UWP)
if(NOT VCPKG_TARGET_IS_WINDOWS)
message(WARNING "You will need to install Xorg dependencies to use nana:\napt install libx11-dev libxft-dev libxcursor-dev\n")
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO cnjinhao/nana
REF 38cdf4779456ba697d7da863f7c623e25d30f650 # v1.7.2
SHA512 0ad15984ce6ef94b4f92b2a87649c0e247850a602a8f48645fd882ed5dddd047a168c319c741b2783218ce467f8d0ac790010717cffc54cb1716b105ec042798
REF 554c4fe87fc31b8ee104228e9117d545d34855b5 # v1.7.4
SHA512 d9db8ea1bd47fe663b8e2443a1a3e279760dbd11ef6bc78d9dc8f6fd12f9736b8c8315dfc84d21325e02ad6b2dc3a429593ac80e7610097ddc7253668c383178
HEAD_REF develop
PATCHES
fix-build-error.patch
fix-addstdexcept.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
Expand All @@ -33,4 +32,4 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-nana TARGET_PATH share/un

vcpkg_copy_pdbs()

file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

0 comments on commit dcc7ddc

Please sign in to comment.