diff --git a/vcpkg/ports/libarchive/disable-warnings.patch b/vcpkg/ports/libarchive/disable-warnings.patch new file mode 100644 index 0000000000..455939479a --- /dev/null +++ b/vcpkg/ports/libarchive/disable-warnings.patch @@ -0,0 +1,14 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2634da..d037071 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -155,9 +155,6 @@ IF (MSVC) + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" +- # Enable level 4 C4062: The enumerate has no associated handler in a switch +- # statement and there is no default that can catch it. +- SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14062") + # Enable level 4 C4254: A larger bit field was assigned to a smaller bit + # field. + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /w14254") diff --git a/vcpkg/ports/libarchive/fix-buildsystem.patch b/vcpkg/ports/libarchive/fix-buildsystem.patch new file mode 100644 index 0000000000..4ae72167d6 --- /dev/null +++ b/vcpkg/ports/libarchive/fix-buildsystem.patch @@ -0,0 +1,110 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b2634da6..0d846877 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -148,10 +148,6 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^XL$") + SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -qinfo=pro:use") + ENDIF(CMAKE_C_COMPILER_ID MATCHES "^XL$") + IF (MSVC) +- if (ENABLE_WERROR) +- # /WX option is the same as gcc's -Werror option. +- SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX") +- endif () + ################################################################# + # Set compile flags for debug build. + # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug" +@@ -382,8 +378,6 @@ IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + # Maybe DLL path is "C:/Program Files/GnuWin32/bin". + # The zlib and the bzip2 Setup program have installed programs and DLLs into + # "C:/Program Files/GnuWin32" by default. +- # This is convenience setting for Windows. +- SET(CMAKE_PREFIX_PATH ${__GNUWIN32PATH} $(CMAKE_PREFIX_PATH)) + # + # If you didn't use Setup program or installed into nonstandard path, + # cmake cannot find out your zlib or bzip2 libraries and include files, +@@ -420,14 +414,7 @@ IF(ZLIB_FOUND) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) + IF(WIN32 AND NOT CYGWIN) +- # +- # Test if ZLIB_WINAPI macro is needed to use. +- # +- TRY_MACRO_FOR_LIBRARY( +- "${ZLIB_INCLUDE_DIR}" "${ZLIB_LIBRARIES}" +- RUNS +- "#include \nint main() {uLong f = zlibCompileFlags(); return (f&(1U<<10))?0:-1; }" +- ZLIB_WINAPI) ++ SET(ZLIB_WINAPI OFF) # skip following test, it crashes with weird message box + IF(ZLIB_WINAPI) + ADD_DEFINITIONS(-DZLIB_WINAPI) + ELSE(ZLIB_WINAPI) +@@ -1356,7 +1341,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(localtime_r HAVE_LOCALTIME_R) + CHECK_FUNCTION_EXISTS_GLIBC(lstat HAVE_LSTAT) + CHECK_FUNCTION_EXISTS_GLIBC(lutimes HAVE_LUTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(mbrtowc HAVE_MBRTOWC) +-CHECK_FUNCTION_EXISTS_GLIBC(memmove HAVE_MEMMOVE) ++set(HAVE_MEMMOVE 1) + CHECK_FUNCTION_EXISTS_GLIBC(mkdir HAVE_MKDIR) + CHECK_FUNCTION_EXISTS_GLIBC(mkfifo HAVE_MKFIFO) + CHECK_FUNCTION_EXISTS_GLIBC(mknod HAVE_MKNOD) +@@ -1388,10 +1373,10 @@ CHECK_FUNCTION_EXISTS_GLIBC(utime HAVE_UTIME) + CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES) + CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT) + CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK) +-CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP) +-CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY) +-CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN) +-CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB) ++set(HAVE_WCRTOMB 1) ++set(HAVE_WCSCMP 1) ++set(HAVE_WCSCPY 1) ++set(HAVE_WCSLEN 1) ++set(HAVE_WCTOMB 1) + CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64) + CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE) +@@ -1405,10 +1390,10 @@ CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH) + CHECK_FUNCTION_EXISTS(fseeko HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS(strerror_r HAVE_STRERROR_R) + CHECK_FUNCTION_EXISTS(strftime HAVE_STRFTIME) +-CHECK_FUNCTION_EXISTS(vprintf HAVE_VPRINTF) +-CHECK_FUNCTION_EXISTS(wmemcmp HAVE_WMEMCMP) +-CHECK_FUNCTION_EXISTS(wmemcpy HAVE_WMEMCPY) +-CHECK_FUNCTION_EXISTS(wmemmove HAVE_WMEMMOVE) ++set(HAVE_VPRINTF 1) ++set(HAVE_WMEMCMP 1) ++set(HAVE_WMEMCPY 1) ++set(HAVE_WMEMMOVE 1) + + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + +@@ -2018,7 +2007,7 @@ INCLUDE(CreatePkgConfigFile) + # + # Register installation of PDF documents. + # +-IF(WIN32 AND NOT CYGWIN) ++IF(0) + # + # On Windows platform, It's better that we install PDF documents + # on one's computer. +diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt +index f7fdfb68a..98d287e8c 100644 +--- a/libarchive/CMakeLists.txt ++++ b/libarchive/CMakeLists.txt +@@ -267,11 +267,12 @@ IF(ENABLE_INSTALL) + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ARCHIVE DESTINATION lib) ++ ELSE() ++ INSTALL(TARGETS archive_static ++ RUNTIME DESTINATION bin ++ LIBRARY DESTINATION lib ++ ARCHIVE DESTINATION lib) + ENDIF(BUILD_SHARED_LIBS) +- INSTALL(TARGETS archive_static +- RUNTIME DESTINATION bin +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib) + INSTALL_MAN(${libarchive_MANS}) + INSTALL(FILES ${include_HEADERS} DESTINATION include) + ENDIF() diff --git a/vcpkg/ports/libarchive/fix-cpu-set.patch b/vcpkg/ports/libarchive/fix-cpu-set.patch new file mode 100644 index 0000000000..8d1924dbe8 --- /dev/null +++ b/vcpkg/ports/libarchive/fix-cpu-set.patch @@ -0,0 +1,15 @@ +diff --git a/libarchive/archive_random.c b/libarchive/archive_random.c +index 65ea691..63217ec 100644 +--- a/libarchive/archive_random.c ++++ b/libarchive/archive_random.c +@@ -48,6 +48,10 @@ __FBSDID("$FreeBSD$"); + #include + #endif + #ifdef HAVE_PTHREAD_H ++#ifdef __GNUC__ ++#define _GNU_SOURCE ++#include ++#endif + #include + #endif + diff --git a/vcpkg/ports/libarchive/fix-deps.patch b/vcpkg/ports/libarchive/fix-deps.patch new file mode 100644 index 0000000000..83531aab0e --- /dev/null +++ b/vcpkg/ports/libarchive/fix-deps.patch @@ -0,0 +1,257 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3539519..95b44ba 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -407,6 +407,8 @@ IF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + ENDIF(DEFINED __GNUWIN32PATH AND EXISTS "${__GNUWIN32PATH}") + + SET(ADDITIONAL_LIBS "") ++SET(LIBARCHIVE_LIBS_PRIVATE "") # additional libs for which the pc module is unknown ++SET(LIBSREQUIRED "") # pc modules for additonal libs + # + # Find ZLIB + # +@@ -420,6 +422,7 @@ IF(ZLIB_FOUND) + SET(HAVE_ZLIB_H 1) + INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${ZLIB_LIBRARIES}) ++ STRING(APPEND LIBSREQUIRED " zlib") + IF(WIN32 AND NOT CYGWIN) + SET(ZLIB_WINAPI OFF) # skip following test, it crashes with weird message box + IF(ZLIB_WINAPI) +@@ -452,6 +455,7 @@ IF(BZIP2_FOUND) + SET(HAVE_BZLIB_H 1) + INCLUDE_DIRECTORIES(${BZIP2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${BZIP2_LIBRARIES}) ++ STRING(APPEND LIBSREQUIRED " bzip2") + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${BZIP2_INCLUDE_DIR}" "${BZIP2_LIBRARIES}" +@@ -480,6 +484,8 @@ ENDIF() + IF(LIBLZMA_FOUND) + SET(HAVE_LIBLZMA 1) + SET(HAVE_LZMA_H 1) ++ LIST(APPEND ADDITIONAL_LIBS LibLZMA::LibLZMA) ++ STRING(APPEND LIBSREQUIRED " liblzma") + CMAKE_PUSH_CHECK_STATE() + SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES}) +@@ -521,6 +528,7 @@ IF(LZO2_FOUND) + SET(HAVE_LZO_LZO1X_H 1) + INCLUDE_DIRECTORIES(${LZO2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LZO2_LIBRARY}) ++ STRING(APPEND LIBSREQUIRED " lzo2") + # + # TODO: test for static library. + # +@@ -548,7 +556,8 @@ IF(LIBB2_FOUND) + SET(HAVE_BLAKE2_H 1) + SET(ARCHIVE_BLAKE2 FALSE) + LIST(APPEND ADDITIONAL_LIBS ${LIBB2_LIBRARY}) + INCLUDE_DIRECTORIES(${LIBB2_INCLUDE_DIR}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${LIBB2_LIBRARY}) + CMAKE_PUSH_CHECK_STATE() + SET(CMAKE_REQUIRED_LIBRARIES ${LIBB2_LIBRARY}) + SET(CMAKE_REQUIRED_INCLUDES ${LIBB2_INCLUDE_DIR}) +@@ -560,6 +569,8 @@ ENDIF(LIBB2_FOUND) + # Find LZ4 + # + IF(ENABLE_LZ4) ++ FIND_PACKAGE(LZ4 NAMES lz4 CONFIG REQUIRED) ++elseif(0) + IF (LZ4_INCLUDE_DIR) + # Already in cache, be silent + SET(LZ4_FIND_QUIETLY TRUE) +@@ -575,6 +586,10 @@ ENDIF(ENABLE_LZ4) + IF(LZ4_FOUND) + SET(HAVE_LIBLZ4 1) + SET(HAVE_LZ4_H 1) ++ SET(HAVE_LZ4HC_H 1) ++ LIST(APPEND ADDITIONAL_LIBS lz4::lz4) ++ STRING(APPEND LIBSREQUIRED " liblz4") ++elseif(0) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_INCLUDES ${LZ4_INCLUDE_DIR}) + CHECK_INCLUDE_FILES("lz4hc.h" HAVE_LZ4HC_H) +@@ -591,6 +606,8 @@ MARK_AS_ADVANCED(CLEAR LZ4_LIBRARY) + # Find Zstd + # + IF(ENABLE_ZSTD) ++ FIND_PACKAGE(ZSTD NAMES zstd CONFIG REQUIRED) ++elseif(0) + IF (ZSTD_INCLUDE_DIR) + # Already in cache, be silent + SET(ZSTD_FIND_QUIETLY TRUE) +@@ -610,6 +627,15 @@ ELSE(ENABLE_ZSTD) + ENDIF(ENABLE_ZSTD) + IF(ZSTD_FOUND) + SET(HAVE_ZSTD_H 1) ++ SET(HAVE_LIBZSTD 1) ++ SET(HAVE_LIBZSTD_COMPRESSOR 1) ++ IF(TARGET zstd::libzstd_shared) ++ LIST(APPEND ADDITIONAL_LIBS zstd::libzstd_shared) ++ ELSE() ++ LIST(APPEND ADDITIONAL_LIBS zstd::libzstd_static) ++ ENDIF(TARGET zstd::libzstd_shared) ++ STRING(APPEND LIBSREQUIRED " libzstd") ++elseif(0) + INCLUDE_DIRECTORIES(${ZSTD_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${ZSTD_LIBRARY}) + CMAKE_PUSH_CHECK_STATE() +@@ -718,6 +744,7 @@ IF(ENABLE_CNG) + LA_CHECK_INCLUDE_FILE("bcrypt.h" HAVE_BCRYPT_H) + IF(HAVE_BCRYPT_H) + LIST(APPEND ADDITIONAL_LIBS "bcrypt") ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE "bcrypt") + ENDIF(HAVE_BCRYPT_H) + ELSE(ENABLE_CNG) + UNSET(HAVE_BCRYPT_H CACHE) +@@ -749,6 +776,7 @@ IF(ENABLE_MBEDTLS) + IF(MBEDTLS_FOUND) + SET(HAVE_LIBMBEDCRYPTO 1) + LIST(APPEND ADDITIONAL_LIBS ${MBEDCRYPTO_LIBRARY}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${MBEDCRYPTO_LIBRARY}) + INCLUDE_DIRECTORIES(${MBEDTLS_INCLUDE_DIRS}) + + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${MBEDTLS_INCLUDE_DIRS}) +@@ -769,6 +797,7 @@ IF(ENABLE_NETTLE) + IF(NETTLE_FOUND) + SET(HAVE_LIBNETTLE 1) + LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARIES}) ++ STRING(APPEND LIBSREQUIRED " nettle") + INCLUDE_DIRECTORIES(${NETTLE_INCLUDE_DIR}) + + LIST(APPEND CMAKE_REQUIRED_INCLUDES ${NETTLE_INCLUDE_DIR}) +@@ -792,8 +821,8 @@ IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") + FIND_PACKAGE(OpenSSL) + IF(OPENSSL_FOUND) + SET(HAVE_LIBCRYPTO 1) +- INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) +- LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_CRYPTO_LIBRARY}) ++ LIST(APPEND ADDITIONAL_LIBS OpenSSL::Crypto) ++ STRING(APPEND LIBSREQUIRED " libcrypto") + SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY}) + SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR}) + LA_CHECK_INCLUDE_FILE("openssl/evp.h" HAVE_OPENSSL_EVP_H) +@@ -807,6 +836,7 @@ IF(NOT OPENSSL_FOUND) + SET(CMAKE_REQUIRED_LIBRARIES "md") + FIND_LIBRARY(LIBMD_LIBRARY NAMES md) + LIST(APPEND ADDITIONAL_LIBS ${LIBMD_LIBRARY}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${LIBMD_LIBRARY}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(LIBMD_FOUND) + ENDIF(NOT OPENSSL_FOUND) +@@ -912,7 +942,8 @@ main(int argc, char **argv) + IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) +- LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) ++ #LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) ++ STRING(APPEND LIBSREQUIRED " libssl") + ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) +@@ -1086,6 +1117,7 @@ IF(ENABLE_ICONV) + CHECK_ICONV("libiconv" "") + IF (HAVE_ICONV) + LIST(APPEND ADDITIONAL_LIBS ${LIBICONV_PATH}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${LIBICONV_PATH}) + ENDIF(HAVE_ICONV) + ENDIF(NOT HAVE_ICONV AND LIBICONV_PATH) + ENDIF(ICONV_INCLUDE_DIR) +@@ -1119,6 +1151,7 @@ IF(ENABLE_ICONV) + ENDIF(WIN32 AND NOT CYGWIN) + IF(HAVE_LOCALE_CHARSET) + LIST(APPEND ADDITIONAL_LIBS ${LIBCHARSET_PATH}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${LIBCHARSET_PATH}) + ENDIF(HAVE_LOCALE_CHARSET) + ENDIF(LIBCHARSET_PATH) + ENDIF(LIBICONV_PATH) +@@ -1152,6 +1185,7 @@ IF(LIBXML2_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LIBXML2_LIBRARIES}) ++ STRING(APPEND LIBSREQUIRED " libxml-2.0") + SET(HAVE_LIBXML2 1) + # libxml2's include files use iconv.h + SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR}) +@@ -1181,6 +1215,7 @@ ELSE(LIBXML2_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${EXPAT_LIBRARIES}) ++ STRING(APPEND LIBSREQUIRED " expat") + SET(HAVE_LIBEXPAT 1) + LA_CHECK_INCLUDE_FILE("expat.h" HAVE_EXPAT_H) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables +@@ -1211,6 +1246,7 @@ IF(POSIX_REGEX_LIB MATCHES "^(AUTO|LIBC|LIBREGEX)$") + CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBREGEX) + IF(HAVE_REGCOMP_LIBREGEX) + LIST(APPEND ADDITIONAL_LIBS ${REGEX_LIBRARY}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${REGEX_LIBRARY}) + # + # If regex.h is not found, retry looking for regex.h at + # REGEX_INCLUDE_DIR +@@ -1260,6 +1296,7 @@ IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$" + IF(PCREPOSIX_FOUND) + INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${PCREPOSIX_LIBRARIES}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${PCREPOSIX_LIBRARIES}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${PCRE_INCLUDE_DIR}" "${PCREPOSIX_LIBRARIES}" +@@ -1271,6 +1308,7 @@ IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$" + ELSEIF(NOT WITHOUT_PCRE_STATIC AND NOT PCRE_STATIC AND PCRE_FOUND) + # Determine if pcre static libraries are to be used. + LIST(APPEND ADDITIONAL_LIBS ${PCRE_LIBRARIES}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${PCRE_LIBRARIES}) + SET(TMP_LIBRARIES ${PCREPOSIX_LIBRARIES} ${PCRE_LIBRARIES}) + MESSAGE(STATUS "trying again with -lpcre included") + TRY_MACRO_FOR_LIBRARY( +@@ -1286,6 +1324,7 @@ IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$" + # ___chkstk_ms. + MESSAGE(STATUS "Visual Studio build detected, trying again with -lgcc included") + LIST(APPEND ADDITIONAL_LIBS ${LIBGCC_LIBRARIES}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${LIBGCC_LIBRARIES}) + SET(TMP_LIBRARIES ${PCREPOSIX_LIBRARIES} ${PCRE_LIBRARIES} ${LIBGCC_LIBRARIES}) + TRY_MACRO_FOR_LIBRARY( + "${PCRE_INCLUDE_DIR}" "${TMP_LIBRARIES}" +@@ -1805,6 +1844,7 @@ IF(ENABLE_ACL) + SET(CMAKE_REQUIRED_LIBRARIES "acl") + FIND_LIBRARY(ACL_LIBRARY NAMES acl) + LIST(APPEND ADDITIONAL_LIBS ${ACL_LIBRARY}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${ACL_LIBRARY}) + ENDIF(HAVE_LIBACL) + + CHECK_TYPE_EXISTS(acl_t "sys/types.h;sys/acl.h" HAVE_ACL_T) +@@ -1944,6 +1984,7 @@ int main(void) { return ACL_SYNCHRONIZE; }" HAVE_DECL_ACL_SYNCHRONIZE) + SET(CMAKE_REQUIRED_LIBRARIES "richacl") + FIND_LIBRARY(RICHACL_LIBRARY NAMES richacl) + LIST(APPEND ADDITIONAL_LIBS ${RICHACL_LIBRARY}) ++ LIST(APPEND LIBARCHIVE_LIBS_PRIVATE ${RICHACL_LIBRARY}) + ENDIF(HAVE_LIBRICHACL) + + CHECK_STRUCT_HAS_MEMBER("struct richace" e_type "sys/richacl.h" +diff --git a/build/cmake/CreatePkgConfigFile.cmake b/build/cmake/CreatePkgConfigFile.cmake +index bc5a43f..422b83b 100644 +--- a/build/cmake/CreatePkgConfigFile.cmake ++++ b/build/cmake/CreatePkgConfigFile.cmake +@@ -8,7 +8,7 @@ SET(libdir \${exec_prefix}/lib) + SET(includedir \${prefix}/include) + # Now, this is not particularly pretty, nor is it terribly accurate... + # Loop over all our additional libs +-FOREACH(mylib ${ADDITIONAL_LIBS}) ++FOREACH(mylib ${LIBARCHIVE_LIBS_PRIVATE}) + # Extract the filename from the absolute path + GET_FILENAME_COMPONENT(mylib_name ${mylib} NAME_WE) + # Strip the lib prefix +@@ -16,10 +16,6 @@ FOREACH(mylib ${ADDITIONAL_LIBS}) + # Append it to our LIBS string + SET(LIBS "${LIBS} -l${mylib_name}") + ENDFOREACH() +-# libxml2 is easier, since it's already using pkg-config +-FOREACH(mylib ${PC_LIBXML_STATIC_LDFLAGS}) +- SET(LIBS "${LIBS} ${mylib}") +-ENDFOREACH() + # FIXME: The order of the libraries doesn't take dependencies into account, + # thus there's a good chance it'll make some binutils versions unhappy... + # This only affects Libs.private (looked up for static builds) though. diff --git a/vcpkg/ports/libarchive/portfile.cmake b/vcpkg/ports/libarchive/portfile.cmake new file mode 100644 index 0000000000..548dc872e4 --- /dev/null +++ b/vcpkg/ports/libarchive/portfile.cmake @@ -0,0 +1,99 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO libarchive/libarchive + REF "v${VERSION}" + SHA512 95c6232d178b26daa0eeba43d64ea4235aa96fa279c85fff715ac5e6cc73b2e65f276770f91c3538cb8ca989380555169497628d73e120bfa52e12f657049ff0 + HEAD_REF master + PATCHES + disable-warnings.patch + fix-buildsystem.patch + fix-cpu-set.patch + fix-deps.patch +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS + FEATURES + bzip2 ENABLE_BZip2 + bzip2 CMAKE_REQUIRE_FIND_PACKAGE_BZip2 + libxml2 ENABLE_LIBXML2 + libxml2 CMAKE_REQUIRE_FIND_PACKAGE_LibXml2 + lz4 ENABLE_LZ4 + lz4 CMAKE_REQUIRE_FIND_PACKAGE_lz4 + lzma ENABLE_LZMA + lzma CMAKE_REQUIRE_FIND_PACKAGE_LibLZMA + lzo ENABLE_LZO + tools ENABLE_TAR + tools ENABLE_CPIO + tools ENABLE_CAT + tools ENABLE_UNZIP + zstd ENABLE_ZSTD +) +# Default crypto backend is OpenSSL, but it is ignored for DARWIN +set(WRAPPER_ENABLE_OPENSSL OFF) +if(NOT "crypto" IN_LIST FEATURES) + list(APPEND FEATURE_OPTIONS + -DLIBMD_FOUND=FALSE + -DENABLE_OPENSSL=OFF + ) +elseif(VCPKG_TARGET_IS_OSX) + list(APPEND FEATURE_OPTIONS + -DENABLE_MBEDTLS=ON + -DENABLE_OPENSSL=OFF + -DCMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=ON + ) +else() + set(WRAPPER_ENABLE_OPENSSL ON) + list(APPEND FEATURE_OPTIONS + -DCMAKE_REQUIRE_FIND_PACKAGE_OpenSSL=ON + ) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} + -DENABLE_ZLIB=ON + -DENABLE_PCREPOSIX=OFF + -DPOSIX_REGEX_LIB=NONE + -DENABLE_MBEDTLS=OFF + -DENABLE_NETTLE=OFF + -DENABLE_EXPAT=OFF + -DENABLE_LibGCC=OFF + -DENABLE_CNG=OFF + -DENABLE_TAR=OFF + -DENABLE_CPIO=OFF + -DENABLE_CAT=OFF + -DENABLE_XATTR=OFF + -DENABLE_ACL=OFF + -DENABLE_ICONV=OFF + -DENABLE_LIBB2=OFF + -DENABLE_TEST=OFF + -DENABLE_WERROR=OFF + MAYBE_UNUSED_VARIABLES + CMAKE_REQUIRE_FIND_PACKAGE_BZip2 + CMAKE_REQUIRE_FIND_PACKAGE_LibLZMA + CMAKE_REQUIRE_FIND_PACKAGE_LibXml2 + CMAKE_REQUIRE_FIND_PACKAGE_lz4 + ENABLE_LibGCC +) + +vcpkg_cmake_install() + +vcpkg_fixup_pkgconfig() + +vcpkg_copy_pdbs() + +configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) + +file(REMOVE_RECURSE + "${CURRENT_PACKAGES_DIR}/debug/include" + "${CURRENT_PACKAGES_DIR}/debug/share" + "${CURRENT_PACKAGES_DIR}/share/man" +) + +foreach(header "include/archive.h" "include/archive_entry.h") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/${header}" "(!defined LIBARCHIVE_STATIC)" "0") +endforeach() + +file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/vcpkg/ports/libarchive/usage b/vcpkg/ports/libarchive/usage new file mode 100644 index 0000000000..75ccb94e90 --- /dev/null +++ b/vcpkg/ports/libarchive/usage @@ -0,0 +1,9 @@ +libarchive is compatible with the CMake Find Module: + + find_package(LibArchive REQUIRED) + target_link_libraries(main PRIVATE LibArchive::LibArchive) # since CMake 3.17 + +libarchive provides pkg-config modules: + + # library that can create and read several streaming archive formats + libarchive diff --git a/vcpkg/ports/libarchive/vcpkg-cmake-wrapper.cmake.in b/vcpkg/ports/libarchive/vcpkg-cmake-wrapper.cmake.in new file mode 100644 index 0000000000..e23a0936b7 --- /dev/null +++ b/vcpkg/ports/libarchive/vcpkg-cmake-wrapper.cmake.in @@ -0,0 +1,70 @@ +cmake_policy(PUSH) +cmake_policy(SET CMP0012 NEW) +cmake_policy(SET CMP0057 NEW) +set(z_vcpkg_libarchive_args "") +if("REQUIRED" IN_LIST ARGS) + list(APPEND z_vcpkg_libarchive_args "REQUIRED") +endif() +if("QUIET" IN_LIST ARGS) + list(APPEND z_vcpkg_libarchive_args "QUIET") +endif() + +_find_package(${ARGS}) + +if(LibArchive_FOUND AND "@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") + set(z_vcpkg_libarchive_libs "") + find_package(ZLIB ${z_vcpkg_libarchive_args}) + list(APPEND z_vcpkg_libarchive_libs ZLIB::ZLIB) + if("@ENABLE_BZip2@") + find_package(BZip2 ${z_vcpkg_libarchive_args}) + list(APPEND z_vcpkg_libarchive_libs BZip2::BZip2) + endif() + if("@ENABLE_LIBXML2@") + find_package(LibXml2 ${z_vcpkg_libarchive_args}) + list(APPEND z_vcpkg_libarchive_libs LibXml2::LibXml2) + endif() + if("@ENABLE_LZ4@") + find_package(lz4 CONFIG ${z_vcpkg_libarchive_args}) + list(APPEND z_vcpkg_libarchive_libs lz4::lz4) + endif() + if("@ENABLE_LZMA@") + find_package(LibLZMA ${z_vcpkg_libarchive_args}) + list(APPEND z_vcpkg_libarchive_libs LibLZMA::LibLZMA) + endif() + if("@ENABLE_LZO@") + include(SelectLibraryConfigurations) + find_library(Z_VCPKG_LZO_LIBRARY_DEBUG NAMES lzo2d lzo2 NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) + find_library(Z_VCPKG_LZO_LIBRARY_RELEASE NAMES lzo2 NAMES_PER_DIR PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) + select_library_configurations(Z_VCPKG_LZO) + if(Z_VCPKG_LZO_LIBRARY) + list(APPEND z_vcpkg_libarchive_libs ${Z_VCPKG_LZO_LIBRARY}) + else() + set(LibArchive_FOUND FALSE) + endif() + endif() + if("@ENABLE_ZSTD@") + find_package(zstd ${z_vcpkg_libarchive_args}) + list(APPEND z_vcpkg_libarchive_libs zstd::libzstd) + endif() + if("@WRAPPER_ENABLE_OPENSSL@") + find_package(OpenSSL ${z_vcpkg_libarchive_args}) + list(APPEND z_vcpkg_libarchive_libs OpenSSL::Crypto) + endif() + + if(TARGET LibArchive::LibArchive) + set(LibArchive_LIBRARIES LibArchive::LibArchive) + if(Z_VCPKG_LZO_LIBRARY AND Z_VCPKG_LZO_LIBRARY_DEBUG) + list(REMOVE_ITEM z_vcpkg_libarchive_libs ${Z_VCPKG_LZO_LIBRARY}) + list(APPEND z_vcpkg_libarchive_libs + "\$<\$>:${Z_VCPKG_LZO_LIBRARY_RELEASE}>" + "\$<\$:${Z_VCPKG_LZO_LIBRARY_DEBUG}>" + ) + endif() + set_property(TARGET LibArchive::LibArchive APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${z_vcpkg_libarchive_libs}) + else() + list(APPEND LibArchive_LIBRARIES ${z_vcpkg_libarchive_libs}) + endif() + unset(z_vcpkg_libarchive_libs) +endif() +unset(z_vcpkg_libarchive_args) +cmake_policy(POP) diff --git a/vcpkg/ports/libarchive/vcpkg.json b/vcpkg/ports/libarchive/vcpkg.json new file mode 100644 index 0000000000..3d035d8e6a --- /dev/null +++ b/vcpkg/ports/libarchive/vcpkg.json @@ -0,0 +1,81 @@ +{ + "name": "libarchive", + "version": "3.7.7", + "description": "Library for reading and writing streaming archives", + "homepage": "https://www.libarchive.org", + "license": null, + "supports": "!uwp", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + "zlib" + ], + "default-features": [ + "bzip2", + "crypto", + "libxml2", + "lz4", + "lzma", + { + "name": "tools", + "platform": "!ios" + }, + "zstd" + ], + "features": { + "bzip2": { + "description": "BZip2 support", + "dependencies": [ + "bzip2" + ] + }, + "crypto": { + "description": "Support for cryptographic features", + "dependencies": [ + { + "name": "mbedtls", + "platform": "osx" + }, + { + "name": "openssl", + "platform": "!osx" + } + ] + }, + "libxml2": { + "description": "Libxml2 support", + "dependencies": [ + "libxml2" + ] + }, + "lz4": { + "description": "Lz4 support", + "dependencies": [ + "lz4" + ] + }, + "lzma": { + "description": "Lzma support", + "dependencies": [ + "liblzma" + ] + }, + "lzo": { + "description": "Lzo support", + "dependencies": [ + "lzo" + ] + }, + "tools": { + "description": "Tools support" + }, + "zstd": { + "description": "Zstd support", + "dependencies": [ + "zstd" + ] + } + } +} diff --git a/vcpkg/ports/qgis/vcpkg.json b/vcpkg/ports/qgis/vcpkg.json index d046e7285c..2e8e9e360d 100644 --- a/vcpkg/ports/qgis/vcpkg.json +++ b/vcpkg/ports/qgis/vcpkg.json @@ -15,10 +15,7 @@ { "name": "gdal", "features": [ - { - "name": "archive", - "platform": "!ios" - }, + "archive", "poppler" ] },