[seal] Update to version 3.6.0. Changed default features. (#14576)

* Updated ports/seal to version 3.6.0. Changed default features. Supported linux and *-windows-static. macOS is not tested but should work.

* Changed to use vcpkg_check_features and VCPKG_TARGET_IS_WINDOWS. Updated SEAL's commit hash to keep up-to-date with SEAL's new fixes.

* Removed one unnecessary cmake argument.

* Disabled parallel configure.

* Updated SEAL's commit hash.

* Enforced static linkage.

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>

* Update ports/seal/portfile.cmake

Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
This commit is contained in:
Wei Dai 2020-11-18 15:39:36 -08:00 committed by GitHub
parent e93bc55f0d
commit f6612d53ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 93 deletions

View File

@ -1,7 +1,17 @@
Source: seal
Version: 3.5.9
Version: 3.6.0
Homepage: https://github.com/microsoft/SEAL
Description: Microsoft SEAL is an easy-to-use and powerful homomorphic encryption library.
Default-Features: ms-gsl, zlib, zstd
Feature: ms-gsl
Build-Depends: ms-gsl
Description: Use ms-gsl for span view
Feature: zlib
Description: (Not currently implemented) Use zlib for compressed serialization
Build-Depends: zlib
Description: Use zlib for compressed serialization
Feature: zstd
Build-Depends: zstd
Description: Use zstd for compressed serialization

View File

@ -1,79 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 92404c5..9867974 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -108,20 +108,20 @@ endif()
# Required files and directories
include(GNUInstallDirs)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${SEAL_SOURCE_DIR}/${OUTLIB_PATH})
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${SEAL_SOURCE_DIR}/${OUTLIB_PATH})
-set(CMAKE_LIBRARY_RUNTIME_DIRECTORY ${SEAL_SOURCE_DIR}/bin)
-set(SEAL_TARGETS_FILENAME ${SEAL_SOURCE_DIR}/cmake/SEALTargets.cmake)
+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${OUTLIB_PATH})
+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${OUTLIB_PATH})
+set(CMAKE_LIBRARY_RUNTIME_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
+set(SEAL_TARGETS_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/cmake/SEALTargets.cmake)
set(SEAL_CONFIG_IN_FILENAME ${SEAL_SOURCE_DIR}/cmake/SEALConfig.cmake.in)
-set(SEAL_CONFIG_FILENAME ${SEAL_SOURCE_DIR}/cmake/SEALConfig.cmake)
+set(SEAL_CONFIG_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/cmake/SEALConfig.cmake)
set(SEAL_PKGCONFIG_IN_FILENAME ${SEAL_SOURCE_DIR}/seal.pc.in)
-set(SEAL_PKGCONFIG_FILENAME ${SEAL_SOURCE_DIR}/seal-${SEAL_VERSION_MAJOR}.${SEAL_VERSION_MINOR}.pc)
-set(SEAL_CONFIG_VERSION_FILENAME ${SEAL_SOURCE_DIR}/cmake/SEALConfigVersion.cmake)
+set(SEAL_PKGCONFIG_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/seal-${SEAL_VERSION_MAJOR}.${SEAL_VERSION_MINOR}.pc)
+set(SEAL_CONFIG_VERSION_FILENAME ${CMAKE_CURRENT_BINARY_DIR}/cmake/SEALConfigVersion.cmake)
set(SEAL_CONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/SEAL-${SEAL_VERSION_MAJOR}.${SEAL_VERSION_MINOR})
set(SEAL_PKGCONFIG_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
set(SEAL_INCLUDES_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/SEAL-${SEAL_VERSION_MAJOR}.${SEAL_VERSION_MINOR})
set(SEAL_INCLUDES_BUILD_DIR ${SEAL_SOURCE_DIR}/native/src)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${SEAL_SOURCE_DIR}/bin)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(SEAL_THIRDPARTY_DIR ${SEAL_SOURCE_DIR}/thirdparty)
# For extra modules we might have
@@ -830,7 +830,7 @@ unset(SEAL_MACOS_SEAL_C_PATH)
# Create SEALNet-multi.nuspec for a multi-platform NuGet package
configure_file(
${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet-multi.nuspec.in
- ${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet-multi.nuspec
+ ${CMAKE_CURRENT_BINARY_DIR}/dotnet/nuget/SEALNet-multi.nuspec
@ONLY)
set(SEAL_WINDOWS_SEAL_C_PATH "")
@@ -855,11 +855,11 @@ endif()
# Create SEALNet.nuspec for a local NuGet pack from SEALNet.nuspec.in
configure_file(
${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet.nuspec.in
- ${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet.nuspec
+ ${CMAKE_CURRENT_BINARY_DIR}/dotnet/nuget/SEALNet.nuspec
@ONLY)
# Create SEALNet.targets from SEALNet.targets.in
configure_file(
${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet.targets.in
- ${SEAL_SOURCE_DIR}/dotnet/nuget/SEALNet.targets
+ ${CMAKE_CURRENT_BINARY_DIR}/dotnet/nuget/SEALNet.targets
@ONLY)
diff --git a/native/src/seal/util/CMakeLists.txt b/native/src/seal/util/CMakeLists.txt
index 3f2c7ba..a15e634 100644
--- a/native/src/seal/util/CMakeLists.txt
+++ b/native/src/seal/util/CMakeLists.txt
@@ -28,7 +28,8 @@ target_sources(seal_obj PRIVATE
)
# Create the config file
-configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h.in ${CMAKE_CURRENT_LIST_DIR}/config.h)
+configure_file(${CMAKE_CURRENT_LIST_DIR}/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/seal/util/config.h)
+target_include_directories(seal_obj PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
# Add header files for installation
install(
@@ -38,7 +39,7 @@ install(
${CMAKE_CURRENT_LIST_DIR}/clang.h
${CMAKE_CURRENT_LIST_DIR}/clipnormal.h
${CMAKE_CURRENT_LIST_DIR}/common.h
- ${CMAKE_CURRENT_LIST_DIR}/config.h
+ ${CMAKE_CURRENT_BINARY_DIR}/seal/util/config.h
${CMAKE_CURRENT_LIST_DIR}/croots.h
${CMAKE_CURRENT_LIST_DIR}/defines.h
${CMAKE_CURRENT_LIST_DIR}/galois.h

View File

@ -3,31 +3,32 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO microsoft/SEAL
REF e3ad13edf7e5b4dc8a59fd2cd6235ad9d7428cab
SHA512 9d52a51bd1d3141e45fd1f92134433a9eb7458e125140501952535c67ea49e0c66ccd4a80f7473c31db1963afcd7e690c716ea32d195cb07ba6fa60847168a91
REF 3eea4353d4768c79899a67ca4d36bfc3005d5412
SHA512 ee3d8926f4a26c8f67a9e79fe5da9883195d2e9f9fffa47bb9c3526150d1e0c179968af7222ca280574921feb3c45200da1ca4dc0b012b82aa57dbdef26dcc0a
HEAD_REF master
PATCHES no-source-writes.patch
)
if("zlib" IN_LIST FEATURES)
message("SEAL currently does not support non-vendored zlib -- ignoring feature 'zlib'")
endif()
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
ms-gsl SEAL_USE_MSGSL
zlib SEAL_USE_ZLIB
zstd SEAL_USE_ZSTD
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
DISABLE_PARALLEL_CONFIGURE
OPTIONS
-DALLOW_COMMAND_LINE_BUILD=ON
-DSEAL_BUILD_EXAMPLES=OFF
-DSEAL_BUILD_TESTS=OFF
-DSEAL_BUILD_DEPS=OFF
-DSEAL_BUILD_EXAMPLES=OFF
-DSEAL_BUILD_TESTS=OFF
-DSEAL_BUILD_SEAL_C=OFF
-DSEAL_USE_MSGSL=OFF
-DSEAL_USE_ZLIB=OFF
${FEATURE_OPTIONS}
)
vcpkg_build_cmake(TARGET seal LOGFILE_ROOT build)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
file(GLOB CONFIG_PATH RELATIVE "${CURRENT_PACKAGES_DIR}" "${CURRENT_PACKAGES_DIR}/lib/cmake/SEAL-*")
if(NOT CONFIG_PATH)
@ -35,9 +36,12 @@ if(NOT CONFIG_PATH)
endif()
vcpkg_fixup_cmake_targets(CONFIG_PATH "${CONFIG_PATH}")
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
vcpkg_copy_pdbs()