Skip to content

Commit

Permalink
Merge branch 'master' into more-lief
Browse files Browse the repository at this point in the history
* master: (64 commits)
  [baseline] [python3] fix bz2(d) search on linux (microsoft#23525)
  [HPX] Don't remove HPXCacheVariables.cmake during install (microsoft#23042)
  [earcut.hpp] New port (microsoft#23507)
  [libssh2] Fix deleted configfiles (microsoft#23509)
  [python3] Update to Python 3.10.2. (microsoft#23156)
  [qt5-webengine] Fix apply patch failed (microsoft#23484)
  [llvm] Fix LLVM install for 'utils' feature (microsoft#23399)
  [sciter-js] Updated sciter-js to 4.4.8.31 (microsoft#23357)
  [GTL] Add new port (microsoft#23400)
  [raylib] Fix cannot find -lglfw on Linux (microsoft#23348)
  [yato] fix arm build by updating (microsoft#23406)
  [ois] fix pkgconfig file not installed on windows (microsoft#23426)
  Fix the dependency of installing arrow with the parquet feature (microsoft#23423)
  [libjpeg-turbo] Fix usage when building static (microsoft#23427)
  [sentencepiece] Clarify supported triplets (microsoft#23438)
  [zpp-bits] Add new port (microsoft#23458)
  [lionkor-commandline] Add new port (microsoft#23471)
  [libde265] fix static linkage (microsoft#23479)
  [libheif] fix license (microsoft#23480)
  [proj4] Retain former features (fixes `vcpkg upgrade`) (microsoft#23487)
  ...
  • Loading branch information
ekilmer committed Mar 14, 2022
2 parents edcc2c6 + 9659615 commit cc8c5a7
Show file tree
Hide file tree
Showing 346 changed files with 3,079 additions and 1,447 deletions.
115 changes: 68 additions & 47 deletions ports/7zip/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,17 @@
# Created from 7-zip v19.00 - 7zip/CPP/7zip/Bundles/Format7zF

cmake_minimum_required(VERSION 3.11)
cmake_policy(VERSION 3.11)
cmake_minimum_required(VERSION 3.19)

project(7zip LANGUAGES C CXX ASM_MASM)
project(7zip LANGUAGES C CXX)

set(SRC_ASM
Asm/x86/AesOpt.asm
Asm/x86/7zCrcOpt.asm
Asm/x86/XzCrc64Opt.asm
)

if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set_source_files_properties(${SRC_ASM} PROPERTIES COMPILE_FLAGS "-Dx64")
else()
set_source_files_properties(${SRC_ASM} PROPERTIES COMPILE_FLAGS "-safeseh")
if(VCPKG_TARGET_IS_WINDOWS)
enable_language(ASM_MASM)
elseif(VCPKG_TARGET_IS_LINUX)
enable_language(ASM)
endif()

set(SRC_COMPRESS
add_library(7zip)

target_sources(7zip PRIVATE
CPP/7zip/Compress/Bcj2Coder.cpp
CPP/7zip/Compress/Bcj2Register.cpp
CPP/7zip/Compress/BcjCoder.cpp
Expand Down Expand Up @@ -68,9 +62,6 @@ set(SRC_COMPRESS
CPP/7zip/Compress/ZlibEncoder.cpp
CPP/7zip/Compress/ZDecoder.cpp
CPP/7zip/Compress/CodecExports.cpp
)

set(SRC_CRYPTO
CPP/7zip/Crypto/7zAes.cpp
CPP/7zip/Crypto/7zAesRegister.cpp
CPP/7zip/Crypto/HmacSha1.cpp
Expand All @@ -85,9 +76,7 @@ set(SRC_CRYPTO
CPP/7zip/Crypto/WzAes.cpp
CPP/7zip/Crypto/ZipCrypto.cpp
CPP/7zip/Crypto/ZipStrong.cpp
)

set(SRC_C
C/7zBuf2.c
C/7zStream.c
C/Alloc.c
Expand All @@ -113,6 +102,7 @@ set(SRC_C
C/MtDec.c
C/Ppmd7.c
C/Ppmd7Dec.c
C/Ppmd7aDec.c
C/Ppmd7Enc.c
C/Ppmd8.c
C/Ppmd8Dec.c
Expand All @@ -128,24 +118,16 @@ set(SRC_C
C/Aes.c
C/7zCrc.c
C/XzCrc64.c
)

set_source_files_properties(
${SRC_COMPRESS}
${SRC_CRYPTO}
${SRC_C}
PROPERTIES
COMPILE_FLAGS $<$<CONFIG:RELEASE>:"/O2">
)

set(SRC_OTHER
CPP/Common/CRC.cpp
CPP/Common/CrcReg.cpp
CPP/Common/DynLimBuf.cpp
CPP/Common/IntToString.cpp
CPP/Common/LzFindPrepare.cpp
CPP/Common/MyMap.cpp
CPP/Common/MyString.cpp
CPP/Common/MyVector.cpp
CPP/Common/MyWindows.cpp
CPP/Common/MyXml.cpp
CPP/Common/NewHandler.cpp
CPP/Common/Sha1Reg.cpp
Expand Down Expand Up @@ -193,6 +175,7 @@ set(SRC_OTHER
CPP/7zip/Archive/ArHandler.cpp
CPP/7zip/Archive/ArjHandler.cpp
CPP/7zip/Archive/Bz2Handler.cpp
CPP/7zip/Archive/Base64Handler.cpp
CPP/7zip/Archive/ComHandler.cpp
CPP/7zip/Archive/CpioHandler.cpp
CPP/7zip/Archive/CramfsHandler.cpp
Expand Down Expand Up @@ -303,32 +286,72 @@ set(SRC_OTHER
CPP/7zip/Archive/Zip/ZipOut.cpp
CPP/7zip/Archive/Zip/ZipUpdate.cpp
CPP/7zip/Archive/Zip/ZipRegister.cpp
)

add_library(7zip
${SRC_ASM}
${SRC_OTHER}
${SRC_COMPRESS}
${SRC_CRYPTO}
${SRC_C}
CPP/7zip/Archive/Archive2.def
C/Util/LzmaLib/LzmaLib.def
)

# 7zCrcOpt # AesOpt # Sha1Opt # Sha256Opt # XzCrc64Opt # LzFindOpt
set(WINDOWS_PRIVATE_HEADERS
Asm/x86/7zCrcOpt.asm
Asm/x86/AesOpt.asm
Asm/x86/Sha1Opt.asm
Asm/x86/Sha256Opt.asm
Asm/x86/XzCrc64Opt.asm
Asm/x86/LzFindOpt.asm
)
set(WINDOWS_PRIVATE_SOURCE_FILES
C/7zCrcOpt.c
C/AesOpt.c
C/Sha1Opt.c
C/Sha256Opt.c
C/XzCrc64Opt.c
C/LzFindOpt.c
)

if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
target_sources(7zip PRIVATE ${WINDOWS_PRIVATE_HEADERS})
set_source_files_properties(${WINDOWS_PRIVATE_HEADERS} PROPERTIES LANGUAGE ASM_MASM)
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
#target_sources(7zip PRIVATE Asm/arm/7zCrcOpt.asm)
target_sources(7zip PRIVATE C/7zCrcOpt.c)
else()
target_sources(7zip PRIVATE ${WINDOWS_PRIVATE_SOURCE_FILES})
endif()
else()
target_sources(7zip PRIVATE ${WINDOWS_PRIVATE_SOURCE_FILES})
endif()

# LzmaDecOpt
target_sources(7zip PRIVATE C/LzmaDec.c)
if((VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") OR
(VCPKG_TARGET_IS_LINUX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
)
if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
target_sources(7zip PRIVATE Asm/x86/LzmaDecOpt.asm)
set_source_files_properties(Asm/x86/LzmaDecOpt.asm PROPERTIES LANGUAGE ASM_MASM)
elseif(VCPKG_TARGET_IS_LINUX AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
target_sources(7zip PRIVATE Asm/arm64/LzmaDecOpt.S)
set_source_files_properties(Asm/x86/LzmaDecOpt.asm PROPERTIES LANGUAGE ASM)
endif()

get_source_file_property(defs C/LzmaDec.c COMPILE_DEFINITIONS)
list(APPEND defs "_LZMA_DEC_OPT")
set_source_files_properties(C/LzmaDec.c PROPERTIES COMPILE_DEFINITIONS "${defs}")
endif()

target_compile_definitions(7zip
PUBLIC
-D_REENTRANT
-D_FILE_OFFSET_BITS=64
-D_LARGEFILE_SOURCE
-DEXTERNAL_CODECS
-D_7ZIP_LARGE_PAGES
-DUNICODE
-D_UNICODE
)

target_compile_options(7zip
PRIVATE
/wd5043
$<$<CONFIG:RELEASE>:/guard:cf>
)

target_include_directories(7zip
INTERFACE
$<INSTALL_INTERFACE:include>/7zip/CPP
Expand Down Expand Up @@ -359,7 +382,7 @@ set(PUBLIC_HEADERS

install(
TARGETS 7zip
EXPORT 7zip
EXPORT 7zip-targets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
Expand All @@ -376,9 +399,7 @@ foreach(HEADER ${PUBLIC_HEADERS})
endforeach()

install(
EXPORT 7zip
EXPORT 7zip-targets
DESTINATION share/7zip
FILE 7zipConfig.cmake
NAMESPACE 7zip::
CONFIGURATIONS Release
)
90 changes: 0 additions & 90 deletions ports/7zip/License.txt

This file was deleted.

22 changes: 11 additions & 11 deletions ports/7zip/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
set(7ZIP_VERSION 19.00)
set(7ZIP_VERSION 21.07)
vcpkg_download_distfile(ARCHIVE
URLS "https://www.7-zip.org/a/7z1900-src.7z"
FILENAME "7z1900-src.7z"
SHA512 d68b308e175224770adc8b1495f1ba3cf3e7f67168a7355000643d3d32560ae01aa34266f0002395181ed91fb5e682b86e0f79c20625b42d6e2c62dd24a5df93
URLS "https://www.7-zip.org/a/7z2107-src.7z"
FILENAME "7z2107-src.7z"
SHA512 c13521a9829ac239a89015e1f5da27eeaa2469754e3f8ca32311d964ea9d0b40a17e4f8ccbd425d3e865aa768be345368f1c36f354d5710ac7cb2749dd6a3ab5
)

vcpkg_extract_source_archive_ex(
Expand All @@ -14,17 +14,17 @@ vcpkg_extract_source_archive_ex(

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)

vcpkg_install_cmake()

vcpkg_cmake_install()
vcpkg_copy_pdbs()

vcpkg_cmake_config_fixup()

file(
INSTALL ${CMAKE_CURRENT_LIST_DIR}/License.txt
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
INSTALL "${SOURCE_PATH}/DOC/License.txt"
DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}"
RENAME copyright
)
16 changes: 13 additions & 3 deletions ports/7zip/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
{
"name": "7zip",
"version-string": "19.00",
"port-version": 4,
"version-string": "21.07",
"description": "Library for archiving file with a high compression ratio.",
"homepage": "https://www.7-zip.org",
"supports": "!(linux | osx | arm | uwp)"
"license": "LGPL-2.1-or-later",
"supports": "!uwp",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
13 changes: 6 additions & 7 deletions ports/ampl-asl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,22 @@ vcpkg_from_github(
install-targets.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_MCMODELLARGE=OFF
-DBUILD_DYNRT_LIBS=OFF # CRT linkage uses C/CXX FLAGS in vcpkg
-DBUILD_MT_LIBS=OFF # CRT linkage uses C/CXX FLAGS in vcpkg
-DBUILD_CPP=ON
)

vcpkg_install_cmake()
vcpkg_cmake_install()

vcpkg_copy_pdbs()

vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-asl TARGET_PATH share/unofficial-asl)
vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-asl)

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

# from ampl-mp license
file(INSTALL ${CURRENT_PORT_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL "${CURRENT_PORT_DIR}/copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
Loading

0 comments on commit cc8c5a7

Please sign in to comment.