From 5d52e4eacb378e7b88b7b54b10499c401ccd2cc9 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 20 Sep 2022 07:26:46 +0200 Subject: [PATCH 01/20] Don't use external ZLIB_DLL --- ports/zlib/portfile.cmake | 6 ++++++ ports/zlib/vcpkg.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 66398f322426d2..64437f6a1b51ab 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -43,5 +43,11 @@ 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}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/zlib/vcpkg.json b/ports/zlib/vcpkg.json index 078669f294b6f2..8dccdf32db8954 100644 --- a/ports/zlib/vcpkg.json +++ b/ports/zlib/vcpkg.json @@ -1,7 +1,7 @@ { "name": "zlib", "version": "1.2.12", - "port-version": 1, + "port-version": 2, "description": "A compression library", "homepage": "https://www.zlib.net/", "license": "Zlib", From 5884a5c6d0d7980292cb01f2763c6790a50934a9 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 20 Sep 2022 07:28:04 +0200 Subject: [PATCH 02/20] Update versions --- versions/baseline.json | 2 +- versions/z-/zlib.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 37380ee4c5553d..b2075f377095c4 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8034,7 +8034,7 @@ }, "zlib": { "baseline": "1.2.12", - "port-version": 1 + "port-version": 2 }, "zlib-ng": { "baseline": "2.0.6", diff --git a/versions/z-/zlib.json b/versions/z-/zlib.json index 523f7374adddea..2f7b2ebd319627 100644 --- a/versions/z-/zlib.json +++ b/versions/z-/zlib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "9e13e4081b7f42980e3ee8740d80f1ca43d1fe20", + "version": "1.2.12", + "port-version": 2 + }, { "git-tree": "ecc4c064d4911faf12d8bf5fd6bcd5c556d89774", "version": "1.2.12", From 92ed840b474e72b13458f8fa965e8a26e6778db3 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 21 Sep 2022 07:44:57 +0200 Subject: [PATCH 03/20] [minizip] Bump to zlib version --- ports/minizip/CMakeLists.txt | 7 +------ ports/minizip/portfile.cmake | 7 ++++--- ports/minizip/vcpkg.json | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/ports/minizip/CMakeLists.txt b/ports/minizip/CMakeLists.txt index c17ab8974230b6..c03a906865a228 100644 --- a/ports/minizip/CMakeLists.txt +++ b/ports/minizip/CMakeLists.txt @@ -1,10 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(minizip C) - -set(PROJECT_VERSION 1.2.11) -set(PROJECT_VERSION_MAJOR 1) -set(PROJECT_VERSION_MINOR 2) -set(PROJECT_VERSION_PATCH 11) +project(minizip VERSION 1.2.12 LANGUAGES C) if(MSVC) add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) diff --git a/ports/minizip/portfile.cmake b/ports/minizip/portfile.cmake index 006df5863b4fc3..236d2c1b2cccad 100644 --- a/ports/minizip/portfile.cmake +++ b/ports/minizip/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO madler/zlib - REF v1.2.11 - SHA512 104c62ed1228b5f1199bc037081861576900eb0697a226cafa62a35c4c890b5cb46622e399f9aad82ee5dfb475bae26ae75e2bd6da3d261361b1c8b996970faf + REF v1.2.12 + SHA512 5b029532a9f5f12ad425c12eccdf1b77c8d91801342c5b5e26ffb539f76a204e6c4882b40f0130f143f2cd38df90e90af2978cf4bb997e1fa3a0d1eff2ca979e HEAD_REF master PATCHES 0001-remove-ifndef-NOUNCRYPT.patch @@ -14,7 +14,8 @@ vcpkg_from_github( ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS - bzip2 ENABLE_BZIP2 + FEATURES + bzip2 ENABLE_BZIP2 ) configure_file("${CMAKE_CURRENT_LIST_DIR}/minizipConfig.cmake.in" "${SOURCE_PATH}/cmake/minizipConfig.cmake.in" COPYONLY) diff --git a/ports/minizip/vcpkg.json b/ports/minizip/vcpkg.json index 31a55ac100e6bb..65251ace8dd0ad 100644 --- a/ports/minizip/vcpkg.json +++ b/ports/minizip/vcpkg.json @@ -1,9 +1,9 @@ { "name": "minizip", - "version-semver": "1.2.11", - "port-version": 11, + "version-semver": "1.2.12", "description": "Zip compression library", "homepage": "https://github.com/madler/zlib", + "license": "Zlib", "supports": "!uwp", "dependencies": [ { From f39126d498530f81d111af326a78f5b12a32a357 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 22 Sep 2022 06:25:36 +0200 Subject: [PATCH 04/20] Update versions --- versions/baseline.json | 4 ++-- versions/m-/minizip.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index b2075f377095c4..29567bab015ef5 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4741,8 +4741,8 @@ "port-version": 1 }, "minizip": { - "baseline": "1.2.11", - "port-version": 11 + "baseline": "1.2.12", + "port-version": 0 }, "minizip-ng": { "baseline": "3.0.5", diff --git a/versions/m-/minizip.json b/versions/m-/minizip.json index 9c1239b4e68bcf..c85a7b5507c245 100644 --- a/versions/m-/minizip.json +++ b/versions/m-/minizip.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "65a32bfac58033a215e271db94d5e022fce816e3", + "version-semver": "1.2.12", + "port-version": 0 + }, { "git-tree": "528703ed8d2b78aeaa55695765535efafa24540b", "version-semver": "1.2.11", From 2a1076ffc31a46b654f303ea1c67d170ebc71b19 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 21 Sep 2022 08:31:08 +0200 Subject: [PATCH 05/20] [libkml] Fix mingw build --- ports/libkml/fix-mingw.patch | 74 ++++++++++++++++++++++++++++++++++++ ports/libkml/portfile.cmake | 1 + ports/libkml/vcpkg.json | 2 +- 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 ports/libkml/fix-mingw.patch diff --git a/ports/libkml/fix-mingw.patch b/ports/libkml/fix-mingw.patch new file mode 100644 index 00000000000000..324acbcd70c81b --- /dev/null +++ b/ports/libkml/fix-mingw.patch @@ -0,0 +1,74 @@ +diff --git a/src/kml/base/file_win32.cc b/src/kml/base/file_win32.cc +index 28ccb36..794f2bb 100644 +--- a/src/kml/base/file_win32.cc ++++ b/src/kml/base/file_win32.cc +@@ -34,11 +34,14 @@ + #include "kml/base/file.h" + #include + #include ++#ifndef __MINGW32__ + #include ++#endif + #include + + namespace kmlbase { + ++#ifndef __MINGW32__ + // Internal to the win32 file class. We need a conversion from string to + // LPCWSTR. + static std::wstring Str2Wstr(const string& str) { +@@ -56,12 +59,17 @@ string Wstr2Str(const std::wstring& wstr) { + static_cast(s), NULL, NULL); + return str; + } ++#endif + + bool File::Exists(const string& full_path) { + if (full_path.empty()) { + return false; + } ++#ifndef __MINGW32__ + std::wstring wstr = Str2Wstr(full_path); ++#else ++ auto wstr = full_path; ++#endif + DWORD attrs = ::GetFileAttributes(wstr.c_str()); + return (attrs != INVALID_FILE_ATTRIBUTES) && + ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0); +@@ -71,7 +79,11 @@ bool File::Delete(const string& filepath) { + if (filepath.empty()) { + return false; + } ++#ifndef __MINGW32__ + std::wstring wstr = Str2Wstr(filepath); ++#else ++ auto wstr = filepath; ++#endif + return ::DeleteFile(wstr.c_str()) ? true : false; + } + +@@ -97,7 +109,11 @@ bool File::CreateNewTempFile(string* path) { + if (uRetVal == 0) { + return false; + } ++#ifndef __MINGW32__ + string str = Wstr2Str(szTempName); ++#else ++ auto str = std::string(szTempName); ++#endif + path->assign(str.c_str(), strlen(str.c_str())); + return true; + } +diff --git a/src/kml/base/string_util.cc b/src/kml/base/string_util.cc +index b3a9654..842f1cd 100644 +--- a/src/kml/base/string_util.cc ++++ b/src/kml/base/string_util.cc +@@ -113,7 +113,7 @@ bool StringEndsWith(const string& str, const string& end) { + } + + bool StringCaseEqual(const string& a, const string& b) { +-#ifdef WIN32 ++#if defined(WIN32) && !defined(__MINGW32__) + # define strncasecmp(s1, s2, n) _strnicmp (s1, s2, n) + #endif + return a.size() == b.size() && strncasecmp(a.data(), b.data(), a.size()) == 0; diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index ce54b1c7e39eed..e2461c8cdffe6a 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -6,6 +6,7 @@ vcpkg_from_github( HEAD_REF master PATCHES patch_empty_literal_on_vc.patch + fix-mingw.patch ) file(REMOVE ${SOURCE_PATH}/cmake/External_boost.cmake) diff --git a/ports/libkml/vcpkg.json b/ports/libkml/vcpkg.json index fa70197a25326d..8d547b216e6d8f 100644 --- a/ports/libkml/vcpkg.json +++ b/ports/libkml/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libkml", "version-string": "1.3.0", - "port-version": 8, + "port-version": 9, "description": "Reference implementation of OGC KML 2.2", "homepage": "https://github.com/libkml/libkml", "dependencies": [ From 08f21285b994bd51d7682b78a10509229df1abfb Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 21 Sep 2022 08:39:48 +0200 Subject: [PATCH 06/20] [libkml] Modernize --- ports/libkml/portfile.cmake | 32 +++++++++++++++++--------------- ports/libkml/vcpkg.json | 11 ++++++++++- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index e2461c8cdffe6a..cb736f85a19672 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -9,24 +9,26 @@ vcpkg_from_github( fix-mingw.patch ) -file(REMOVE ${SOURCE_PATH}/cmake/External_boost.cmake) +file(REMOVE + "${SOURCE_PATH}/cmake/External_boost.cmake" + "${SOURCE_PATH}/cmake/External_expat.cmake" + "${SOURCE_PATH}/cmake/External_minizip.cmake" + "${SOURCE_PATH}/cmake/External_uriparser.cmake" + "${SOURCE_PATH}/cmake/External_zlib.cmake" +) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" ) -vcpkg_install_cmake() +vcpkg_cmake_install() vcpkg_copy_pdbs() - -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_fixup_cmake_targets(CONFIG_PATH cmake) -elseif (VCPKG_TARGET_IS_LINUX) - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libkml) -elseif (VCPKG_TARGET_IS_OSX) - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libkml) +vcpkg_fixup_pkgconfig() +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_cmake_config_fixup(CONFIG_PATH cmake) +else() + vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libkml) endif() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) -vcpkg_fixup_pkgconfig() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/libkml/vcpkg.json b/ports/libkml/vcpkg.json index 8d547b216e6d8f..898f12ef565316 100644 --- a/ports/libkml/vcpkg.json +++ b/ports/libkml/vcpkg.json @@ -1,9 +1,10 @@ { "name": "libkml", - "version-string": "1.3.0", + "version": "1.3.0", "port-version": 9, "description": "Reference implementation of OGC KML 2.2", "homepage": "https://github.com/libkml/libkml", + "license": "BSD-3-Clause", "dependencies": [ "boost-smart-ptr", "expat", @@ -14,6 +15,14 @@ ] }, "uriparser", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + }, "zlib" ] } From 40eedb61f02eb1a0a2b72d0a75a2578c42085509 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 21 Sep 2022 08:32:55 +0200 Subject: [PATCH 07/20] [libkml] Fix minizip dependency --- ports/libkml/fix-minizip.patch | 72 ++++++++++++++++++++++++++++++++++ ports/libkml/portfile.cmake | 2 + ports/libkml/vcpkg.json | 7 +--- 3 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 ports/libkml/fix-minizip.patch diff --git a/ports/libkml/fix-minizip.patch b/ports/libkml/fix-minizip.patch new file mode 100644 index 00000000000000..358f664a3974e7 --- /dev/null +++ b/ports/libkml/fix-minizip.patch @@ -0,0 +1,72 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9728ead..028f50a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -110,9 +110,9 @@ else() + list(APPEND MINIZIP_DEPENDS ZLIB) + endif() + +-find_package(MiniZip) ++find_package(MINIZIP NAMES minizip REQUIRED) + if(MINIZIP_FOUND) +- include_directories(${MINIZIP_INCLUDE_DIR}) ++ set(MINIZIP_LIBRARY minizip::minizip) + else() + include(External_minizip) + list(APPEND KMLBASE_DEPENDS MINIZIP) +diff --git a/cmake/LibKMLConfig.cmake.in b/cmake/LibKMLConfig.cmake.in +index 3e295f4..97826df 100644 +--- a/cmake/LibKMLConfig.cmake.in ++++ b/cmake/LibKMLConfig.cmake.in +@@ -1,3 +1,6 @@ ++include(CMakeFindDependencyMacro) ++find_dependency(minizip CONFIG) ++ + # Compute paths + get_filename_component(LIBKML_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + +diff --git a/src/kml/base/contrib/minizip/iomem_simple.c b/src/kml/base/contrib/minizip/iomem_simple.c +index be89226..6be61d5 100644 +--- a/src/kml/base/contrib/minizip/iomem_simple.c ++++ b/src/kml/base/contrib/minizip/iomem_simple.c +@@ -219,7 +219,7 @@ int ZCALLBACK mem_error (opaque, stream) + return 0; + } + +-ZEXTERN void* ZEXPORT mem_simple_create_file(zlib_filefunc_def* api, void* buffer, size_t buf_len) ++extern void* mem_simple_create_file(zlib_filefunc_def* api, void* buffer, size_t buf_len) + { + MEMFILE* handle = malloc(sizeof(*handle)); + api->zopen_file = NULL; +diff --git a/src/kml/base/contrib/minizip/iomem_simple.h b/src/kml/base/contrib/minizip/iomem_simple.h +index ec11396..515e24e 100644 +--- a/src/kml/base/contrib/minizip/iomem_simple.h ++++ b/src/kml/base/contrib/minizip/iomem_simple.h +@@ -70,7 +70,7 @@ void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + * This declaration is from the proposed iomem_simple package found at + * http://code.trak.dk. See iomem_simple.c + */ +-extern void* ZEXPORT mem_simple_create_file(zlib_filefunc_def* pzlib_filefunc_def, void* buffer, size_t buflen); ++extern void* mem_simple_create_file(zlib_filefunc_def* pzlib_filefunc_def, void* buffer, size_t buflen); + + #ifdef __cplusplus + } +diff --git a/src/kml/base/contrib/minizip/unzip.c b/src/kml/base/contrib/minizip/unzip.c +index a062863..fb69189 100644 +--- a/src/kml/base/contrib/minizip/unzip.c ++++ b/src/kml/base/contrib/minizip/unzip.c +@@ -43,6 +43,14 @@ woven in by Terry Thorsen 1/2003. + #include "unzip.h" + #include "iomem_simple.h" + #undef NOUNCRYPT ++#ifdef ZEXPORT ++# undef ZEXPORT ++#endif ++#define ZEXPORT ++#ifdef ZEXTERN ++# undef ZEXTERN ++#endif ++#define ZEXTERN extern + + #ifdef STDC + # include diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index cb736f85a19672..dac5d18646a427 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES patch_empty_literal_on_vc.patch fix-mingw.patch + fix-minizip.patch ) file(REMOVE @@ -15,6 +16,7 @@ file(REMOVE "${SOURCE_PATH}/cmake/External_minizip.cmake" "${SOURCE_PATH}/cmake/External_uriparser.cmake" "${SOURCE_PATH}/cmake/External_zlib.cmake" + "${SOURCE_PATH}/src/kml/base/contrib/minizip/ioapi.h" ) vcpkg_cmake_configure( diff --git a/ports/libkml/vcpkg.json b/ports/libkml/vcpkg.json index 898f12ef565316..8a7c9c661ba188 100644 --- a/ports/libkml/vcpkg.json +++ b/ports/libkml/vcpkg.json @@ -8,12 +8,7 @@ "dependencies": [ "boost-smart-ptr", "expat", - { - "name": "minizip", - "features": [ - "bzip2" - ] - }, + "minizip", "uriparser", { "name": "vcpkg-cmake", From ea0afa5cead8dffe10a2f8981c3d2bb14f9a2ccb Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 22 Sep 2022 08:34:52 +0200 Subject: [PATCH 08/20] [libkml] No DLL --- ports/libkml/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/libkml/portfile.cmake b/ports/libkml/portfile.cmake index dac5d18646a427..4019646c3d5f5f 100644 --- a/ports/libkml/portfile.cmake +++ b/ports/libkml/portfile.cmake @@ -1,3 +1,7 @@ +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) +endif() + vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO libkml/libkml From 6f20678a6c67c29a8bfc2746ecc96b8bef98bf86 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 22 Sep 2022 08:35:56 +0200 Subject: [PATCH 09/20] Update versions --- versions/baseline.json | 2 +- versions/l-/libkml.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/versions/baseline.json b/versions/baseline.json index 29567bab015ef5..2baf0d7a0e4622 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3834,7 +3834,7 @@ }, "libkml": { "baseline": "1.3.0", - "port-version": 8 + "port-version": 9 }, "liblas": { "baseline": "1.8.1", diff --git a/versions/l-/libkml.json b/versions/l-/libkml.json index 8b24a120d2d2bf..eaefdcf205fbd8 100644 --- a/versions/l-/libkml.json +++ b/versions/l-/libkml.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "a7dd78cc82d23ce2b380202547eaeb0b11340bb9", + "version": "1.3.0", + "port-version": 9 + }, { "git-tree": "1ce9dd050baf9ae42da2bb0c6d0feae1241b6e01", "version-string": "1.3.0", From d24783000f81ec29f84f0d8b90894c96a82e4585 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 23 Sep 2022 20:31:19 +0200 Subject: [PATCH 10/20] [libkml] Update mingw patch --- ports/libkml/fix-mingw.patch | 65 +++++++++--------------------------- 1 file changed, 16 insertions(+), 49 deletions(-) diff --git a/ports/libkml/fix-mingw.patch b/ports/libkml/fix-mingw.patch index 324acbcd70c81b..32a2a80fda9fe8 100644 --- a/ports/libkml/fix-mingw.patch +++ b/ports/libkml/fix-mingw.patch @@ -1,8 +1,22 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 028f50a..bb63ffb 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -26,6 +26,9 @@ set(LIBKML_DATA_DIR ${CMAKE_SOURCE_DIR}/testdata CACHE "Directory containing te + if(CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-unused-parameter -pedantic -fno-rtti") + set(TEST_FLAGS "-Wall -Wextra -Wno-unused-parameter -fno-rtti -DGTEST_HAS_RTTI=0") ++if(WIN32) ++ add_definitions(-DUNICODE -D_UNICODE) ++endif() + + else() + if(MSVC) diff --git a/src/kml/base/file_win32.cc b/src/kml/base/file_win32.cc -index 28ccb36..794f2bb 100644 +index 28ccb36..6ba79cd 100644 --- a/src/kml/base/file_win32.cc +++ b/src/kml/base/file_win32.cc -@@ -34,11 +34,14 @@ +@@ -34,7 +34,9 @@ #include "kml/base/file.h" #include #include @@ -12,53 +26,6 @@ index 28ccb36..794f2bb 100644 #include namespace kmlbase { - -+#ifndef __MINGW32__ - // Internal to the win32 file class. We need a conversion from string to - // LPCWSTR. - static std::wstring Str2Wstr(const string& str) { -@@ -56,12 +59,17 @@ string Wstr2Str(const std::wstring& wstr) { - static_cast(s), NULL, NULL); - return str; - } -+#endif - - bool File::Exists(const string& full_path) { - if (full_path.empty()) { - return false; - } -+#ifndef __MINGW32__ - std::wstring wstr = Str2Wstr(full_path); -+#else -+ auto wstr = full_path; -+#endif - DWORD attrs = ::GetFileAttributes(wstr.c_str()); - return (attrs != INVALID_FILE_ATTRIBUTES) && - ((attrs & FILE_ATTRIBUTE_DIRECTORY) == 0); -@@ -71,7 +79,11 @@ bool File::Delete(const string& filepath) { - if (filepath.empty()) { - return false; - } -+#ifndef __MINGW32__ - std::wstring wstr = Str2Wstr(filepath); -+#else -+ auto wstr = filepath; -+#endif - return ::DeleteFile(wstr.c_str()) ? true : false; - } - -@@ -97,7 +109,11 @@ bool File::CreateNewTempFile(string* path) { - if (uRetVal == 0) { - return false; - } -+#ifndef __MINGW32__ - string str = Wstr2Str(szTempName); -+#else -+ auto str = std::string(szTempName); -+#endif - path->assign(str.c_str(), strlen(str.c_str())); - return true; - } diff --git a/src/kml/base/string_util.cc b/src/kml/base/string_util.cc index b3a9654..842f1cd 100644 --- a/src/kml/base/string_util.cc From fc3a0583a1ffaefd1bfe7f300266d13e77ee1274 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 23 Sep 2022 20:32:05 +0200 Subject: [PATCH 11/20] Update versions --- versions/l-/libkml.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/l-/libkml.json b/versions/l-/libkml.json index eaefdcf205fbd8..5797ff9428b39e 100644 --- a/versions/l-/libkml.json +++ b/versions/l-/libkml.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "a7dd78cc82d23ce2b380202547eaeb0b11340bb9", + "git-tree": "9941e66029546372544fed13066e9a9756981dd3", "version": "1.3.0", "port-version": 9 }, From 771e5612ea83f9abc1aa20ff3903ff37abcd072b Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 1 Oct 2022 07:18:12 +0200 Subject: [PATCH 12/20] Update versions --- versions/baseline.json | 8 ++++---- versions/l-/libkml.json | 5 +++++ versions/m-/minizip.json | 5 +++++ versions/z-/zlib.json | 5 +++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index c46d44f525bbe2..0c8358f684d7f0 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3838,7 +3838,7 @@ }, "libkml": { "baseline": "1.3.0", - "port-version": 8 + "port-version": 9 }, "liblas": { "baseline": "1.8.1", @@ -4769,8 +4769,8 @@ "port-version": 1 }, "minizip": { - "baseline": "1.2.11", - "port-version": 11 + "baseline": "1.2.12", + "port-version": 0 }, "minizip-ng": { "baseline": "3.0.5", @@ -8070,7 +8070,7 @@ }, "zlib": { "baseline": "1.2.12", - "port-version": 2 + "port-version": 3 }, "zlib-ng": { "baseline": "2.0.6", diff --git a/versions/l-/libkml.json b/versions/l-/libkml.json index 8b24a120d2d2bf..5797ff9428b39e 100644 --- a/versions/l-/libkml.json +++ b/versions/l-/libkml.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "9941e66029546372544fed13066e9a9756981dd3", + "version": "1.3.0", + "port-version": 9 + }, { "git-tree": "1ce9dd050baf9ae42da2bb0c6d0feae1241b6e01", "version-string": "1.3.0", diff --git a/versions/m-/minizip.json b/versions/m-/minizip.json index 9c1239b4e68bcf..c85a7b5507c245 100644 --- a/versions/m-/minizip.json +++ b/versions/m-/minizip.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "65a32bfac58033a215e271db94d5e022fce816e3", + "version-semver": "1.2.12", + "port-version": 0 + }, { "git-tree": "528703ed8d2b78aeaa55695765535efafa24540b", "version-semver": "1.2.11", diff --git a/versions/z-/zlib.json b/versions/z-/zlib.json index 8d4707112548cd..d8c8d32b906cdf 100644 --- a/versions/z-/zlib.json +++ b/versions/z-/zlib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "360460dfafbc70cd7339ca895191f184f629fab0", + "version": "1.2.12", + "port-version": 3 + }, { "git-tree": "d40d86865ecbcc5b54d21f840dd2212556aeadd5", "version": "1.2.12", From a872c9f36e031005586c03dc76db4c503ef82ec7 Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Thu, 13 Oct 2022 18:50:54 -0700 Subject: [PATCH 13/20] [zlib] Update to 1.2.13 This picks up the official fix for CVE-2022-37434. --- ports/zlib/0002-skip-building-examples.patch | 17 +++++ ...0003-build-static-or-shared-not-both.patch | 49 ++++++++++++ ...tch => 0004-android-and-mingw-fixes.patch} | 23 ++++-- ports/zlib/CVE-2022-37434.patch | 17 ----- .../cmake_dont_build_more_than_needed.patch | 74 ------------------- ports/zlib/debug-postfix-mingw.patch | 13 ---- ports/zlib/portfile.cmake | 12 ++- ports/zlib/vcpkg.json | 3 +- versions/baseline.json | 4 +- versions/z-/zlib.json | 5 ++ 10 files changed, 96 insertions(+), 121 deletions(-) create mode 100644 ports/zlib/0002-skip-building-examples.patch create mode 100644 ports/zlib/0003-build-static-or-shared-not-both.patch rename ports/zlib/{0002-android-build-mingw.patch => 0004-android-and-mingw-fixes.patch} (52%) delete mode 100644 ports/zlib/CVE-2022-37434.patch delete mode 100644 ports/zlib/cmake_dont_build_more_than_needed.patch delete mode 100644 ports/zlib/debug-postfix-mingw.patch diff --git a/ports/zlib/0002-skip-building-examples.patch b/ports/zlib/0002-skip-building-examples.patch new file mode 100644 index 00000000000000..8183f2ab20b0d2 --- /dev/null +++ b/ports/zlib/0002-skip-building-examples.patch @@ -0,0 +1,17 @@ +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 new file mode 100644 index 00000000000000..b38e4213e254c9 --- /dev/null +++ b/ports/zlib/0003-build-static-or-shared-not-both.patch @@ -0,0 +1,49 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f46c8e6..29508ae 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,11 +146,12 @@ 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(MINGW) ++ endif() + +-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}) + set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + set_target_properties(zlib PROPERTIES SOVERSION 1) + +@@ -165,7 +168,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 +178,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/0002-android-build-mingw.patch b/ports/zlib/0004-android-and-mingw-fixes.patch similarity index 52% rename from ports/zlib/0002-android-build-mingw.patch rename to ports/zlib/0004-android-and-mingw-fixes.patch index 188499df0b758b..9acc9a5f8dfc20 100644 --- a/ports/zlib/0002-android-build-mingw.patch +++ b/ports/zlib/0004-android-and-mingw-fixes.patch @@ -1,7 +1,17 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt (date 1618364429263) -+++ b/CMakeLists.txt (date 1618364429263) -@@ -170,7 +170,7 @@ +index 29508ae..4223676 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}) @@ -10,11 +20,12 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt # This gets us DLL resource information when compiling on MinGW. if(NOT CMAKE_RC_COMPILER) set(CMAKE_RC_COMPILER windres.exe) -@@ -186,7 +186,7 @@ +@@ -148,8 +148,8 @@ if(MINGW) + -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) if(BUILD_SHARED_LIBS) - set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) - endif() + set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) -endif(MINGW) + endif() +endif(MINGW AND NOT ANDROID) add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) diff --git a/ports/zlib/CVE-2022-37434.patch b/ports/zlib/CVE-2022-37434.patch deleted file mode 100644 index 65cab9519b8ecd..00000000000000 --- a/ports/zlib/CVE-2022-37434.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/inflate.c b/inflate.c -index 7be8c6366..7a7289749 100644 ---- a/inflate.c -+++ b/inflate.c -@@ -763,9 +763,10 @@ int flush; - copy = state->length; - if (copy > have) copy = have; - if (copy) { - if (state->head != Z_NULL && -- state->head->extra != Z_NULL) { -- len = state->head->extra_len - state->length; -+ state->head->extra != Z_NULL && -+ (len = state->head->extra_len - state->length) < -+ state->head->extra_max) { - zmemcpy(state->head->extra + len, next, - len + copy > state->head->extra_max ? - state->head->extra_max - len : copy); diff --git a/ports/zlib/cmake_dont_build_more_than_needed.patch b/ports/zlib/cmake_dont_build_more_than_needed.patch deleted file mode 100644 index ed073e0410500c..00000000000000 --- a/ports/zlib/cmake_dont_build_more_than_needed.patch +++ /dev/null @@ -1,74 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0fe939d..a1291d5 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -7,6 +7,7 @@ set(VERSION "1.2.12") - - option(ASM686 "Enable building i686 assembly implementation") - option(AMD64 "Enable building amd64 assembly implementation") -+option(SKIP_BUILD_EXAMPLES "Skip build of the examples" OFF) - - set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables") - set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") -@@ -124,9 +125,11 @@ set(ZLIB_SRCS - ) - - if(NOT MINGW) -- set(ZLIB_DLL_SRCS -- win32/zlib1.rc # If present will override custom build rule below. -- ) -+ if(BUILD_SHARED_LIBS) -+ set(ZLIB_DLL_SRCS -+ win32/zlib1.rc # If present will override custom build rule below. -+ ) -+ endif() - endif() - - if(CMAKE_COMPILER_IS_GNUCC) -@@ -180,11 +183,12 @@ if(MINGW) - -I ${CMAKE_CURRENT_BINARY_DIR} - -o ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj - -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) -- set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) -+ if(BUILD_SHARED_LIBS) -+ set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) -+ endif() - endif(MINGW) - --add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) --add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) -+add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) - set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) - set_target_properties(zlib PROPERTIES SOVERSION 1) - -@@ -201,7 +205,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() -@@ -211,7 +215,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}" ) -@@ -230,6 +234,7 @@ endif() - # Example binaries - #============================================================================ - -+if (NOT SKIP_BUILD_EXAMPLES) - add_executable(example test/example.c) - target_link_libraries(example zlib) - add_test(example example) -@@ -247,3 +252,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/debug-postfix-mingw.patch b/ports/zlib/debug-postfix-mingw.patch deleted file mode 100644 index 22172ccfcaaef0..00000000000000 --- a/ports/zlib/debug-postfix-mingw.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 0fe939d..e4fc213 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -59,7 +59,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) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 4e48b9ec7c4a68..0356dc277af046 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,15 +1,14 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO madler/zlib - REF v1.2.12 - SHA512 5b029532a9f5f12ad425c12eccdf1b77c8d91801342c5b5e26ffb539f76a204e6c4882b40f0130f143f2cd38df90e90af2978cf4bb997e1fa3a0d1eff2ca979e + REF v1.2.13 + SHA512 44b834fbfb50cca229209b8dbe1f96b258f19a49f5df23b80970b716371d856a4adf525edb4c6e0e645b180ea949cb90f5365a1d896160f297f56794dd888659 HEAD_REF master PATCHES - cmake_dont_build_more_than_needed.patch 0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch - debug-postfix-mingw.patch - 0002-android-build-mingw.patch - CVE-2022-37434.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 @@ -19,7 +18,6 @@ vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DSKIP_INSTALL_FILES=ON - -DSKIP_BUILD_EXAMPLES=ON OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON ) diff --git a/ports/zlib/vcpkg.json b/ports/zlib/vcpkg.json index 8dccdf32db8954..7ef1f29d8ed9e5 100644 --- a/ports/zlib/vcpkg.json +++ b/ports/zlib/vcpkg.json @@ -1,7 +1,6 @@ { "name": "zlib", - "version": "1.2.12", - "port-version": 2, + "version": "1.2.13", "description": "A compression library", "homepage": "https://www.zlib.net/", "license": "Zlib", diff --git a/versions/baseline.json b/versions/baseline.json index e0f71bffa86fd4..058a80e91e5e0a 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8117,8 +8117,8 @@ "port-version": 2 }, "zlib": { - "baseline": "1.2.12", - "port-version": 2 + "baseline": "1.2.13", + "port-version": 0 }, "zlib-ng": { "baseline": "2.0.6", diff --git a/versions/z-/zlib.json b/versions/z-/zlib.json index 8d4707112548cd..c2fc75ca673149 100644 --- a/versions/z-/zlib.json +++ b/versions/z-/zlib.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "07912b97a86d765f8a526ff4c65c9a3a68c574ef", + "version": "1.2.13", + "port-version": 0 + }, { "git-tree": "d40d86865ecbcc5b54d21f840dd2212556aeadd5", "version": "1.2.12", From 93e0378093edbe9173587ad8f33a78fb579b4d49 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Tue, 18 Oct 2022 19:16:36 -0700 Subject: [PATCH 14/20] Cherry pick installing the correct license from https://github.com/microsoft/vcpkg/pull/27242/ --- ports/zlib/portfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 0356dc277af046..b4d9b1862f49c0 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -43,4 +43,4 @@ vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -file(INSTALL "${SOURCE_PATH}/README" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) From 93275de0a21a97a4b6e969dd03ca8be780d0091d Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 19 Oct 2022 11:47:35 -0700 Subject: [PATCH 15/20] Update version database. --- versions/z-/zlib.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/z-/zlib.json b/versions/z-/zlib.json index c2fc75ca673149..cd1a7b1141e76e 100644 --- a/versions/z-/zlib.json +++ b/versions/z-/zlib.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "07912b97a86d765f8a526ff4c65c9a3a68c574ef", + "git-tree": "7d1df6d59f386f1877f5327a63c0065fa990580c", "version": "1.2.13", "port-version": 0 }, From e425680f996ee2a9079afcb81b155e354e92f990 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 19 Oct 2022 11:50:10 -0700 Subject: [PATCH 16/20] More version database. --- versions/baseline.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/versions/baseline.json b/versions/baseline.json index fed4e1bc4bb3fb..f97326c9f6285c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3870,7 +3870,7 @@ }, "libkml": { "baseline": "1.3.0", - "port-version": 8 + "port-version": 9 }, "liblas": { "baseline": "1.8.1", @@ -4825,8 +4825,8 @@ "port-version": 1 }, "minizip": { - "baseline": "1.2.11", - "port-version": 11 + "baseline": "1.2.12", + "port-version": 0 }, "minizip-ng": { "baseline": "3.0.7", From ec159dcc314a8ed2e873cc180e8cf5ef98ca93ba Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 19 Oct 2022 12:12:21 -0700 Subject: [PATCH 17/20] Also update minizip. --- ports/minizip/0004-define.patch | 13 ------------- ports/minizip/CMakeLists.txt | 2 +- ports/minizip/portfile.cmake | 8 +++++--- ports/minizip/usage | 5 +++++ ports/minizip/vcpkg.json | 2 +- ports/zlib/portfile.cmake | 1 + versions/baseline.json | 2 +- versions/m-/minizip.json | 5 +++++ versions/z-/zlib.json | 2 +- 9 files changed, 20 insertions(+), 20 deletions(-) delete mode 100644 ports/minizip/0004-define.patch create mode 100644 ports/minizip/usage diff --git a/ports/minizip/0004-define.patch b/ports/minizip/0004-define.patch deleted file mode 100644 index f7bf5ff6f0883d..00000000000000 --- a/ports/minizip/0004-define.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/contrib/minizip/iowin32.c b/contrib/minizip/iowin32.c -index 274f39eb1..9736fbb0f 100644 ---- a/contrib/minizip/iowin32.c -+++ b/contrib/minizip/iowin32.c -@@ -27,7 +27,7 @@ - - - // see Include/shared/winapifamily.h in the Windows Kit --#if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API))) -+#if defined(WINAPI_FAMILY_ONE_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API))) - #if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP) - #define IOWIN32_USING_WINRT_API 1 - #endif diff --git a/ports/minizip/CMakeLists.txt b/ports/minizip/CMakeLists.txt index c03a906865a228..313450b96294bf 100644 --- a/ports/minizip/CMakeLists.txt +++ b/ports/minizip/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.8) -project(minizip VERSION 1.2.12 LANGUAGES C) +project(minizip VERSION 1.2.13 LANGUAGES C) if(MSVC) add_compile_options(/W3 /wd4005 /wd4996 /wd4018 -D_CRT_SECURE_NO_WARNINGS) diff --git a/ports/minizip/portfile.cmake b/ports/minizip/portfile.cmake index 236d2c1b2cccad..b929116f53a9e7 100644 --- a/ports/minizip/portfile.cmake +++ b/ports/minizip/portfile.cmake @@ -1,16 +1,17 @@ +# When this port is updated, the minizip port should be updated at the same time + vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO madler/zlib - REF v1.2.12 - SHA512 5b029532a9f5f12ad425c12eccdf1b77c8d91801342c5b5e26ffb539f76a204e6c4882b40f0130f143f2cd38df90e90af2978cf4bb997e1fa3a0d1eff2ca979e + REF v1.2.13 + SHA512 44b834fbfb50cca229209b8dbe1f96b258f19a49f5df23b80970b716371d856a4adf525edb4c6e0e645b180ea949cb90f5365a1d896160f297f56794dd888659 HEAD_REF master PATCHES 0001-remove-ifndef-NOUNCRYPT.patch 0002-add-declaration-for-mkdir.patch 0003-no-io64.patch - 0004-define.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS @@ -44,4 +45,5 @@ if ("bzip2" IN_LIST FEATURES) endforeach() endif() +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") file(INSTALL "${SOURCE_PATH}/contrib/minizip/MiniZip64_info.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/minizip/usage b/ports/minizip/usage new file mode 100644 index 00000000000000..c956c456ff0232 --- /dev/null +++ b/ports/minizip/usage @@ -0,0 +1,5 @@ +minizip provides CMake targets: + + # this is heuristically generated, and may not be correct + find_package(minizip CONFIG REQUIRED) + target_link_libraries(main PRIVATE minizip::minizip) diff --git a/ports/minizip/vcpkg.json b/ports/minizip/vcpkg.json index 65251ace8dd0ad..89f610ccccff40 100644 --- a/ports/minizip/vcpkg.json +++ b/ports/minizip/vcpkg.json @@ -1,6 +1,6 @@ { "name": "minizip", - "version-semver": "1.2.12", + "version-semver": "1.2.13", "description": "Zip compression library", "homepage": "https://github.com/madler/zlib", "license": "Zlib", diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index 9b56d1cffca873..450cb2c1915b25 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -1,3 +1,4 @@ +# 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 diff --git a/versions/baseline.json b/versions/baseline.json index f97326c9f6285c..de8854fa5a4a00 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4825,7 +4825,7 @@ "port-version": 1 }, "minizip": { - "baseline": "1.2.12", + "baseline": "1.2.13", "port-version": 0 }, "minizip-ng": { diff --git a/versions/m-/minizip.json b/versions/m-/minizip.json index c85a7b5507c245..d7149def5af998 100644 --- a/versions/m-/minizip.json +++ b/versions/m-/minizip.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "fc35e06f29486c07eae391d67499fe12d2309a9d", + "version-semver": "1.2.13", + "port-version": 0 + }, { "git-tree": "65a32bfac58033a215e271db94d5e022fce816e3", "version-semver": "1.2.12", diff --git a/versions/z-/zlib.json b/versions/z-/zlib.json index cd1a7b1141e76e..4671e3237ef53f 100644 --- a/versions/z-/zlib.json +++ b/versions/z-/zlib.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "7d1df6d59f386f1877f5327a63c0065fa990580c", + "git-tree": "589021dc60e14a9f729cf88a12ab984b5f97513c", "version": "1.2.13", "port-version": 0 }, From f0e26a52aa64f0e92393441348d1e7e8e4ff99cc Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 19 Oct 2022 13:47:27 -0700 Subject: [PATCH 18/20] Also guard ZLIB_DLL properties for BUILD_SHARED_LIBS. --- .../0003-build-static-or-shared-not-both.patch | 14 +++++++++----- ports/zlib/0004-android-and-mingw-fixes.patch | 9 ++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ports/zlib/0003-build-static-or-shared-not-both.patch b/ports/zlib/0003-build-static-or-shared-not-both.patch index b38e4213e254c9..c9f2ecf19762e8 100644 --- a/ports/zlib/0003-build-static-or-shared-not-both.patch +++ b/ports/zlib/0003-build-static-or-shared-not-both.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index f46c8e6..29508ae 100644 +index f46c8e6..6fa5575 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,9 +121,11 @@ set(ZLIB_SRCS @@ -14,22 +14,26 @@ index f46c8e6..29508ae 100644 endif() # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION -@@ -144,11 +146,12 @@ if(MINGW) +@@ -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(MINGW) + 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() -@@ -165,7 +168,7 @@ 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 @@ -38,7 +42,7 @@ index f46c8e6..29508ae 100644 if(NOT APPLE) set_target_properties(zlib PROPERTIES LINK_FLAGS "-Wl,--version-script,\"${CMAKE_CURRENT_SOURCE_DIR}/zlib.map\"") endif() -@@ -175,7 +178,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) +@@ -175,7 +180,7 @@ elseif(BUILD_SHARED_LIBS AND WIN32) endif() if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) diff --git a/ports/zlib/0004-android-and-mingw-fixes.patch b/ports/zlib/0004-android-and-mingw-fixes.patch index 9acc9a5f8dfc20..e93173f24618b8 100644 --- a/ports/zlib/0004-android-and-mingw-fixes.patch +++ b/ports/zlib/0004-android-and-mingw-fixes.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 29508ae..4223676 100644 +index 6fa5575..7c345db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,7 +56,7 @@ endif() @@ -20,13 +20,12 @@ index 29508ae..4223676 100644 # This gets us DLL resource information when compiling on MinGW. if(NOT CMAKE_RC_COMPILER) set(CMAKE_RC_COMPILER windres.exe) -@@ -148,8 +148,8 @@ if(MINGW) - -i ${CMAKE_CURRENT_SOURCE_DIR}/win32/zlib1.rc) +@@ -149,7 +149,7 @@ if(MINGW) if(BUILD_SHARED_LIBS) set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj) --endif(MINGW) endif() +-endif(MINGW) +endif(MINGW AND NOT ANDROID) add_library(zlib ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS}) - set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL) + if (BUILD_SHARED_LIBS) From 1f558213d7de91c406ccaa8af099909140cac3a0 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 19 Oct 2022 13:47:58 -0700 Subject: [PATCH 19/20] Version database. --- versions/z-/zlib.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/z-/zlib.json b/versions/z-/zlib.json index 4671e3237ef53f..9528646a6ed8d1 100644 --- a/versions/z-/zlib.json +++ b/versions/z-/zlib.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "589021dc60e14a9f729cf88a12ab984b5f97513c", + "git-tree": "ad5a49006f73b45b715299515f31164131b51982", "version": "1.2.13", "port-version": 0 }, From 1e5f96d3d19888a01997b7669b394387ccc095ba Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 19 Oct 2022 13:49:38 -0700 Subject: [PATCH 20/20] Fix minizip usage. --- ports/minizip/usage | 1 - versions/m-/minizip.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ports/minizip/usage b/ports/minizip/usage index c956c456ff0232..38a6340661d627 100644 --- a/ports/minizip/usage +++ b/ports/minizip/usage @@ -1,5 +1,4 @@ minizip provides CMake targets: - # this is heuristically generated, and may not be correct find_package(minizip CONFIG REQUIRED) target_link_libraries(main PRIVATE minizip::minizip) diff --git a/versions/m-/minizip.json b/versions/m-/minizip.json index d7149def5af998..55c880d4d8b114 100644 --- a/versions/m-/minizip.json +++ b/versions/m-/minizip.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "fc35e06f29486c07eae391d67499fe12d2309a9d", + "git-tree": "c0843dcfad42a538a772797a3f50627b5c8d411a", "version-semver": "1.2.13", "port-version": 0 },