aboutsummaryrefslogtreecommitdiff
path: root/ports/cryptopp
diff options
context:
space:
mode:
authoryurybura <yurybura@gmail.com>2018-05-11 13:34:43 +0300
committeryurybura <yurybura@gmail.com>2018-05-11 13:34:43 +0300
commit7d261fbbc39a1d36027299190920e0a7e222ebd7 (patch)
treed9b6745f2e6c670836cbbf61dbd2c4eb9ef857fe /ports/cryptopp
parent50e5ee1e40380cf543ae804775462181984a86dc (diff)
parent9535a5631ac212b1c657a02be3ed9398df30c96c (diff)
downloadvcpkg-7d261fbbc39a1d36027299190920e0a7e222ebd7.tar.gz
vcpkg-7d261fbbc39a1d36027299190920e0a7e222ebd7.zip
Merge branch 'master' of https://github.com/yurybura/vcpkg
Diffstat (limited to 'ports/cryptopp')
-rw-r--r--ports/cryptopp/CONTROL2
-rw-r--r--ports/cryptopp/cmake.patch15
-rw-r--r--ports/cryptopp/patch.patch12
-rw-r--r--ports/cryptopp/portfile.cmake42
4 files changed, 55 insertions, 16 deletions
diff --git a/ports/cryptopp/CONTROL b/ports/cryptopp/CONTROL
index 00d14756a..6fea020bd 100644
--- a/ports/cryptopp/CONTROL
+++ b/ports/cryptopp/CONTROL
@@ -1,3 +1,3 @@
Source: cryptopp
-Version: 5.6.5-1
+Version: 6.1.0-2
Description: Crypto++ is a free C++ class library of cryptographic schemes.
diff --git a/ports/cryptopp/cmake.patch b/ports/cryptopp/cmake.patch
new file mode 100644
index 000000000..fbe725eb9
--- /dev/null
+++ b/ports/cryptopp/cmake.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5b6e1e6..a0adcf6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -329,6 +329,10 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
+ SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /FI\"winapifamily.h\"" )
+ endif ()
+
++if(WINDOWS_STORE)
++ add_definitions(-DCRYPTOPP_DISABLE_NACL=1)
++endif()
++
+ # Enable PIC for all target machines except 32-bit i386 due to register pressures.
+ if (NOT CRYPTOPP_I386)
+ SET(CMAKE_POSITION_INDEPENDENT_CODE 1)
diff --git a/ports/cryptopp/patch.patch b/ports/cryptopp/patch.patch
new file mode 100644
index 000000000..5c49d2757
--- /dev/null
+++ b/ports/cryptopp/patch.patch
@@ -0,0 +1,12 @@
+diff --git a/config.h b/config.h
+index b96b7aa..3f004ac 100644
+--- a/config.h
++++ b/config.h
+@@ -795,6 +795,7 @@ NAMESPACE_END
+ #endif
+
+ #ifdef CRYPTOPP_WIN32_AVAILABLE
++#include <winapifamily.h>
+ # if !defined(WINAPI_FAMILY)
+ # define THREAD_TIMER_AVAILABLE
+ # elif defined(WINAPI_FAMILY)
diff --git a/ports/cryptopp/portfile.cmake b/ports/cryptopp/portfile.cmake
index 4847c208b..6b4b844c4 100644
--- a/ports/cryptopp/portfile.cmake
+++ b/ports/cryptopp/portfile.cmake
@@ -3,13 +3,32 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
endif()
include(vcpkg_common_functions)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/cryptopp-CRYPTOPP_5_6_5)
-vcpkg_download_distfile(ARCHIVE
- URLS "https://github.com/weidai11/cryptopp/archive/CRYPTOPP_5_6_5.zip"
- FILENAME "CRYPTOPP_5_6_5.zip"
- SHA512 abca8089e2d587f59c503d2d6412b3128d061784349c735f3ee46be1cb9e3d0d0fed9a9173765fa033eb2dc744e03810de45b8cc2f8ca1672a36e4123648ea44
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH CMAKE_SOURCE_PATH
+ REPO noloader/cryptopp-cmake
+ REF aab149932675e4bb777a9d3d6b3f8b8182583fd7
+ SHA512 748c77e936888d042bf4a72cc7ee3b7b2ecf16c003cb23296c1af413c9a0cba00cc942ecace26274fc8ac8bd4d848946beb9d7bf2253c5eab3315a4419ef5f1f
+ HEAD_REF master
+)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO weidai11/cryptopp
+ REF CRYPTOPP_6_1_0
+ SHA512 4bc02fef33f1859a07434a4752c2575afd781056e9a91eed99a13cebe2c91d66cbc7173e34d362da63dad6d38f9594ff291accd27e111232996ccd536bba0f39
+ HEAD_REF master
+)
+
+file(COPY ${CMAKE_SOURCE_PATH}/cryptopp-config.cmake DESTINATION ${SOURCE_PATH})
+file(COPY ${CMAKE_SOURCE_PATH}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
+
+vcpkg_apply_patches(
+ SOURCE_PATH "${SOURCE_PATH}"
+ PATCHES
+ "${CMAKE_CURRENT_LIST_DIR}/patch.patch"
+ "${CMAKE_CURRENT_LIST_DIR}/cmake.patch"
)
-vcpkg_extract_source_archive(${ARCHIVE})
# Dynamic linking should be avoided for Crypto++ to reduce the attack surface,
# so generate a static lib for both dynamic and static vcpkg targets.
@@ -19,6 +38,7 @@ vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
OPTIONS
-DBUILD_SHARED=OFF
-DBUILD_STATIC=ON
@@ -27,18 +47,10 @@ vcpkg_configure_cmake(
)
vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/cryptopp)
# There is no way to suppress installation of the headers and resource files in debug build.
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
-
-# Remove executables
-file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/cryptest.exe)
-file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/bin/cryptest.exe)
-
-# Remove other files not required in package
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake)
# Handle copyright
file(COPY ${SOURCE_PATH}/License.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/cryptopp)