From d53447bcdeb79a6be7bc129da7bdac1205be77aa Mon Sep 17 00:00:00 2001 From: Theodore Tsirpanis Date: Tue, 25 Jul 2023 18:32:48 +0300 Subject: [PATCH] Remove some easy to remove custom vcpkg ports. They were introduced in #3950 (which says it just copied them from upstream vcpkg) and have not been modified since. --- ports/bzip2/CMakeLists.txt | 45 --- ports/bzip2/bzip2.pc.in | 11 - ports/bzip2/fix-import-export-macros.patch | 40 --- ports/bzip2/portfile.cmake | 56 --- ports/bzip2/usage | 4 - ports/bzip2/vcpkg.json | 24 -- ports/crc32c/fix_clang-cl.patch | 13 - ports/crc32c/portfile.cmake | 33 -- ports/crc32c/vcpkg.json | 17 - ports/fmt/fix-format-conflict.patch | 15 - ports/fmt/fix-write-batch.patch | 13 - ports/fmt/portfile.cmake | 66 ---- ports/fmt/usage | 8 - ports/fmt/vcpkg.json | 18 - ports/liblzma/add_support_ios.patch | 20 -- ports/liblzma/build-tools.patch | 20 -- ports/liblzma/fix_config_include.patch | 12 - ports/liblzma/portfile.cmake | 84 ----- ports/liblzma/usage | 9 - ports/liblzma/vcpkg-cmake-wrapper.cmake | 64 ---- ports/liblzma/vcpkg.json | 24 -- ports/liblzma/win_output_name.patch | 17 - ...mory-corruption-with-negative-memmov.patch | 26 -- ports/lz4/CMakeLists.txt | 57 ---- ports/lz4/portfile.cmake | 42 --- ports/lz4/vcpkg.json | 18 - ports/nlohmann-json/portfile.cmake | 48 --- ports/nlohmann-json/usage | 12 - ports/nlohmann-json/vcpkg.json | 22 -- ports/vcpkg-cmake-config/copyright | 23 -- ports/vcpkg-cmake-config/portfile.cmake | 12 - .../vcpkg-port-config.cmake | 1 - ports/vcpkg-cmake-config/vcpkg.json | 7 - .../vcpkg_cmake_config_fixup.cmake | 258 -------------- ports/vcpkg-cmake/portfile.cmake | 14 - ports/vcpkg-cmake/vcpkg-port-config.cmake | 3 - ports/vcpkg-cmake/vcpkg.json | 6 - ports/vcpkg-cmake/vcpkg_cmake_build.cmake | 91 ----- ports/vcpkg-cmake/vcpkg_cmake_configure.cmake | 320 ------------------ ports/vcpkg-cmake/vcpkg_cmake_install.cmake | 21 -- ...id-inclusions-when-HAVE_-is-set-to-0.patch | 53 --- ports/zlib/0002-skip-building-examples.patch | 17 - ...0003-build-static-or-shared-not-both.patch | 53 --- ports/zlib/0004-android-and-mingw-fixes.patch | 31 -- ports/zlib/portfile.cmake | 53 --- ports/zlib/usage | 4 - ports/zlib/vcpkg-cmake-wrapper.cmake | 12 - ports/zlib/vcpkg.json | 13 - ports/zstd/install_pkgpc.patch | 13 - ports/zstd/no-static-suffix.patch | 13 - ports/zstd/portfile.cmake | 55 --- ports/zstd/usage | 4 - ports/zstd/vcpkg.json | 18 - 53 files changed, 1933 deletions(-) delete mode 100644 ports/bzip2/CMakeLists.txt delete mode 100644 ports/bzip2/bzip2.pc.in delete mode 100644 ports/bzip2/fix-import-export-macros.patch delete mode 100644 ports/bzip2/portfile.cmake delete mode 100644 ports/bzip2/usage delete mode 100644 ports/bzip2/vcpkg.json delete mode 100644 ports/crc32c/fix_clang-cl.patch delete mode 100644 ports/crc32c/portfile.cmake delete mode 100644 ports/crc32c/vcpkg.json delete mode 100644 ports/fmt/fix-format-conflict.patch delete mode 100644 ports/fmt/fix-write-batch.patch delete mode 100644 ports/fmt/portfile.cmake delete mode 100644 ports/fmt/usage delete mode 100644 ports/fmt/vcpkg.json delete mode 100644 ports/liblzma/add_support_ios.patch delete mode 100644 ports/liblzma/build-tools.patch delete mode 100644 ports/liblzma/fix_config_include.patch delete mode 100644 ports/liblzma/portfile.cmake delete mode 100644 ports/liblzma/usage delete mode 100644 ports/liblzma/vcpkg-cmake-wrapper.cmake delete mode 100644 ports/liblzma/vcpkg.json delete mode 100644 ports/liblzma/win_output_name.patch delete mode 100755 ports/lz4/0001-Fix-potential-memory-corruption-with-negative-memmov.patch delete mode 100644 ports/lz4/CMakeLists.txt delete mode 100644 ports/lz4/portfile.cmake delete mode 100644 ports/lz4/vcpkg.json delete mode 100644 ports/nlohmann-json/portfile.cmake delete mode 100644 ports/nlohmann-json/usage delete mode 100644 ports/nlohmann-json/vcpkg.json delete mode 100644 ports/vcpkg-cmake-config/copyright delete mode 100644 ports/vcpkg-cmake-config/portfile.cmake delete mode 100644 ports/vcpkg-cmake-config/vcpkg-port-config.cmake delete mode 100644 ports/vcpkg-cmake-config/vcpkg.json delete mode 100644 ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake delete mode 100644 ports/vcpkg-cmake/portfile.cmake delete mode 100644 ports/vcpkg-cmake/vcpkg-port-config.cmake delete mode 100644 ports/vcpkg-cmake/vcpkg.json delete mode 100644 ports/vcpkg-cmake/vcpkg_cmake_build.cmake delete mode 100644 ports/vcpkg-cmake/vcpkg_cmake_configure.cmake delete mode 100644 ports/vcpkg-cmake/vcpkg_cmake_install.cmake delete mode 100644 ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch delete mode 100644 ports/zlib/0002-skip-building-examples.patch delete mode 100644 ports/zlib/0003-build-static-or-shared-not-both.patch delete mode 100644 ports/zlib/0004-android-and-mingw-fixes.patch delete mode 100644 ports/zlib/portfile.cmake delete mode 100644 ports/zlib/usage delete mode 100644 ports/zlib/vcpkg-cmake-wrapper.cmake delete mode 100644 ports/zlib/vcpkg.json delete mode 100644 ports/zstd/install_pkgpc.patch delete mode 100644 ports/zstd/no-static-suffix.patch delete mode 100644 ports/zstd/portfile.cmake delete mode 100644 ports/zstd/usage delete mode 100644 ports/zstd/vcpkg.json diff --git a/ports/bzip2/CMakeLists.txt b/ports/bzip2/CMakeLists.txt deleted file mode 100644 index e2da221d7de..00000000000 --- a/ports/bzip2/CMakeLists.txt +++ /dev/null @@ -1,45 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(bzip2 C) - -if(CMAKE_BUILD_TYPE STREQUAL Debug) - add_definitions(-DBZ_DEBUG) # enable extra assertions -endif() - -set(BZ2_SOURCES - blocksort.c - huffman.c - crctable.c - randtable.c - compress.c - decompress.c - bzlib.c) - -add_library(bz2 ${BZ2_SOURCES}) -set_target_properties(bz2 PROPERTIES - DEBUG_POSTFIX d - VERSION 1.0.6 - SOVERSION 1.0) -if(BUILD_SHARED_LIBS) - target_compile_definitions(bz2 PRIVATE -DBZ_BUILD_DLL) -endif() - -if(MSVC) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) -endif() - -install(TARGETS bz2 - RUNTIME DESTINATION bin - ARCHIVE DESTINATION lib - LIBRARY DESTINATION lib) - -if(NOT BZIP2_SKIP_TOOLS) - add_executable(bzip2 bzip2.c ${BZ2_SOURCES}) - add_executable(bzip2recover bzip2recover.c ${BZ2_SOURCES}) - install(TARGETS bzip2 bzip2recover DESTINATION tools/bzip2) -endif() - -if(NOT BZIP2_SKIP_HEADERS) - install(FILES bzlib.h DESTINATION include) -endif() diff --git a/ports/bzip2/bzip2.pc.in b/ports/bzip2/bzip2.pc.in deleted file mode 100644 index 91153c13b53..00000000000 --- a/ports/bzip2/bzip2.pc.in +++ /dev/null @@ -1,11 +0,0 @@ -prefix=@BZIP2_PREFIX@ -exec_prefix=${prefix} -libdir=${prefix}/lib -includedir=${prefix}/include - -Name: bzip2 -Description: bzip2 -Version: 1.0.6 -Requires: -Libs: -L${libdir} -l@bzname@ -Cflags: -I${includedir} \ No newline at end of file diff --git a/ports/bzip2/fix-import-export-macros.patch b/ports/bzip2/fix-import-export-macros.patch deleted file mode 100644 index fc67887da4e..00000000000 --- a/ports/bzip2/fix-import-export-macros.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/bzlib.h b/bzlib.h -index 8277123..84fbd0a 100644 ---- a/bzlib.h -+++ b/bzlib.h -@@ -65,29 +65,23 @@ typedef - } - bz_stream; - -- --#ifndef BZ_IMPORT --#define BZ_EXPORT --#endif -- - #ifndef BZ_NO_STDIO - /* Need a definitition for FILE */ - #include - #endif - - #ifdef _WIN32 --# include - # ifdef small - /* windows.h define small to char */ - # undef small - # endif --# ifdef BZ_EXPORT --# define BZ_API(func) WINAPI func --# define BZ_EXTERN extern -+# define BZ_API(func) func -+# if defined(BZ_BUILD_DLL) -+# define BZ_EXTERN __declspec(dllexport) -+# elif defined(BZ_IMPORT) -+# define BZ_EXTERN __declspec(dllimport) - # else -- /* import windows dll dynamically */ --# define BZ_API(func) (WINAPI * func) --# define BZ_EXTERN -+# define BZ_EXTERN - # endif - #else - # define BZ_API(func) func diff --git a/ports/bzip2/portfile.cmake b/ports/bzip2/portfile.cmake deleted file mode 100644 index c03f48c48fb..00000000000 --- a/ports/bzip2/portfile.cmake +++ /dev/null @@ -1,56 +0,0 @@ -set(BZIP2_VERSION 1.0.8) -vcpkg_download_distfile(ARCHIVE - URLS "https://sourceware.org/pub/bzip2/bzip2-${BZIP2_VERSION}.tar.gz" - FILENAME "bzip2-${BZIP2_VERSION}.tar.gz" - SHA512 083f5e675d73f3233c7930ebe20425a533feedeaaa9d8cc86831312a6581cefbe6ed0d08d2fa89be81082f2a5abdabca8b3c080bf97218a1bd59dc118a30b9f3 -) - -vcpkg_extract_source_archive_ex( - OUT_SOURCE_PATH SOURCE_PATH - ARCHIVE ${ARCHIVE} - PATCHES fix-import-export-macros.patch -) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - INVERTED_FEATURES - tool BZIP2_SKIP_TOOLS -) - -file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") - -vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - ${FEATURE_OPTIONS} - OPTIONS_DEBUG - -DBZIP2_SKIP_HEADERS=ON - -DBZIP2_SKIP_TOOLS=ON -) - -vcpkg_cmake_install() -vcpkg_copy_pdbs() - -file(READ "${CURRENT_PACKAGES_DIR}/include/bzlib.h" BZLIB_H) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - string(REPLACE "defined(BZ_IMPORT)" "0" BZLIB_H "${BZLIB_H}") -else() - string(REPLACE "defined(BZ_IMPORT)" "1" BZLIB_H "${BZLIB_H}") -endif() -file(WRITE "${CURRENT_PACKAGES_DIR}/include/bzlib.h" "${BZLIB_H}") - -if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}") - set(bzname bz2) - configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/bzip2.pc" @ONLY) -endif() - -if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - set(BZIP2_PREFIX "${CURRENT_INSTALLED_DIR}/debug") - set(bzname bz2d) - configure_file("${CMAKE_CURRENT_LIST_DIR}/bzip2.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/bzip2.pc" @ONLY) -endif() - -vcpkg_fixup_pkgconfig() - -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/bzip2/usage b/ports/bzip2/usage deleted file mode 100644 index 084bf390ad5..00000000000 --- a/ports/bzip2/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package bzip2 is compatible with built-in CMake targets: - - find_package(BZip2 REQUIRED) - target_link_libraries(main PRIVATE BZip2::BZip2) diff --git a/ports/bzip2/vcpkg.json b/ports/bzip2/vcpkg.json deleted file mode 100644 index b899ec15457..00000000000 --- a/ports/bzip2/vcpkg.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "bzip2", - "version-semver": "1.0.8", - "port-version": 0, - "description": "bzip2 is a freely available, patent free, high-quality data compressor. It typically compresses files to within 10% to 15% of the best available techniques (the PPM family of statistical compressors), whilst being around twice as fast at compression and six times faster at decompression.", - "homepage": "https://sourceware.org/bzip2/", - "documentation": "https://sourceware.org/bzip2/docs.html", - "license": "bzip2-1.0.6", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ], - "features": { - "tool": { - "description": "Builds bzip2 executable" - } - } -} diff --git a/ports/crc32c/fix_clang-cl.patch b/ports/crc32c/fix_clang-cl.patch deleted file mode 100644 index d120243209c..00000000000 --- a/ports/crc32c/fix_clang-cl.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 84907285c..8c446b0c8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -22,7 +22,7 @@ if(NOT CMAKE_CXX_STANDARD) - endif(NOT CMAKE_CXX_STANDARD) - - # https://github.com/izenecloud/cmake/blob/master/SetCompilerWarningAll.cmake --if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") -+if(MSVC) - # Use the highest warning level for Visual Studio. - set(CMAKE_CXX_WARNING_LEVEL 4) - if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") diff --git a/ports/crc32c/portfile.cmake b/ports/crc32c/portfile.cmake deleted file mode 100644 index 0280002fd2a..00000000000 --- a/ports/crc32c/portfile.cmake +++ /dev/null @@ -1,33 +0,0 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO google/crc32c - REF 1.1.2 - SHA512 6325c52b5a6850b9f90086e0c0c86798c008af36e7cfd3a0216184a2d37b3bf7323481ddc6bfe4cbd5b31288b3ee6c69772d03085a13094cf95d00a9756a7196 - HEAD_REF master - PATCHES - fix_clang-cl.patch -) - -vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - -DCRC32C_BUILD_TESTS=OFF - -DCRC32C_BUILD_BENCHMARKS=OFF - -DCRC32C_USE_GLOG=OFF -) - -vcpkg_cmake_install() -vcpkg_copy_pdbs() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Crc32c) - -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) -endif() - -# Handle copyright -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/crc32c/vcpkg.json b/ports/crc32c/vcpkg.json deleted file mode 100644 index 3acb74812e5..00000000000 --- a/ports/crc32c/vcpkg.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "crc32c", - "version": "1.1.2", - "port-version": 1, - "description": "CRC32C implementation with support for CPU-specific acceleration instructions.", - "homepage": "https://github.com/google/crc32c", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} diff --git a/ports/fmt/fix-format-conflict.patch b/ports/fmt/fix-format-conflict.patch deleted file mode 100644 index 0a2ac6a57a2..00000000000 --- a/ports/fmt/fix-format-conflict.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h -index f44df01c..59cc4559 100644 ---- a/include/fmt/format-inl.h -+++ b/include/fmt/format-inl.h -@@ -62,8 +62,8 @@ FMT_FUNC void format_error_code(detail::buffer& out, int error_code, - error_code_size += detail::to_unsigned(detail::count_digits(abs_value)); - auto it = buffer_appender(out); - if (message.size() <= inline_buffer_size - error_code_size) -- format_to(it, FMT_STRING("{}{}"), message, SEP); -- format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code); -+ fmt::format_to(it, FMT_STRING("{}{}"), message, SEP); -+ fmt::format_to(it, FMT_STRING("{}{}"), ERROR_STR, error_code); - FMT_ASSERT(out.size() <= inline_buffer_size, ""); - } - diff --git a/ports/fmt/fix-write-batch.patch b/ports/fmt/fix-write-batch.patch deleted file mode 100644 index 7c17d603772..00000000000 --- a/ports/fmt/fix-write-batch.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f21cf45..691a632 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -157,7 +157,7 @@ if (MASTER_PROJECT AND CMAKE_GENERATOR MATCHES "Visual Studio") - join(netfxpath - "C:\\Program Files\\Reference Assemblies\\Microsoft\\Framework\\" - ".NETFramework\\v4.0") -- file(WRITE run-msbuild.bat " -+ file(WRITE ${CMAKE_BINARY_DIR}/run-msbuild.bat " - ${MSBUILD_SETUP} - ${CMAKE_MAKE_PROGRAM} -p:FrameworkPathOverride=\"${netfxpath}\" %*") - endif () diff --git a/ports/fmt/portfile.cmake b/ports/fmt/portfile.cmake deleted file mode 100644 index f5f819a01a9..00000000000 --- a/ports/fmt/portfile.cmake +++ /dev/null @@ -1,66 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO fmtlib/fmt - REF 9.1.0 - SHA512 a18442042722dd48e20714ec034a12fcc0576c9af7be5188586970e2edf47529825bdc99af366b1d5891630c8dbf6f63bfa9f012e77ab3d3ed80d1a118e3b2be - HEAD_REF master - PATCHES - fix-write-batch.patch - fix-format-conflict.patch -) - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DFMT_CMAKE_DIR=share/fmt - -DFMT_TEST=OFF - -DFMT_DOC=OFF -) - -vcpkg_cmake_install() -file(INSTALL "${SOURCE_PATH}/LICENSE.rst" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - if(VCPKG_TARGET_IS_WINDOWS) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll") - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/bin") - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/fmtd.dll" "${CURRENT_PACKAGES_DIR}/debug/bin/fmtd.dll") - endif() - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/fmt.dll") - file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/bin") - file(RENAME "${CURRENT_PACKAGES_DIR}/lib/fmt.dll" "${CURRENT_PACKAGES_DIR}/bin/fmt.dll") - endif() - endif() - endif() - - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/fmt/core.h - "defined(FMT_SHARED)" - "1" - ) -endif() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -vcpkg_cmake_config_fixup() -vcpkg_fixup_pkgconfig() - -if(VCPKG_TARGET_IS_WINDOWS) - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-debug.cmake - "lib/fmtd.dll" - "bin/fmtd.dll" - ) - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/share/fmt/fmt-targets-release.cmake - "lib/fmt.dll" - "bin/fmt.dll" - ) - endif() -endif() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") - -# Handle post-build CMake instructions -vcpkg_copy_pdbs() -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/fmt/usage b/ports/fmt/usage deleted file mode 100644 index e5a9d704806..00000000000 --- a/ports/fmt/usage +++ /dev/null @@ -1,8 +0,0 @@ -The package fmt provides CMake targets: - - find_package(fmt CONFIG REQUIRED) - target_link_libraries(main PRIVATE fmt::fmt) - - # Or use the header-only version - find_package(fmt CONFIG REQUIRED) - target_link_libraries(main PRIVATE fmt::fmt-header-only) diff --git a/ports/fmt/vcpkg.json b/ports/fmt/vcpkg.json deleted file mode 100644 index a768a4e960d..00000000000 --- a/ports/fmt/vcpkg.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "fmt", - "version": "9.1.0", - "port-version": 1, - "description": "Formatting library for C++. It can be used as a safe alternative to printf or as a fast alternative to IOStreams.", - "homepage": "https://github.com/fmtlib/fmt", - "license": "MIT", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} diff --git a/ports/liblzma/add_support_ios.patch b/ports/liblzma/add_support_ios.patch deleted file mode 100644 index 79741639b60..00000000000 --- a/ports/liblzma/add_support_ios.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 52439b3..0b5e371 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -574,6 +574,7 @@ if(HAVE_GETOPT_LONG) - - install(TARGETS xzdec - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT xzdec) - - if(UNIX) -@@ -701,6 +702,7 @@ if(NOT MSVC AND HAVE_GETOPT_LONG) - - install(TARGETS xz - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" -+ BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}" - COMPONENT xz) - - if(UNIX) diff --git a/ports/liblzma/build-tools.patch b/ports/liblzma/build-tools.patch deleted file mode 100644 index 759345ef23a..00000000000 --- a/ports/liblzma/build-tools.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 03b8301..820d08e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -584,6 +584,7 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config.cmake" - COMPONENT liblzma_Development) - - -+if(BUILD_TOOLS) - ############################################################################# - # getopt_long - ############################################################################# -@@ -793,6 +794,7 @@ if(NOT MSVC AND HAVE_GETOPT_LONG) - endforeach() - endif() - endif() -+endif() - - - ############################################################################# diff --git a/ports/liblzma/fix_config_include.patch b/ports/liblzma/fix_config_include.patch deleted file mode 100644 index 91dc4c13ba5..00000000000 --- a/ports/liblzma/fix_config_include.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 34c6aca00..7b3708ab2 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -413,6 +413,7 @@ if(WIN32) - if(BUILD_SHARED_LIBS) - # Add the Windows resource file for liblzma.dll. - target_sources(liblzma PRIVATE src/liblzma/liblzma_w32res.rc) -+ target_include_directories(liblzma PRIVATE windows/vs2019) - - set_target_properties(liblzma PROPERTIES - LINK_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/common_w32res.rc" diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake deleted file mode 100644 index 8631df28b0f..00000000000 --- a/ports/liblzma/portfile.cmake +++ /dev/null @@ -1,84 +0,0 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} -vcpkg_from_sourceforge( - OUT_SOURCE_PATH SOURCE_PATH - REPO lzmautils - FILENAME "xz-${VERSION}.tar.xz" - SHA512 f890ee5207799fbc7bb9ae031f444d39d82275b0e1b8cc7f01fdb9270050e38849bd1269db2a2f12fe87b5e23e03f9e809a5c3456d066c0a56e6f98d728553ea - PATCHES - fix_config_include.patch - win_output_name.patch # Fix output name on Windows. Autotool build does not generate lib prefixed libraries on windows. - add_support_ios.patch # add install bundle info for support ios - build-tools.patch -) - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - FEATURES - tools BUILD_TOOLS -) - -if(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32") - set(WASM_OPTIONS -DCMAKE_C_BYTE_ORDER=LITTLE_ENDIAN -DCMAKE_CXX_BYTE_ORDER=LITTLE_ENDIAN) -endif() - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - ${FEATURE_OPTIONS} - ${WASM_OPTIONS} - -DBUILD_TESTING=OFF - -DCREATE_XZ_SYMLINKS=OFF - -DCREATE_LZMA_SYMLINKS=OFF - MAYBE_UNUSED_VARIABLES - CREATE_XZ_SYMLINKS - CREATE_LZMA_SYMLINKS -) -vcpkg_cmake_install() -vcpkg_copy_pdbs() - -set(exec_prefix "\${prefix}") -set(libdir "\${prefix}/lib") -set(includedir "\${prefix}/include") -set(PACKAGE_URL https://tukaani.org/xz/) -set(PACKAGE_VERSION 5.2.5) -if(NOT VCPKG_TARGET_IS_WINDOWS) - set(PTHREAD_CFLAGS -pthread) -endif() -set(prefix "${CURRENT_INSTALLED_DIR}") -configure_file("${SOURCE_PATH}/src/liblzma/liblzma.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/liblzma.pc" @ONLY) -if (NOT VCPKG_BUILD_TYPE) - set(prefix "${CURRENT_INSTALLED_DIR}/debug") - configure_file("${SOURCE_PATH}/src/liblzma/liblzma.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/liblzma.pc" @ONLY) -endif() -vcpkg_fixup_pkgconfig() - -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/liblzma) - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/lzma.h" "defined(LZMA_API_STATIC)" "1") -else() - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/lzma.h" "defined(LZMA_API_STATIC)" "0") -endif() - -file(REMOVE_RECURSE - "${CURRENT_PACKAGES_DIR}/debug/include" - "${CURRENT_PACKAGES_DIR}/debug/share" - "${CURRENT_PACKAGES_DIR}/share/man" -) - -set(TOOLS xz xzdec) -foreach(_tool IN LISTS TOOLS) - if(NOT EXISTS "${CURRENT_PACKAGES_DIR}/bin/${_tool}${VCPKG_TARGET_EXECUTABLE_SUFFIX}") - list(REMOVE_ITEM TOOLS ${_tool}) - endif() -endforeach() -if(TOOLS) - vcpkg_copy_tools(TOOL_NAMES ${TOOLS} AUTO_CLEAN) -endif() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() - -file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/liblzma/usage b/ports/liblzma/usage deleted file mode 100644 index b1461c93fc0..00000000000 --- a/ports/liblzma/usage +++ /dev/null @@ -1,9 +0,0 @@ -liblzma is compatible with built-in CMake targets: - - find_package(LibLZMA REQUIRED) - target_link_libraries(main PRIVATE LibLZMA::LibLZMA) - -liblzma provides CMake targets: - - find_package(liblzma CONFIG REQUIRED) - target_link_libraries(main PRIVATE liblzma::liblzma) diff --git a/ports/liblzma/vcpkg-cmake-wrapper.cmake b/ports/liblzma/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 826cdba0650..00000000000 --- a/ports/liblzma/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,64 +0,0 @@ -cmake_policy(PUSH) -cmake_policy(SET CMP0012 NEW) -cmake_policy(SET CMP0057 NEW) -set(z_vcpkg_liblzma_fixup_needed 0) -if(NOT "CONFIG" IN_LIST ARGS AND NOT "NO_MODULE" IN_LIST ARGS AND NOT CMAKE_DISABLE_FIND_PACKAGE_LibLZMA) - get_filename_component(z_vcpkg_liblzma_prefix "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY) - get_filename_component(z_vcpkg_liblzma_prefix "${z_vcpkg_liblzma_prefix}" DIRECTORY) - find_path(LIBLZMA_INCLUDE_DIR NAMES lzma.h PATHS "${z_vcpkg_liblzma_prefix}/include" NO_DEFAULT_PATH) - # liblzma doesn't use a debug postfix, but FindLibLZMA.cmake expects it - find_library(LIBLZMA_LIBRARY_RELEASE NAMES lzma PATHS "${z_vcpkg_liblzma_prefix}/lib" NO_DEFAULT_PATH) - find_library(LIBLZMA_LIBRARY_DEBUG NAMES lzma PATHS "${z_vcpkg_liblzma_prefix}/debug/lib" NO_DEFAULT_PATH) - unset(z_vcpkg_liblzma_prefix) - if(CMAKE_VERSION VERSION_LESS 3.16) - # Older versions of FindLibLZMA.cmake need a single lib in LIBLZMA_LIBRARY. - set(z_vcpkg_liblzma_fixup_needed 1) - set(LIBLZMA_LIBRARY "${LIBLZMA_LIBRARY_RELEASE}" CACHE INTERNAL "") - elseif(NOT TARGET LibLZMA::LibLZMA) - set(z_vcpkg_liblzma_fixup_needed 1) - endif() - # Known values, and required. Skip expensive tests. - set(LIBLZMA_HAS_AUTO_DECODER 1 CACHE INTERNAL "") - set(LIBLZMA_HAS_EASY_ENCODER 1 CACHE INTERNAL "") - set(LIBLZMA_HAS_LZMA_PRESET 1 CACHE INTERNAL "") -endif() - -_find_package(${ARGS}) - -if(z_vcpkg_liblzma_fixup_needed) - include(SelectLibraryConfigurations) - select_library_configurations(LIBLZMA) - if(NOT TARGET LibLZMA::LibLZMA) - # Backfill LibLZMA::LibLZMA to versions of cmake before 3.14 - add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED) - if(DEFINED LIBLZMA_INCLUDE_DIRS) - set_target_properties(LibLZMA::LibLZMA PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${LIBLZMA_INCLUDE_DIRS}") - endif() - set_property(TARGET LibLZMA::LibLZMA APPEND PROPERTY - IMPORTED_CONFIGURATIONS RELEASE) - set_target_properties(LibLZMA::LibLZMA PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" - IMPORTED_LOCATION_RELEASE "${LIBLZMA_LIBRARY_RELEASE}") - if(EXISTS "${LIBLZMA_LIBRARY}") - set_target_properties(LibLZMA::LibLZMA PROPERTIES - IMPORTED_LINK_INTERFACE_LANGUAGES "C" - IMPORTED_LOCATION "${LIBLZMA_LIBRARY}") - endif() - endif() - if(LIBLZMA_LIBRARY_DEBUG) - # Backfill debug variant to versions of cmake before 3.16 - set_property(TARGET LibLZMA::LibLZMA APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) - set_target_properties(LibLZMA::LibLZMA PROPERTIES IMPORTED_LOCATION_DEBUG "${LIBLZMA_LIBRARY_DEBUG}") - endif() -endif() -if(LIBLZMA_LIBRARIES AND NOT "Threads::Threads" IN_LIST LIBLZMA_LIBRARIES) - set(THREADS_PREFER_PTHREAD_FLAG TRUE) - find_package(Threads) - list(APPEND LIBLZMA_LIBRARIES ${CMAKE_THREAD_LIBS_INIT}) - if(TARGET LibLZMA::LibLZMA) - set_property(TARGET LibLZMA::LibLZMA APPEND PROPERTY INTERFACE_LINK_LIBRARIES Threads::Threads) - endif() -endif() -unset(z_vcpkg_liblzma_fixup_needed) -cmake_policy(POP) diff --git a/ports/liblzma/vcpkg.json b/ports/liblzma/vcpkg.json deleted file mode 100644 index d0ac62bed49..00000000000 --- a/ports/liblzma/vcpkg.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "liblzma", - "version-semver": "5.4.1", - "port-version": 1, - "description": "Compression library with an API similar to that of zlib.", - "homepage": "https://tukaani.org/xz/", - "license": null, - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ], - "features": { - "tools": { - "description": "Build tools", - "supports": "!windows, mingw" - } - } -} diff --git a/ports/liblzma/win_output_name.patch b/ports/liblzma/win_output_name.patch deleted file mode 100644 index 7011475de58..00000000000 --- a/ports/liblzma/win_output_name.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e80b524..cddbccb 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -462,8 +462,11 @@ set_target_properties(liblzma PROPERTIES - - # It's liblzma.so or liblzma.dll, not libliblzma.so or lzma.dll. - # Avoid the name lzma.dll because it would conflict with LZMA SDK. -- PREFIX "" -+ OUTPUT_NAME lzma - ) -+if(WIN32 AND NOT MINGW) -+ set_target_properties(liblzma PROPERTIES RUNTIME_OUTPUT_NAME liblzma) -+endif() - - # Create liblzma-config-version.cmake. We use this spelling instead of - # liblzmaConfig.cmake to make find_package work in case insensitive manner diff --git a/ports/lz4/0001-Fix-potential-memory-corruption-with-negative-memmov.patch b/ports/lz4/0001-Fix-potential-memory-corruption-with-negative-memmov.patch deleted file mode 100755 index d6f444810c0..00000000000 --- a/ports/lz4/0001-Fix-potential-memory-corruption-with-negative-memmov.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 8301a21773ef61656225e264f4f06ae14462bca7 Mon Sep 17 00:00:00 2001 -From: Jasper Lievisse Adriaanse -Date: Fri, 26 Feb 2021 15:21:20 +0100 -Subject: [PATCH 001/120] Fix potential memory corruption with negative - memmove() size - ---- - lib/lz4.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lib/lz4.c b/lib/lz4.c -index 5f524d0..c2f504e 100644 ---- a/lib/lz4.c -+++ b/lib/lz4.c -@@ -1749,7 +1749,7 @@ LZ4_decompress_generic( - const size_t dictSize /* note : = 0 if noDict */ - ) - { -- if (src == NULL) { return -1; } -+ if ((src == NULL) || (outputSize < 0)) { return -1; } - - { const BYTE* ip = (const BYTE*) src; - const BYTE* const iend = ip + srcSize; --- -2.36.1 - diff --git a/ports/lz4/CMakeLists.txt b/ports/lz4/CMakeLists.txt deleted file mode 100644 index 142a229006f..00000000000 --- a/ports/lz4/CMakeLists.txt +++ /dev/null @@ -1,57 +0,0 @@ -cmake_minimum_required(VERSION 3.0) -project(lz4 C) - -if(MSVC AND BUILD_SHARED_LIBS) - add_definitions(-DLZ4_DLL_EXPORT) -endif() -add_definitions(-DXXH_NAMESPACE=LZ4_) - -set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Install prefix") -set(INSTALL_BIN_DIR "bin" CACHE PATH "Path where exe and dll will be installed") -set(INSTALL_LIB_DIR "lib" CACHE PATH "Path where lib will be installed") -set(INSTALL_INCLUDE_DIR "include" CACHE PATH "Path where headers will be installed") -set(INSTALL_CMAKE_DIR "share/lz4" CACHE PATH "Path where cmake configs will be installed") - -file(GLOB LZ4_HEADERS lib/*.h) - -add_library(lz4 - ${LZ4_HEADERS} - lib/lz4.c - lib/lz4frame.c - lib/lz4hc.c - lib/xxhash.c -) - -target_include_directories(lz4 PUBLIC $ $) -set_target_properties(lz4 PROPERTIES PUBLIC_HEADER ${LZ4_HEADERS}) - -install(TARGETS lz4 - EXPORT lz4Config - RUNTIME DESTINATION "${INSTALL_BIN_DIR}" - ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" - PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}" - PRIVATE_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}" - COMPONENT dev -) - -FILE(GLOB lz4h "${CMAKE_CURRENT_LIST_DIR}/lib/*.h") -list(REMOVE_ITEM lz4h "${CMAKE_CURRENT_LIST_DIR}/lib/xxhash.h") -INSTALL(FILES ${lz4h} DESTINATION "${INSTALL_INCLUDE_DIR}") - -install(EXPORT lz4Config - FILE lz4-config.cmake - NAMESPACE lz4:: - DESTINATION "${INSTALL_CMAKE_DIR}" -) - -# Export the package for use from the build-tree (this registers the build-tree with a global CMake-registry) -export(PACKAGE lz4) - -# Create pkgconfig module file -file(STRINGS "lib/lz4.h" LZ4_H REGEX "^#define LZ4_VERSION_(MAJOR|MINOR|RELEASE) ") -string(REGEX REPLACE "^.*MAJOR +([0-9]+).*MINOR +([0-9]+).*RELEASE +([0-9]+).*$" "\\1.\\2.\\3" VERSION "${LZ4_H}") -set(INCLUDEDIR [[${prefix}/include]]) -set(LIBDIR [[${prefix}/lib]]) -configure_file(lib/liblz4.pc.in lib/liblz4.pc) -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/lib/liblz4.pc" DESTINATION "lib/pkgconfig") diff --git a/ports/lz4/portfile.cmake b/ports/lz4/portfile.cmake deleted file mode 100644 index a2e3b74f911..00000000000 --- a/ports/lz4/portfile.cmake +++ /dev/null @@ -1,42 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO lz4/lz4 - REF v1.9.3 - SHA512 c246b0bda881ee9399fa1be490fa39f43b291bb1d9db72dba8a85db1a50aad416a97e9b300eee3d2a4203c2bd88bda2762e81bc229c3aa409ad217eb306a454c - HEAD_REF dev - PATCHES - 0001-Fix-potential-memory-corruption-with-negative-memmov.patch -) - -file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS_DEBUG - -DCMAKE_DEBUG_POSTFIX=d -) - -vcpkg_cmake_install() -vcpkg_copy_pdbs() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - set(DLL_IMPORT "1 && defined(_MSC_VER)") -else() - set(DLL_IMPORT "0") -endif() -foreach(FILE lz4.h lz4frame.h) - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/${FILE}" - "defined(LZ4_DLL_IMPORT) && (LZ4_DLL_IMPORT==1)" - "${DLL_IMPORT}" - ) -endforeach() - -vcpkg_cmake_config_fixup() -vcpkg_fixup_pkgconfig() -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/liblz4.pc" " -llz4" " -llz4d") -endif() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -file(INSTALL "${SOURCE_PATH}/lib/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/lz4/vcpkg.json b/ports/lz4/vcpkg.json deleted file mode 100644 index 597e902dd15..00000000000 --- a/ports/lz4/vcpkg.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "lz4", - "version": "1.9.3", - "port-version": 4, - "description": "Lossless compression algorithm, providing compression speed at 400 MB/s per core.", - "homepage": "https://github.com/lz4/lz4", - "license": "BSD-2-Clause AND GPL-2.0-only", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -} diff --git a/ports/nlohmann-json/portfile.cmake b/ports/nlohmann-json/portfile.cmake deleted file mode 100644 index 947cba35728..00000000000 --- a/ports/nlohmann-json/portfile.cmake +++ /dev/null @@ -1,48 +0,0 @@ -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO nlohmann/json - REF v3.11.2 - SHA512 70097c9bcd7a91254acbd41b8b68a6aaa371fc2dd7011f472917f69f1e2d2986155a0339dad791699d542e4a3be44dc49ae72ff73d0ee0ea4b34183296ce19a0 - HEAD_REF master -) - -if(NOT DEFINED nlohmann-json_IMPLICIT_CONVERSIONS) - set(nlohmann-json_IMPLICIT_CONVERSIONS ON) -endif() - -vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS -FEATURES - "diagnostics" JSON_Diagnostics -) - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS ${FEATURE_OPTIONS} - -DJSON_Install=ON - -DJSON_MultipleHeaders=ON - -DJSON_BuildTests=OFF - -DJSON_ImplicitConversions=${nlohmann-json_IMPLICIT_CONVERSIONS} -) -vcpkg_cmake_install() -vcpkg_cmake_config_fixup(PACKAGE_NAME "nlohmann_json" CONFIG_PATH "share/cmake/nlohmann_json") -vcpkg_fixup_pkgconfig() - -vcpkg_replace_string( - "${CURRENT_PACKAGES_DIR}/share/nlohmann_json/nlohmann_jsonTargets.cmake" - "{_IMPORT_PREFIX}/nlohmann_json.natvis" - "{_IMPORT_PREFIX}/share/nlohmann_json/nlohmann_json.natvis" -) -if(EXISTS "${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis") - file(RENAME - "${CURRENT_PACKAGES_DIR}/nlohmann_json.natvis" - "${CURRENT_PACKAGES_DIR}/share/nlohmann_json/nlohmann_json.natvis" - ) -endif() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug") - -# Handle copyright -file(INSTALL "${SOURCE_PATH}/LICENSE.MIT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - -# Handle usage -file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/nlohmann-json/usage b/ports/nlohmann-json/usage deleted file mode 100644 index 19c76d508d0..00000000000 --- a/ports/nlohmann-json/usage +++ /dev/null @@ -1,12 +0,0 @@ -The package nlohmann-json provides CMake targets: - - find_package(nlohmann_json CONFIG REQUIRED) - target_link_libraries(main PRIVATE nlohmann_json::nlohmann_json) - -The package nlohmann-json can be configured to not provide implicit conversions via a custom triplet file: - - set(nlohmann-json_IMPLICIT_CONVERSIONS OFF) - -For more information, see the docs here: - - https://json.nlohmann.me/api/macros/json_use_implicit_conversions/ diff --git a/ports/nlohmann-json/vcpkg.json b/ports/nlohmann-json/vcpkg.json deleted file mode 100644 index cc65b9d204d..00000000000 --- a/ports/nlohmann-json/vcpkg.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "nlohmann-json", - "version-semver": "3.11.2", - "description": "JSON for Modern C++", - "homepage": "https://github.com/nlohmann/json", - "license": "MIT", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ], - "features": { - "diagnostics": { - "description": "Build json_diagnostics" - } - } -} diff --git a/ports/vcpkg-cmake-config/copyright b/ports/vcpkg-cmake-config/copyright deleted file mode 100644 index 2e4eac8264f..00000000000 --- a/ports/vcpkg-cmake-config/copyright +++ /dev/null @@ -1,23 +0,0 @@ -Copyright (c) Microsoft Corporation - -All rights reserved. - -MIT License - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/ports/vcpkg-cmake-config/portfile.cmake b/ports/vcpkg-cmake-config/portfile.cmake deleted file mode 100644 index fc3dbafd518..00000000000 --- a/ports/vcpkg-cmake-config/portfile.cmake +++ /dev/null @@ -1,12 +0,0 @@ -if(NOT TARGET_TRIPLET STREQUAL _HOST_TRIPLET) - # make FATAL_ERROR in CI when issue #16773 fixed - message(WARNING "vcpkg-cmake-config is a host-only port; please mark it as a host port in your dependencies.") -endif() - -file(INSTALL - "${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_config_fixup.cmake" - "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" - "${CMAKE_CURRENT_LIST_DIR}/copyright" - DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") - -set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/ports/vcpkg-cmake-config/vcpkg-port-config.cmake b/ports/vcpkg-cmake-config/vcpkg-port-config.cmake deleted file mode 100644 index 980d411315c..00000000000 --- a/ports/vcpkg-cmake-config/vcpkg-port-config.cmake +++ /dev/null @@ -1 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_config_fixup.cmake") diff --git a/ports/vcpkg-cmake-config/vcpkg.json b/ports/vcpkg-cmake-config/vcpkg.json deleted file mode 100644 index db965341a7e..00000000000 --- a/ports/vcpkg-cmake-config/vcpkg.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "vcpkg-cmake-config", - "version-date": "2022-02-06", - "port-version": 1, - "documentation": "https://vcpkg.io/en/docs/README.html", - "license": "MIT" -} diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake deleted file mode 100644 index 368e5809ac2..00000000000 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ /dev/null @@ -1,258 +0,0 @@ -include_guard(GLOBAL) - -function(vcpkg_cmake_config_fixup) - cmake_parse_arguments(PARSE_ARGV 0 "arg" "DO_NOT_DELETE_PARENT_CONFIG_PATH;NO_PREFIX_CORRECTION" "PACKAGE_NAME;CONFIG_PATH;TOOLS_PATH" "") - - if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "vcpkg_cmake_config_fixup was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") - endif() - if(NOT arg_PACKAGE_NAME) - set(arg_PACKAGE_NAME "${PORT}") - endif() - if(NOT arg_CONFIG_PATH) - set(arg_CONFIG_PATH "share/${arg_PACKAGE_NAME}") - endif() - if(NOT arg_TOOLS_PATH) - set(arg_TOOLS_PATH "tools/${PORT}") - endif() - set(target_path "share/${arg_PACKAGE_NAME}") - - string(REPLACE "." "\\." EXECUTABLE_SUFFIX "${VCPKG_TARGET_EXECUTABLE_SUFFIX}") - - set(debug_share "${CURRENT_PACKAGES_DIR}/debug/${target_path}") - set(release_share "${CURRENT_PACKAGES_DIR}/${target_path}") - - if(NOT arg_CONFIG_PATH STREQUAL "share/${arg_PACKAGE_NAME}") - if(arg_CONFIG_PATH STREQUAL "share") - set(arg_CONFIG_PATH z_vcpkg_share) - file(RENAME "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/${arg_CONFIG_PATH}") - file(RENAME "${CURRENT_PACKAGES_DIR}/share" "${CURRENT_PACKAGES_DIR}/${arg_CONFIG_PATH}") - endif() - - set(debug_config "${CURRENT_PACKAGES_DIR}/debug/${arg_CONFIG_PATH}") - set(release_config "${CURRENT_PACKAGES_DIR}/${arg_CONFIG_PATH}") - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(NOT EXISTS "${debug_config}") - message(FATAL_ERROR "'${debug_config}' does not exist.") - endif() - - # This roundabout handling enables CONFIG_PATH = share - file(MAKE_DIRECTORY "${debug_share}") - file(GLOB files "${debug_config}/*") - file(COPY ${files} DESTINATION "${debug_share}") - file(REMOVE_RECURSE "${debug_config}") - endif() - - file(GLOB files "${release_config}/*") - file(COPY ${files} DESTINATION "${release_share}") - file(REMOVE_RECURSE "${release_config}") - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - get_filename_component(debug_config_dir_name "${debug_config}" NAME) - string(TOLOWER "${debug_config_dir_name}" debug_config_dir_name) - if(debug_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(REMOVE_RECURSE "${debug_config}") - else() - get_filename_component(debug_config_parent_dir "${debug_config}" DIRECTORY) - get_filename_component(debug_config_dir_name "${debug_config_parent_dir}" NAME) - string(TOLOWER "${debug_config_dir_name}" debug_config_dir_name) - if(debug_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(REMOVE_RECURSE "${debug_config_parent_dir}") - endif() - endif() - endif() - - get_filename_component(release_config_dir_name "${release_config}" NAME) - string(TOLOWER "${release_config_dir_name}" release_config_dir_name) - if(release_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(REMOVE_RECURSE "${release_config}") - else() - get_filename_component(release_config_parent_dir "${release_config}" DIRECTORY) - get_filename_component(release_config_dir_name "${release_config_parent_dir}" NAME) - string(TOLOWER "${release_config_dir_name}" release_config_dir_name) - if(release_config_dir_name STREQUAL "cmake" AND NOT arg_DO_NOT_DELETE_PARENT_CONFIG_PATH) - file(REMOVE_RECURSE "${release_config_parent_dir}") - endif() - endif() - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(NOT EXISTS "${debug_share}") - message(FATAL_ERROR "'${debug_share}' does not exist.") - endif() - endif() - - file(GLOB_RECURSE release_targets - "${release_share}/*-release.cmake" - ) - foreach(release_target IN LISTS release_targets) - file(READ "${release_target}" contents) - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" contents "${contents}") - string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" contents "${contents}") - file(WRITE "${release_target}" "${contents}") - endforeach() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(GLOB_RECURSE debug_targets - "${debug_share}/*-debug.cmake" - ) - foreach(debug_target IN LISTS debug_targets) - file(RELATIVE_PATH debug_target_rel "${debug_share}" "${debug_target}") - - file(READ "${debug_target}" contents) - string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" contents "${contents}") - string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \";]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" contents "${contents}") - string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" contents "${contents}") - string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" contents "${contents}") - file(WRITE "${release_share}/${debug_target_rel}" "${contents}") - - file(REMOVE "${debug_target}") - endforeach() - endif() - - #Fix ${_IMPORT_PREFIX} and absolute paths in cmake generated targets and configs; - #Since those can be renamed we have to check in every *.cmake, but only once. - file(GLOB_RECURSE main_cmakes "${release_share}/*.cmake") - if(NOT DEFINED Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) - vcpkg_list(SET Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) - endif() - foreach(already_fixed_up IN LISTS Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP) - vcpkg_list(REMOVE_ITEM main_cmakes "${already_fixed_up}") - endforeach() - vcpkg_list(APPEND Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP ${main_cmakes}) - set(Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP "${Z_VCPKG_CMAKE_CONFIG_ALREADY_FIXED_UP}" CACHE INTERNAL "") - - foreach(main_cmake IN LISTS main_cmakes) - file(READ "${main_cmake}" contents) - # Note: I think the following comment is no longer true, since we now require the path to be `share/blah` - # however, I don't know it for sure. - # - nimazzuc - - #This correction is not correct for all cases. To make it correct for all cases it needs to consider - #original folder deepness to CURRENT_PACKAGES_DIR in comparison to the moved to folder deepness which - #is always at least (>=) 2, e.g. share/${PORT}. Currently the code assumes it is always 2 although - #this requirement is only true for the *Config.cmake. The targets are not required to be in the same - #folder as the *Config.cmake! - if(NOT arg_NO_PREFIX_CORRECTION) - string(REGEX REPLACE -[[get_filename_component\(_IMPORT_PREFIX "\${CMAKE_CURRENT_LIST_FILE}" PATH\)( -get_filename_component\(_IMPORT_PREFIX "\${_IMPORT_PREFIX}" PATH\))*]] -[[get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] - contents "${contents}") # see #1044 for details why this replacement is necessary. See #4782 why it must be a regex. - string(REGEX REPLACE -[[get_filename_component\(PACKAGE_PREFIX_DIR "\${CMAKE_CURRENT_LIST_DIR}/\.\./(\.\./)*" ABSOLUTE\)]] -[[get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)]] - contents "${contents}") - string(REGEX REPLACE -[[get_filename_component\(PACKAGE_PREFIX_DIR "\${CMAKE_CURRENT_LIST_DIR}/\.\.((\\|/)\.\.)*" ABSOLUTE\)]] -[[get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE)]] - contents "${contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955 - endif() - - # Merge release and debug configurations of target property INTERFACE_LINK_LIBRARIES. - string(REPLACE "${release_share}/" "${debug_share}/" debug_cmake "${main_cmake}") - if(DEFINED VCPKG_BUILD_TYPE) - # Skip. Warning: A release-only port in a dual-config installation - # may pull release dependencies into the debug configuration. - elseif(NOT contents MATCHES "INTERFACE_LINK_LIBRARIES") - # Skip. No relevant properties. - elseif(NOT contents MATCHES "# Generated CMake target import file\\.") - # Skip. No safe assumptions about a matching debug import file. - elseif(NOT EXISTS "${debug_cmake}") - message(SEND_ERROR "Did not find a debug import file matching '${main_cmake}'") - else() - file(READ "${debug_cmake}" debug_contents) - while(contents MATCHES "set_target_properties\\(([^ \$]*) PROPERTIES[^)]*\\)") - set(matched_command "${CMAKE_MATCH_0}") - string(REPLACE "+" "\\+" target "${CMAKE_MATCH_1}") - if(NOT debug_contents MATCHES "set_target_properties\\(${target} PROPERTIES[^)]*\\)") - message(SEND_ERROR "Did not find a debug configuration for target '${target}'.") - endif() - set(debug_command "${CMAKE_MATCH_0}") - string(REGEX MATCH " INTERFACE_LINK_LIBRARIES \"([^\"]*)\"" release_line "${matched_command}") - set(release_libs "${CMAKE_MATCH_1}") - string(REGEX MATCH " INTERFACE_LINK_LIBRARIES \"([^\"]*)\"" debug_line "${debug_command}") - set(debug_libs "${CMAKE_MATCH_1}") - z_vcpkg_cmake_config_fixup_merge(merged_libs release_libs debug_libs) - string(REPLACE "${release_line}" " INTERFACE_LINK_LIBRARIES \"${merged_libs}\"" updated_command "${matched_command}") - string(REPLACE "set_target_properties" "set_target_properties::done" updated_command "${updated_command}") # Prevend 2nd match - string(REPLACE "${matched_command}" "${updated_command}" contents "${contents}") - endwhile() - string(REPLACE "set_target_properties::done" "set_target_properties" contents "${contents}") # Restore original command - endif() - - #Fix absolute paths to installed dir with ones relative to ${CMAKE_CURRENT_LIST_DIR} - #This happens if vcpkg built libraries are directly linked to a target instead of using - #an imported target. - string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") - file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) - string(REPLACE "${cmake_current_packages_dir}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") - # If ${VCPKG_IMPORT_PREFIX} was actually used, inject a definition of it: - string(FIND "${contents}" [[${VCPKG_IMPORT_PREFIX}]] index) - if (NOT index STREQUAL "-1") - get_filename_component(main_cmake_dir "${main_cmake}" DIRECTORY) - # Calculate relative to be a sequence of "../" - file(RELATIVE_PATH relative "${main_cmake_dir}" "${cmake_current_packages_dir}") - string(PREPEND contents "get_filename_component(VCPKG_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}\/${relative}\" ABSOLUTE)\n") - endif() - - file(WRITE "${main_cmake}" "${contents}") - endforeach() - - file(GLOB_RECURSE unused_files - "${debug_share}/*[Tt]argets.cmake" - "${debug_share}/*[Cc]onfig.cmake" - "${debug_share}/*[Cc]onfigVersion.cmake" - "${debug_share}/*[Cc]onfig-version.cmake" - ) - foreach(unused_file IN LISTS unused_files) - file(REMOVE "${unused_file}") - endforeach() - - # Remove /debug// if it's empty. - file(GLOB_RECURSE remaining_files "${debug_share}/*") - if(remaining_files STREQUAL "") - file(REMOVE_RECURSE "${debug_share}") - endif() - - # Remove /debug/share/ if it's empty. - file(GLOB_RECURSE remaining_files "${CURRENT_PACKAGES_DIR}/debug/share/*") - if(remaining_files STREQUAL "") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") - endif() -endfunction() - -# Merges link interface library lists for release and debug -# into a single expression which use generator expression as necessary. -function(z_vcpkg_cmake_config_fixup_merge out_var release_var debug_var) - set(release_libs "VCPKG;${${release_var}}") - string(REGEX REPLACE ";optimized;([^;]*)" ";\\1" release_libs "${release_libs}") - string(REGEX REPLACE ";debug;([^;]*)" ";" release_libs "${release_libs}") - list(REMOVE_AT release_libs 0) - list(FILTER release_libs EXCLUDE REGEX [[^\\[$]<\\[$]:]]) - list(TRANSFORM release_libs REPLACE [[^\\[$]<\\[$]>:(.*)>$]] "\\1") - - set(debug_libs "VCPKG;${${debug_var}}") - string(REGEX REPLACE ";optimized;([^;]*)" ";" debug_libs "${debug_libs}") - string(REGEX REPLACE ";debug;([^;]*)" ";\\1" debug_libs "${debug_libs}") - list(REMOVE_AT debug_libs 0) - list(FILTER debug_libs EXCLUDE REGEX [[^\\[$]<\\[$]>:]]) - list(TRANSFORM debug_libs REPLACE [[^\\[$]<\\[$]:(.*)>$]] "\\1") - - set(merged_libs "") - foreach(release_lib debug_lib IN ZIP_LISTS release_libs debug_libs) - if(release_lib STREQUAL debug_lib) - list(APPEND merged_libs "${release_lib}") - else() - if(release_lib) - list(APPEND merged_libs "\\\$<\\\$>:${release_lib}>") - endif() - if(debug_lib) - list(APPEND merged_libs "\\\$<\\\$:${debug_lib}>") - endif() - endif() - endforeach() - set("${out_var}" "${merged_libs}" PARENT_SCOPE) -endfunction() diff --git a/ports/vcpkg-cmake/portfile.cmake b/ports/vcpkg-cmake/portfile.cmake deleted file mode 100644 index 0b7dd502017..00000000000 --- a/ports/vcpkg-cmake/portfile.cmake +++ /dev/null @@ -1,14 +0,0 @@ -if(VCPKG_CROSSCOMPILING) - # make FATAL_ERROR in CI when issue #16773 fixed - message(WARNING "vcpkg-cmake is a host-only port; please mark it as a host port in your dependencies.") -endif() - -file(INSTALL - "${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_configure.cmake" - "${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_build.cmake" - "${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_install.cmake" - "${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake" - DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") - -file(INSTALL "${VCPKG_ROOT_DIR}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) -set(VCPKG_POLICY_CMAKE_HELPER_PORT enabled) diff --git a/ports/vcpkg-cmake/vcpkg-port-config.cmake b/ports/vcpkg-cmake/vcpkg-port-config.cmake deleted file mode 100644 index f2a973d4ebc..00000000000 --- a/ports/vcpkg-cmake/vcpkg-port-config.cmake +++ /dev/null @@ -1,3 +0,0 @@ -include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_configure.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_build.cmake") -include("${CMAKE_CURRENT_LIST_DIR}/vcpkg_cmake_install.cmake") diff --git a/ports/vcpkg-cmake/vcpkg.json b/ports/vcpkg-cmake/vcpkg.json deleted file mode 100644 index 94363823474..00000000000 --- a/ports/vcpkg-cmake/vcpkg.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "vcpkg-cmake", - "version-date": "2022-10-30", - "documentation": "https://vcpkg.io/en/docs/maintainers/ports/vcpkg-cmake.html", - "license": "MIT" -} diff --git a/ports/vcpkg-cmake/vcpkg_cmake_build.cmake b/ports/vcpkg-cmake/vcpkg_cmake_build.cmake deleted file mode 100644 index 47933b3fe9f..00000000000 --- a/ports/vcpkg-cmake/vcpkg_cmake_build.cmake +++ /dev/null @@ -1,91 +0,0 @@ -include_guard(GLOBAL) - -function(vcpkg_cmake_build) - cmake_parse_arguments(PARSE_ARGV 0 "arg" "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "TARGET;LOGFILE_BASE" "") - - if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "vcpkg_cmake_build was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") - endif() - if(NOT DEFINED arg_LOGFILE_BASE) - set(arg_LOGFILE_BASE "build") - endif() - vcpkg_list(SET build_param) - vcpkg_list(SET parallel_param) - vcpkg_list(SET no_parallel_param) - - if("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "Ninja") - vcpkg_list(SET build_param "-v") # verbose output - vcpkg_list(SET parallel_param "-j${VCPKG_CONCURRENCY}") - vcpkg_list(SET no_parallel_param "-j1") - elseif("${Z_VCPKG_CMAKE_GENERATOR}" MATCHES "^Visual Studio") - vcpkg_list(SET build_param - "/p:VCPkgLocalAppDataDisabled=true" - "/p:UseIntelMKL=No" - ) - vcpkg_list(SET parallel_param "/m") - elseif("${Z_VCPKG_CMAKE_GENERATOR}" STREQUAL "NMake Makefiles") - # No options are currently added for nmake builds - elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Unix Makefiles") - vcpkg_list(SET build_param "VERBOSE=1") - vcpkg_list(SET parallel_param "-j${VCPKG_CONCURRENCY}") - vcpkg_list(SET no_parallel_param "") - elseif(Z_VCPKG_CMAKE_GENERATOR STREQUAL "Xcode") - vcpkg_list(SET parallel_param -jobs "${VCPKG_CONCURRENCY}") - vcpkg_list(SET no_parallel_param -jobs 1) - else() - message(WARNING "Unrecognized GENERATOR setting from vcpkg_cmake_configure().") - endif() - - vcpkg_list(SET target_param) - if(arg_TARGET) - vcpkg_list(SET target_param "--target" "${arg_TARGET}") - endif() - - foreach(build_type IN ITEMS debug release) - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "${build_type}") - if("${build_type}" STREQUAL "debug") - set(short_build_type "dbg") - set(config "Debug") - else() - set(short_build_type "rel") - set(config "Release") - endif() - - message(STATUS "Building ${TARGET_TRIPLET}-${short_build_type}") - - if(arg_ADD_BIN_TO_PATH) - vcpkg_backup_env_variables(VARS PATH) - if("${build_type}" STREQUAL "debug") - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/debug/bin") - else() - vcpkg_add_to_path(PREPEND "${CURRENT_INSTALLED_DIR}/bin") - endif() - endif() - - if(arg_DISABLE_PARALLEL) - vcpkg_execute_build_process( - COMMAND - "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} - -- ${build_param} ${no_parallel_param} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_build_type}" - LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_build_type}" - ) - else() - vcpkg_execute_build_process( - COMMAND - "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} - -- ${build_param} ${parallel_param} - NO_PARALLEL_COMMAND - "${CMAKE_COMMAND}" --build . --config "${config}" ${target_param} - -- ${build_param} ${no_parallel_param} - WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-${short_build_type}" - LOGNAME "${arg_LOGFILE_BASE}-${TARGET_TRIPLET}-${short_build_type}" - ) - endif() - - if(arg_ADD_BIN_TO_PATH) - vcpkg_restore_env_variables(VARS PATH) - endif() - endif() - endforeach() -endfunction() diff --git a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake b/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake deleted file mode 100644 index 832bbf70079..00000000000 --- a/ports/vcpkg-cmake/vcpkg_cmake_configure.cmake +++ /dev/null @@ -1,320 +0,0 @@ -include_guard(GLOBAL) - -macro(z_vcpkg_cmake_configure_both_set_or_unset var1 var2) - if(DEFINED ${var1} AND NOT DEFINED ${var2}) - message(FATAL_ERROR "If ${var1} is set, then ${var2} must be set.") - elseif(NOT DEFINED ${var1} AND DEFINED ${var2}) - message(FATAL_ERROR "If ${var2} is set, then ${var1} must be set.") - endif() -endmacro() - -function(vcpkg_cmake_configure) - cmake_parse_arguments(PARSE_ARGV 0 "arg" - "PREFER_NINJA;DISABLE_PARALLEL_CONFIGURE;WINDOWS_USE_MSBUILD;NO_CHARSET_FLAG;Z_CMAKE_GET_VARS_USAGE" - "SOURCE_PATH;GENERATOR;LOGFILE_BASE" - "OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;MAYBE_UNUSED_VARIABLES" - ) - - if(NOT arg_Z_CMAKE_GET_VARS_USAGE AND DEFINED CACHE{Z_VCPKG_CMAKE_GENERATOR}) - message(WARNING "${CMAKE_CURRENT_FUNCTION} already called; this function should only be called once.") - endif() - if(arg_PREFER_NINJA) - message(WARNING "PREFER_NINJA has been deprecated in ${CMAKE_CURRENT_FUNCTION}. Please remove it from the portfile!") - endif() - - if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") - endif() - - if(NOT DEFINED arg_SOURCE_PATH) - message(FATAL_ERROR "SOURCE_PATH must be set") - endif() - if(NOT DEFINED arg_LOGFILE_BASE) - set(arg_LOGFILE_BASE "config-${TARGET_TRIPLET}") - endif() - - set(manually_specified_variables "") - - if(arg_Z_CMAKE_GET_VARS_USAGE) - set(configuring_message "Getting CMake variables for ${TARGET_TRIPLET}") - else() - set(configuring_message "Configuring ${TARGET_TRIPLET}") - - foreach(option IN LISTS arg_OPTIONS arg_OPTIONS_RELEASE arg_OPTIONS_DEBUG) - if("${option}" MATCHES "^-D([^:=]*)[:=]") - vcpkg_list(APPEND manually_specified_variables "${CMAKE_MATCH_1}") - endif() - endforeach() - vcpkg_list(REMOVE_DUPLICATES manually_specified_variables) - foreach(maybe_unused_var IN LISTS arg_MAYBE_UNUSED_VARIABLES) - vcpkg_list(REMOVE_ITEM manually_specified_variables "${maybe_unused_var}") - endforeach() - debug_message("manually specified variables: ${manually_specified_variables}") - endif() - - if(CMAKE_HOST_WIN32) - if(DEFINED ENV{PROCESSOR_ARCHITEW6432}) - set(host_architecture "$ENV{PROCESSOR_ARCHITEW6432}") - else() - set(host_architecture "$ENV{PROCESSOR_ARCHITECTURE}") - endif() - endif() - - set(ninja_host ON) # Ninja availability - if(host_architecture STREQUAL "x86" OR DEFINED ENV{VCPKG_FORCE_SYSTEM_BINARIES}) - # Prebuilt ninja binaries are only provided for x64 hosts - find_program(NINJA NAMES ninja ninja-build) - if(NOT NINJA) - set(ninja_host OFF) - set(arg_DISABLE_PARALLEL_CONFIGURE ON) - set(arg_WINDOWS_USE_MSBUILD ON) - endif() - endif() - - set(generator "") - set(architecture_options "") - if(arg_WINDOWS_USE_MSBUILD AND VCPKG_HOST_IS_WINDOWS AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - z_vcpkg_get_visual_studio_generator(OUT_GENERATOR generator OUT_ARCH arch) - vcpkg_list(APPEND architecture_options "-A${arch}") - if(DEFINED VCPKG_PLATFORM_TOOLSET) - vcpkg_list(APPEND arg_OPTIONS "-T${VCPKG_PLATFORM_TOOLSET}") - endif() - if(NOT generator) - message(FATAL_ERROR "Unable to determine appropriate Visual Studio generator for triplet ${TARGET_TRIPLET}: - ENV{VisualStudioVersion} : $ENV{VisualStudioVersion} - VCPKG_TARGET_ARCHITECTURE: ${VCPKG_TARGET_ARCHITECTURE}") - endif() - elseif(DEFINED arg_GENERATOR) - set(generator "${arg_GENERATOR}") - elseif(ninja_host) - set(generator "Ninja") - elseif(NOT VCPKG_HOST_IS_WINDOWS) - set(generator "Unix Makefiles") - endif() - - if(NOT generator) - if(NOT VCPKG_CMAKE_SYSTEM_NAME) - set(VCPKG_CMAKE_SYSTEM_NAME "Windows") - endif() - message(FATAL_ERROR "Unable to determine appropriate generator for: " - "${VCPKG_CMAKE_SYSTEM_NAME}-${VCPKG_TARGET_ARCHITECTURE}-${VCPKG_PLATFORM_TOOLSET}") - endif() - - if(generator STREQUAL "Ninja") - vcpkg_find_acquire_program(NINJA) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_MAKE_PROGRAM=${NINJA}") - # If we use Ninja, it must be on PATH for CMake's ExternalProject, - # cf. https://gitlab.kitware.com/cmake/cmake/-/issues/23355. - get_filename_component(ninja_path "${NINJA}" DIRECTORY) - vcpkg_add_to_path("${ninja_path}") - endif() - - set(build_dir_release "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") - set(build_dir_debug "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg") - file(REMOVE_RECURSE - "${build_dir_release}" - "${build_dir_debug}") - file(MAKE_DIRECTORY "${build_dir_release}") - if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(MAKE_DIRECTORY "${build_dir_debug}") - endif() - - if(DEFINED VCPKG_CMAKE_SYSTEM_NAME) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_NAME=${VCPKG_CMAKE_SYSTEM_NAME}") - if(VCPKG_TARGET_IS_UWP AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) - set(VCPKG_CMAKE_SYSTEM_VERSION 10.0) - elseif(VCPKG_TARGET_IS_ANDROID AND NOT DEFINED VCPKG_CMAKE_SYSTEM_VERSION) - set(VCPKG_CMAKE_SYSTEM_VERSION 21) - endif() - endif() - - if(DEFINED VCPKG_CMAKE_SYSTEM_VERSION) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_SYSTEM_VERSION=${VCPKG_CMAKE_SYSTEM_VERSION}") - endif() - - if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - vcpkg_list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=ON") - elseif(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - vcpkg_list(APPEND arg_OPTIONS "-DBUILD_SHARED_LIBS=OFF") - else() - message(FATAL_ERROR - "Invalid setting for VCPKG_LIBRARY_LINKAGE: \"${VCPKG_LIBRARY_LINKAGE}\". " - "It must be \"static\" or \"dynamic\"") - endif() - - z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS_DEBUG VCPKG_C_FLAGS_DEBUG) - z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS_RELEASE VCPKG_C_FLAGS_RELEASE) - z_vcpkg_cmake_configure_both_set_or_unset(VCPKG_CXX_FLAGS VCPKG_C_FLAGS) - - set(VCPKG_SET_CHARSET_FLAG ON) - if(arg_NO_CHARSET_FLAG) - set(VCPKG_SET_CHARSET_FLAG OFF) - endif() - - if(NOT DEFINED VCPKG_CHAINLOAD_TOOLCHAIN_FILE) - z_vcpkg_select_default_vcpkg_chainload_toolchain() - endif() - - list(JOIN VCPKG_TARGET_ARCHITECTURE "\;" target_architecture_string) - vcpkg_list(APPEND arg_OPTIONS - "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" - "-DVCPKG_TARGET_TRIPLET=${TARGET_TRIPLET}" - "-DVCPKG_SET_CHARSET_FLAG=${VCPKG_SET_CHARSET_FLAG}" - "-DVCPKG_PLATFORM_TOOLSET=${VCPKG_PLATFORM_TOOLSET}" - "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" - "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" - "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" - "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" - "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DVCPKG_APPLOCAL_DEPS=OFF" - "-DCMAKE_TOOLCHAIN_FILE=${SCRIPTS}/buildsystems/vcpkg.cmake" - "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" - "-DVCPKG_CXX_FLAGS=${VCPKG_CXX_FLAGS}" - "-DVCPKG_CXX_FLAGS_RELEASE=${VCPKG_CXX_FLAGS_RELEASE}" - "-DVCPKG_CXX_FLAGS_DEBUG=${VCPKG_CXX_FLAGS_DEBUG}" - "-DVCPKG_C_FLAGS=${VCPKG_C_FLAGS}" - "-DVCPKG_C_FLAGS_RELEASE=${VCPKG_C_FLAGS_RELEASE}" - "-DVCPKG_C_FLAGS_DEBUG=${VCPKG_C_FLAGS_DEBUG}" - "-DVCPKG_CRT_LINKAGE=${VCPKG_CRT_LINKAGE}" - "-DVCPKG_LINKER_FLAGS=${VCPKG_LINKER_FLAGS}" - "-DVCPKG_LINKER_FLAGS_RELEASE=${VCPKG_LINKER_FLAGS_RELEASE}" - "-DVCPKG_LINKER_FLAGS_DEBUG=${VCPKG_LINKER_FLAGS_DEBUG}" - "-DVCPKG_TARGET_ARCHITECTURE=${target_architecture_string}" - "-DCMAKE_INSTALL_LIBDIR:STRING=lib" - "-DCMAKE_INSTALL_BINDIR:STRING=bin" - "-D_VCPKG_ROOT_DIR=${VCPKG_ROOT_DIR}" - "-D_VCPKG_INSTALLED_DIR=${_VCPKG_INSTALLED_DIR}" - "-DVCPKG_MANIFEST_INSTALL=OFF" - "-DFETCHCONTENT_FULLY_DISCONNECTED=ON" - ) - - # Sets configuration variables for macOS builds - foreach(config_var IN ITEMS INSTALL_NAME_DIR OSX_DEPLOYMENT_TARGET OSX_SYSROOT OSX_ARCHITECTURES) - if(DEFINED VCPKG_${config_var}) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_${config_var}=${VCPKG_${config_var}}") - endif() - endforeach() - - # Allow overrides / additional configuration variables from triplets - if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS) - vcpkg_list(APPEND arg_OPTIONS ${VCPKG_CMAKE_CONFIGURE_OPTIONS}) - endif() - if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE) - vcpkg_list(APPEND arg_OPTIONS_RELEASE ${VCPKG_CMAKE_CONFIGURE_OPTIONS_RELEASE}) - endif() - if(DEFINED VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG) - vcpkg_list(APPEND arg_OPTIONS_DEBUG ${VCPKG_CMAKE_CONFIGURE_OPTIONS_DEBUG}) - endif() - - vcpkg_list(SET rel_command - "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" - -G "${generator}" - ${architecture_options} - "-DCMAKE_BUILD_TYPE=Release" - "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}" - ${arg_OPTIONS} ${arg_OPTIONS_RELEASE}) - vcpkg_list(SET dbg_command - "${CMAKE_COMMAND}" "${arg_SOURCE_PATH}" - -G "${generator}" - ${architecture_options} - "-DCMAKE_BUILD_TYPE=Debug" - "-DCMAKE_INSTALL_PREFIX=${CURRENT_PACKAGES_DIR}/debug" - ${arg_OPTIONS} ${arg_OPTIONS_DEBUG}) - - if(NOT arg_DISABLE_PARALLEL_CONFIGURE) - vcpkg_list(APPEND arg_OPTIONS "-DCMAKE_DISABLE_SOURCE_CHANGES=ON") - - vcpkg_find_acquire_program(NINJA) - - #parallelize the configure step - set(ninja_configure_contents - "rule CreateProcess\n command = \$process\n\n" - ) - - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") - z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents ".." "rel") - endif() - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") - z_vcpkg_configure_cmake_build_cmakecache(ninja_configure_contents "../../${TARGET_TRIPLET}-dbg" "dbg") - endif() - - file(MAKE_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure") - file(WRITE - "${build_dir_release}/vcpkg-parallel-configure/build.ninja" - "${ninja_configure_contents}") - - message(STATUS "${configuring_message}") - vcpkg_execute_required_process( - COMMAND "${NINJA}" -v - WORKING_DIRECTORY "${build_dir_release}/vcpkg-parallel-configure" - LOGNAME "${arg_LOGFILE_BASE}" - SAVE_LOG_FILES ../../${TARGET_TRIPLET}-dbg/CMakeCache.txt ../CMakeCache.txt - ) - - vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-err.log") - else() - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "debug") - message(STATUS "${configuring_message}-dbg") - vcpkg_execute_required_process( - COMMAND ${dbg_command} - WORKING_DIRECTORY "${build_dir_debug}" - LOGNAME "${arg_LOGFILE_BASE}-dbg" - SAVE_LOG_FILES CMakeCache.txt - ) - vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-dbg-err.log") - endif() - - if(NOT DEFINED VCPKG_BUILD_TYPE OR "${VCPKG_BUILD_TYPE}" STREQUAL "release") - message(STATUS "${configuring_message}-rel") - vcpkg_execute_required_process( - COMMAND ${rel_command} - WORKING_DIRECTORY "${build_dir_release}" - LOGNAME "${arg_LOGFILE_BASE}-rel" - SAVE_LOG_FILES CMakeCache.txt - ) - vcpkg_list(APPEND config_logs - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-out.log" - "${CURRENT_BUILDTREES_DIR}/${arg_LOGFILE_BASE}-rel-err.log") - endif() - endif() - - set(all_unused_variables) - foreach(config_log IN LISTS config_logs) - if(NOT EXISTS "${config_log}") - continue() - endif() - file(READ "${config_log}" log_contents) - debug_message("Reading configure log ${config_log}...") - if(NOT log_contents MATCHES "Manually-specified variables were not used by the project:\n\n(( [^\n]*\n)*)") - continue() - endif() - string(STRIP "${CMAKE_MATCH_1}" unused_variables) # remove leading ` ` and trailing `\n` - string(REPLACE "\n " ";" unused_variables "${unused_variables}") - debug_message("unused variables: ${unused_variables}") - foreach(unused_variable IN LISTS unused_variables) - if(unused_variable IN_LIST manually_specified_variables) - debug_message("manually specified unused variable: ${unused_variable}") - vcpkg_list(APPEND all_unused_variables "${unused_variable}") - else() - debug_message("unused variable (not manually specified): ${unused_variable}") - endif() - endforeach() - endforeach() - - if(DEFINED all_unused_variables) - vcpkg_list(REMOVE_DUPLICATES all_unused_variables) - vcpkg_list(JOIN all_unused_variables "\n " all_unused_variables) - message(WARNING "The following variables are not used in CMakeLists.txt: - ${all_unused_variables} -Please recheck them and remove the unnecessary options from the `vcpkg_cmake_configure` call. -If these options should still be passed for whatever reason, please use the `MAYBE_UNUSED_VARIABLES` argument.") - endif() - - if(NOT arg_Z_CMAKE_GET_VARS_USAGE) - set(Z_VCPKG_CMAKE_GENERATOR "${generator}" CACHE INTERNAL "The generator which was used to configure CMake.") - endif() -endfunction() diff --git a/ports/vcpkg-cmake/vcpkg_cmake_install.cmake b/ports/vcpkg-cmake/vcpkg_cmake_install.cmake deleted file mode 100644 index 2bd8b4ea75f..00000000000 --- a/ports/vcpkg-cmake/vcpkg_cmake_install.cmake +++ /dev/null @@ -1,21 +0,0 @@ -include_guard(GLOBAL) - -function(vcpkg_cmake_install) - cmake_parse_arguments(PARSE_ARGV 0 "arg" "DISABLE_PARALLEL;ADD_BIN_TO_PATH" "" "") - if(DEFINED arg_UNPARSED_ARGUMENTS) - message(FATAL_ERROR "vcpkg_cmake_install was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}") - endif() - - set(args) - foreach(arg IN ITEMS DISABLE_PARALLEL ADD_BIN_TO_PATH) - if(arg_${arg}) - list(APPEND args "${arg}") - endif() - endforeach() - - vcpkg_cmake_build( - ${args} - LOGFILE_BASE install - TARGET install - ) -endfunction() diff --git a/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch b/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch deleted file mode 100644 index 8fe2b2f5a66..00000000000 --- a/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/zconf.h.cmakein b/zconf.h.cmakein -index a7f24cc..a1b359b 100644 ---- a/zconf.h.cmakein -+++ b/zconf.h.cmakein -@@ -434,11 +434,19 @@ typedef uLong FAR uLongf; - #endif - - #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ --# define Z_HAVE_UNISTD_H -+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 -+# define Z_HAVE_UNISTD_H -+# elif HAVE_UNISTD_H != 0 -+# define Z_HAVE_UNISTD_H -+# endif - #endif - - #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ --# define Z_HAVE_STDARG_H -+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 -+# define Z_HAVE_STDARG_H -+# elif HAVE_STDARG_H != 0 -+# define Z_HAVE_STDARG_H -+# endif - #endif - - #ifdef STDC -diff --git a/zconf.h.in b/zconf.h.in -index 5e1d68a..32f53c8 100644 ---- a/zconf.h.in -+++ b/zconf.h.in -@@ -432,11 +432,19 @@ typedef uLong FAR uLongf; - #endif - - #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ --# define Z_HAVE_UNISTD_H -+# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 -+# define Z_HAVE_UNISTD_H -+# elif HAVE_UNISTD_H != 0 -+# define Z_HAVE_UNISTD_H -+# endif - #endif - - #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ --# define Z_HAVE_STDARG_H -+# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 -+# define Z_HAVE_STDARG_H -+# elif HAVE_STDARG_H != 0 -+# define Z_HAVE_STDARG_H -+# endif - #endif - - #ifdef STDC - diff --git a/ports/zlib/0002-skip-building-examples.patch b/ports/zlib/0002-skip-building-examples.patch deleted file mode 100644 index 8183f2ab20b..00000000000 --- a/ports/zlib/0002-skip-building-examples.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b412dc7..f46c8e6 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -194,6 +194,7 @@ endif() - # Example binaries - #============================================================================ - -+if (0) - add_executable(example test/example.c) - target_link_libraries(example zlib) - add_test(example example) -@@ -211,3 +212,4 @@ if(HAVE_OFF64_T) - target_link_libraries(minigzip64 zlib) - set_target_properties(minigzip64 PROPERTIES COMPILE_FLAGS "-D_FILE_OFFSET_BITS=64") - endif() -+endif() diff --git a/ports/zlib/0003-build-static-or-shared-not-both.patch b/ports/zlib/0003-build-static-or-shared-not-both.patch deleted file mode 100644 index c9f2ecf1976..00000000000 --- a/ports/zlib/0003-build-static-or-shared-not-both.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index f46c8e6..6fa5575 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -121,9 +121,11 @@ set(ZLIB_SRCS - ) - - if(NOT MINGW) -+ if(BUILD_SHARED_LIBS) - set(ZLIB_DLL_SRCS - win32/zlib1.rc # If present will override custom build rule below. - ) -+ endif() - endif() - - # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION -@@ -144,13 +146,16 @@ if(MINGW) - -I ${CMAKE_CURRENT_BINARY_DIR} - -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj - -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) -+ if(BUILD_SHARED_LIBS) - set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) -+ endif() - endif(MINGW) - --add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) --add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -+if (BUILD_SHARED_LIBS) - set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) - set_target_properties(zlib PROPERTIES SOVERSION 1) -+endif() - - if(NOT CYGWIN) - # This property causes shared libraries on Linux to have the full version -@@ -165,7 +170,7 @@ endif() - - if(UNIX) - # On unix-like platforms the library is almost always called libz -- set_target_properties(zlib zlibstatic PROPERTIES OUTPUT_NAME z) -+ set_target_properties(zlib PROPERTIES OUTPUT_NAME z) - if(NOT APPLE) - set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") - endif() -@@ -175,7 +180,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) - endif() - - if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) -- install(TARGETS zlib zlibstatic -+ install(TARGETS zlib - RUNTIME DESTINATION "${INSTALL_BIN_DIR}" - ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" ) diff --git a/ports/zlib/0004-android-and-mingw-fixes.patch b/ports/zlib/0004-android-and-mingw-fixes.patch deleted file mode 100644 index e93173f2461..00000000000 --- a/ports/zlib/0004-android-and-mingw-fixes.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6fa5575..7c345db 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -56,7 +56,7 @@ endif() - # - check_include_file(unistd.h Z_HAVE_UNISTD_H) - --if(MSVC) -+if(WIN32) - set(CMAKE_DEBUG_POSTFIX "d") - add_definitions(-D_CRT_SECURE_NO_DEPRECATE) - add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE) -@@ -133,7 +133,7 @@ file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents) - string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*" - "\\1" ZLIB_FULL_VERSION ${_zlib_h_contents}) - --if(MINGW) -+if(MINGW AND NOT ANDROID) - # This gets us DLL resource information when compiling on MinGW. - if(NOT CMAKE_RC_COMPILER) - set(CMAKE_RC_COMPILER windres.exe) -@@ -149,7 +149,7 @@ if(MINGW) - if(BUILD_SHARED_LIBS) - set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) - endif() --endif(MINGW) -+endif(MINGW AND NOT ANDROID) - - add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) - if (BUILD_SHARED_LIBS) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake deleted file mode 100644 index 450cb2c1915..00000000000 --- a/ports/zlib/portfile.cmake +++ /dev/null @@ -1,53 +0,0 @@ -# When this port is updated, the minizip port should be updated at the same time -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO madler/zlib - REF v1.2.13 - SHA512 44b834fbfb50cca229209b8dbe1f96b258f19a49f5df23b80970b716371d856a4adf525edb4c6e0e645b180ea949cb90f5365a1d896160f297f56794dd888659 - HEAD_REF master - PATCHES - 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch - 0002-skip-building-examples.patch - 0003-build-static-or-shared-not-both.patch - 0004-android-and-mingw-fixes.patch -) - -# This is generated during the cmake build -file(REMOVE "${SOURCE_PATH}/zconf.h") - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DSKIP_INSTALL_FILES=ON - OPTIONS_DEBUG - -DSKIP_INSTALL_HEADERS=ON -) - -vcpkg_cmake_install() -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") - -# Install the pkgconfig file -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc" "-lz" "-lzlib") - endif() - file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/zlib.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/lib/pkgconfig") -endif() -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - if(VCPKG_TARGET_IS_WINDOWS) - vcpkg_replace_string("${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc" "-lz" "-lzlibd") - endif() - file(COPY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/zlib.pc" DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig") -endif() - -vcpkg_fixup_pkgconfig() -vcpkg_copy_pdbs() - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zconf.h" "ifdef ZLIB_DLL" "if 0") -else() - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/zconf.h" "ifdef ZLIB_DLL" "if 1") -endif() - -file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/zlib/usage b/ports/zlib/usage deleted file mode 100644 index 39d8618221a..00000000000 --- a/ports/zlib/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package zlib is compatible with built-in CMake targets: - - find_package(ZLIB REQUIRED) - target_link_libraries(main PRIVATE ZLIB::ZLIB) diff --git a/ports/zlib/vcpkg-cmake-wrapper.cmake b/ports/zlib/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 8624b70867e..00000000000 --- a/ports/zlib/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,12 +0,0 @@ -find_path(ZLIB_INCLUDE_DIR NAMES zlib.h PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include" NO_DEFAULT_PATH) -find_library(ZLIB_LIBRARY_RELEASE NAMES zlib z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/lib" NO_DEFAULT_PATH) -find_library(ZLIB_LIBRARY_DEBUG NAMES zlibd z PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/lib" NO_DEFAULT_PATH) -if(NOT ZLIB_INCLUDE_DIR OR NOT (ZLIB_LIBRARY_RELEASE OR ZLIB_LIBRARY_DEBUG)) - message(FATAL_ERROR "Broken installation of vcpkg port zlib") -endif() -if(CMAKE_VERSION VERSION_LESS 3.4) - include(SelectLibraryConfigurations) - select_library_configurations(ZLIB) - unset(ZLIB_FOUND) -endif() -_find_package(${ARGS}) diff --git a/ports/zlib/vcpkg.json b/ports/zlib/vcpkg.json deleted file mode 100644 index 7ef1f29d8ed..00000000000 --- a/ports/zlib/vcpkg.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "zlib", - "version": "1.2.13", - "description": "A compression library", - "homepage": "https://www.zlib.net/", - "license": "Zlib", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - } - ] -} diff --git a/ports/zstd/install_pkgpc.patch b/ports/zstd/install_pkgpc.patch deleted file mode 100644 index a0582d98b21..00000000000 --- a/ports/zstd/install_pkgpc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt -index 5f75665..dabc9d5 100644 ---- a/build/cmake/lib/CMakeLists.txt -+++ b/build/cmake/lib/CMakeLists.txt -@@ -130,7 +130,7 @@ if (ZSTD_BUILD_STATIC) - OUTPUT_NAME ${STATIC_LIBRARY_BASE_NAME}) - endif () - --if (UNIX OR MINGW) -+if (1) - # pkg-config - set(PREFIX "${CMAKE_INSTALL_PREFIX}") - set(EXEC_PREFIX "\${prefix}") diff --git a/ports/zstd/no-static-suffix.patch b/ports/zstd/no-static-suffix.patch deleted file mode 100644 index 4e61f96b87d..00000000000 --- a/ports/zstd/no-static-suffix.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/build/cmake/lib/CMakeLists.txt b/build/cmake/lib/CMakeLists.txt -index 8234060..765f003 100644 ---- a/build/cmake/lib/CMakeLists.txt -+++ b/build/cmake/lib/CMakeLists.txt -@@ -112,7 +112,7 @@ endif () - - # With MSVC static library needs to be renamed to avoid conflict with import library - if (MSVC OR (WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MINGW)) -- set(STATIC_LIBRARY_BASE_NAME zstd_static) -+ set(STATIC_LIBRARY_BASE_NAME zstd) - else () - set(STATIC_LIBRARY_BASE_NAME zstd) - endif () diff --git a/ports/zstd/portfile.cmake b/ports/zstd/portfile.cmake deleted file mode 100644 index 6d7aa4df883..00000000000 --- a/ports/zstd/portfile.cmake +++ /dev/null @@ -1,55 +0,0 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} -vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO facebook/zstd - REF "v${VERSION}" - SHA512 e107508a41fca50845cc2494e64adaba93efb95a2fa486fc962510a8ba4b2180d93067cae9870f119e88e5e8b28a046bc2240b0b23cdd8933d1fb1a6a9668c1e - HEAD_REF dev - PATCHES - install_pkgpc.patch - no-static-suffix.patch -) - -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ZSTD_BUILD_STATIC) -string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ZSTD_BUILD_SHARED) - -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}/build/cmake" - OPTIONS - -DZSTD_BUILD_SHARED=${ZSTD_BUILD_SHARED} - -DZSTD_BUILD_STATIC=${ZSTD_BUILD_STATIC} - -DZSTD_LEGACY_SUPPORT=1 - -DZSTD_BUILD_PROGRAMS=0 - -DZSTD_BUILD_TESTS=0 - -DZSTD_BUILD_CONTRIB=0 - -DZSTD_MULTITHREAD_SUPPORT=1 -) - -vcpkg_cmake_install() -vcpkg_copy_pdbs() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/zstd) -vcpkg_fixup_pkgconfig() - -file(READ "${CURRENT_PACKAGES_DIR}/share/zstd/zstdTargets.cmake" targets) -if(targets MATCHES "-pthread") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libzstd.pc" " -lzstd" " -lzstd -pthread") - if(NOT VCPKG_BUILD_TYPE) - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libzstd.pc" " -lzstd" " -lzstd -pthread") - endif() -endif() - -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") - -if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - foreach(HEADER IN ITEMS zdict.h zstd.h zstd_errors.h) - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/${HEADER}" "defined(ZSTD_DLL_IMPORT) && (ZSTD_DLL_IMPORT==1)" "1" ) - endforeach() -endif() - -file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -vcpkg_install_copyright( - COMMENT "ZSTD is dual licensed under BSD and GPLv2." - FILE_LIST - "${SOURCE_PATH}/LICENSE" - "${SOURCE_PATH}/COPYING" -) diff --git a/ports/zstd/usage b/ports/zstd/usage deleted file mode 100644 index f01a2f5cfb7..00000000000 --- a/ports/zstd/usage +++ /dev/null @@ -1,4 +0,0 @@ -The package zstd provides CMake targets: - - find_package(zstd CONFIG REQUIRED) - target_link_libraries(main PRIVATE $,zstd::libzstd_shared,zstd::libzstd_static>) diff --git a/ports/zstd/vcpkg.json b/ports/zstd/vcpkg.json deleted file mode 100644 index d683b33e7de..00000000000 --- a/ports/zstd/vcpkg.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "zstd", - "version": "1.5.2", - "port-version": 3, - "description": "Zstandard - Fast real-time compression algorithm", - "homepage": "https://facebook.github.io/zstd/", - "license": "BSD-3-Clause OR GPL-2.0-only", - "dependencies": [ - { - "name": "vcpkg-cmake", - "host": true - }, - { - "name": "vcpkg-cmake-config", - "host": true - } - ] -}