From 0413c73fd738350d1a91af1cd234b274541be1eb Mon Sep 17 00:00:00 2001 From: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Date: Mon, 13 May 2019 17:57:55 +0200 Subject: [PATCH] [CURL] Remove unnecessary renaming. (#6386) * removed unnecessary renaming. CMake updated its module file for FindCURL. so the renaming is not required anymore. * bump control * fix curl in static builds * fix gdal regression * fix typo * fixed alignment * fix libideviceactivation regression * fix idevicerestore regression --- ports/curl/CONTROL | 2 +- ports/curl/portfile.cmake | 34 +++-------------- ports/gdal/CONTROL | 2 +- ports/gdal/portfile.cmake | 14 +++++-- ports/idevicerestore/CONTROL | 2 +- ports/idevicerestore/libcurl_d.patch | 23 +++++++++++ ports/idevicerestore/libcurl_imp.patch | 40 ++++++++++++++++++++ ports/idevicerestore/portfile.cmake | 12 ++++++ ports/libideviceactivation/CONTROL | 2 +- ports/libideviceactivation/libcurl_d.patch | 22 +++++++++++ ports/libideviceactivation/libcurl_imp.patch | 40 ++++++++++++++++++++ ports/libideviceactivation/portfile.cmake | 12 ++++++ 12 files changed, 170 insertions(+), 35 deletions(-) create mode 100644 ports/idevicerestore/libcurl_d.patch create mode 100644 ports/idevicerestore/libcurl_imp.patch create mode 100644 ports/libideviceactivation/libcurl_d.patch create mode 100644 ports/libideviceactivation/libcurl_imp.patch diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 37d1c89ec7..9d5dde10e1 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,5 +1,5 @@ Source: curl -Version: 7.61.1-6 +Version: 7.61.1-7 Build-Depends: zlib Description: A library for transferring data with URLs Default-Features: ssl diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index cbd2436418..745e2d241c 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -141,37 +141,15 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/curl${EXECUTABLE_SUFFIX}") endif() endif() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) - # Drop debug suffix, as FindCURL.cmake does not look for it - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/libcurl-d.lib") - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libcurl-d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libcurl.lib) - # Fixup libcurl-target-debug.cmake to match - file(READ "${CURRENT_PACKAGES_DIR}/share/curl/libcurl-target-debug.cmake" DEBUG_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/libcurl-d.lib" "\${_IMPORT_PREFIX}/debug/lib/libcurl.lib" DEBUG_MODULE "${DEBUG_MODULE}") - file(WRITE "${CURRENT_PACKAGES_DIR}/share/curl/libcurl-target-debug.cmake" "${DEBUG_MODULE}") - endif() -else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/curl-config ${CURRENT_PACKAGES_DIR}/debug/bin/curl-config) - if(EXISTS "${CURRENT_PACKAGES_DIR}/lib/libcurl_imp.lib") - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/libcurl_imp.lib ${CURRENT_PACKAGES_DIR}/lib/libcurl.lib) - # Fixup libcurl-target-release.cmake to match - file(READ "${CURRENT_PACKAGES_DIR}/share/curl/libcurl-target-release.cmake" RELEASE_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/lib/libcurl_imp.lib" "\${_IMPORT_PREFIX}/lib/libcurl.lib" RELEASE_MODULE "${RELEASE_MODULE}") - file(WRITE "${CURRENT_PACKAGES_DIR}/share/curl/libcurl-target-release.cmake" "${RELEASE_MODULE}") - endif() - if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/libcurl-d_imp.lib") - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/libcurl-d_imp.lib ${CURRENT_PACKAGES_DIR}/debug/lib/libcurl.lib) - # Fixup libcurl-target-debug.cmake to match - file(READ "${CURRENT_PACKAGES_DIR}/share/curl/libcurl-target-debug.cmake" DEBUG_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}/debug/lib/libcurl-d_imp.lib" "\${_IMPORT_PREFIX}/debug/lib/libcurl.lib" DEBUG_MODULE "${DEBUG_MODULE}") - file(WRITE "${CURRENT_PACKAGES_DIR}/share/curl/libcurl-target-debug.cmake" "${DEBUG_MODULE}") - endif() -endif() - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) 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) +else() + file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/curl-config ${CURRENT_PACKAGES_DIR}/debug/bin/curl-config) +endif() + file(READ ${CURRENT_PACKAGES_DIR}/include/curl/curl.h CURL_H) if(VCPKG_LIBRARY_LINKAGE STREQUAL static) string(REPLACE "#ifdef CURL_STATICLIB" "#if 1" CURL_H "${CURL_H}") diff --git a/ports/gdal/CONTROL b/ports/gdal/CONTROL index 155851ad8d..c0b8820b21 100644 --- a/ports/gdal/CONTROL +++ b/ports/gdal/CONTROL @@ -1,5 +1,5 @@ Source: gdal -Version: 2.4.1-4 +Version: 2.4.1-5 Description: The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data. Build-Depends: proj, libpng, geos, sqlite3, curl, expat, libpq, openjpeg, libwebp, libxml2, liblzma, netcdf-c, hdf5, zlib diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index ea3ce9dbfa..b880c91848 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -94,8 +94,16 @@ if (WIN32) # Build in WINDOWS # Setup curl libraries + include path file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" CURL_INCLUDE_DIR) - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libcurl.lib" CURL_LIBRARY_REL) - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libcurl.lib" CURL_LIBRARY_DBG) + if(EXISTS "${CURRENT_INSTALLED_DIR}/lib/libcurl.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libcurl.lib" CURL_LIBRARY_REL) + elseif(EXISTS "${CURRENT_INSTALLED_DIR}/lib/libcurl_imp.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libcurl_imp.lib" CURL_LIBRARY_REL) + endif() + if(EXISTS "${CURRENT_INSTALLED_DIR}/debug/lib/libcurl-d.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libcurl-d.lib" CURL_LIBRARY_DBG) + elseif(EXISTS "${CURRENT_INSTALLED_DIR}/debug/lib/libcurl-d_imp.lib") + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libcurl-d_imp.lib" CURL_LIBRARY_DBG) + endif() # Setup sqlite3 libraries + include path file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" SQLITE_INCLUDE_DIR) @@ -270,7 +278,7 @@ if (WIN32) # Build in WINDOWS if(NOT VCPKG_LIBRARY_LINKAGE STREQUAL "static") file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/share/gdal/html) endif() - + vcpkg_execute_required_process( COMMAND ${NMAKE} -f makefile.vc "${NMAKE_OPTIONS_REL}" diff --git a/ports/idevicerestore/CONTROL b/ports/idevicerestore/CONTROL index dc781eb5cc..36c31d97c9 100644 --- a/ports/idevicerestore/CONTROL +++ b/ports/idevicerestore/CONTROL @@ -1,4 +1,4 @@ Source: idevicerestore -Version: 1.0.12-1 +Version: 1.0.12-2 Description: Restore/upgrade firmware of iOS devices Build-Depends: libimobiledevice, curl, libirecovery, libzip \ No newline at end of file diff --git a/ports/idevicerestore/libcurl_d.patch b/ports/idevicerestore/libcurl_d.patch new file mode 100644 index 0000000000..1d9d3f3d7e --- /dev/null +++ b/ports/idevicerestore/libcurl_d.patch @@ -0,0 +1,23 @@ +diff --git a/idevicerestore.vcxproj b/idevicerestore.vcxproj +index fa209fae..cf89306b 100644 +--- a/idevicerestore.vcxproj ++++ b/idevicerestore.vcxproj +@@ -94,7 +94,7 @@ + _MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS + + +- kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl.lib;%(AdditionalDependencies) ++ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl-d.lib;%(AdditionalDependencies) + + + +@@ -105,7 +105,7 @@ + _MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS + + +- kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl.lib;%(AdditionalDependencies) ++ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl-d.lib;%(AdditionalDependencies) + + + + diff --git a/ports/idevicerestore/libcurl_imp.patch b/ports/idevicerestore/libcurl_imp.patch new file mode 100644 index 0000000000..f93dfb2b51 --- /dev/null +++ b/ports/idevicerestore/libcurl_imp.patch @@ -0,0 +1,40 @@ +diff --git a/idevicerestore.vcxproj b/idevicerestore.vcxproj +index fa209fae..cf89306b 100644 +--- a/idevicerestore.vcxproj ++++ b/idevicerestore.vcxproj +@@ -94,7 +94,7 @@ + _MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS + + +- kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl.lib;%(AdditionalDependencies) ++ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl-d_imp.lib;%(AdditionalDependencies) + + + +@@ -105,7 +105,7 @@ + _MBCS;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;WIN32;_WINSOCK_DEPRECATED_NO_WARNINGS + + +- kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl.lib;%(AdditionalDependencies) ++ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl-d_imp.lib;%(AdditionalDependencies) + + + +@@ -120,7 +120,7 @@ + + true + true +- kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl.lib;%(AdditionalDependencies) ++ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl_imp.lib;%(AdditionalDependencies) + + + +@@ -135,7 +135,7 @@ + + true + true +- kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl.lib;%(AdditionalDependencies) ++ kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;Ws2_32.lib;libcurl_imp.lib;%(AdditionalDependencies) + + + diff --git a/ports/idevicerestore/portfile.cmake b/ports/idevicerestore/portfile.cmake index e0f9a08883..271c249c62 100644 --- a/ports/idevicerestore/portfile.cmake +++ b/ports/idevicerestore/portfile.cmake @@ -8,6 +8,18 @@ vcpkg_from_github( HEAD_REF msvc-master ) +if(${VCPKG_LIBRARY_LINKAGE} MATCHES dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + libcurl_imp.patch) +else() + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + libcurl_d.patch) +endif() + vcpkg_install_msbuild( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH idevicerestore.vcxproj diff --git a/ports/libideviceactivation/CONTROL b/ports/libideviceactivation/CONTROL index 2d5e236619..d1bb06d0be 100644 --- a/ports/libideviceactivation/CONTROL +++ b/ports/libideviceactivation/CONTROL @@ -1,4 +1,4 @@ Source: libideviceactivation -Version: 1.0.38-1 +Version: 1.0.38-2 Description: A library to handle the activation process of iOS devices Build-Depends: libimobiledevice, libxml2, curl \ No newline at end of file diff --git a/ports/libideviceactivation/libcurl_d.patch b/ports/libideviceactivation/libcurl_d.patch new file mode 100644 index 0000000000..69f1bf53be --- /dev/null +++ b/ports/libideviceactivation/libcurl_d.patch @@ -0,0 +1,22 @@ +diff --git a/libideviceactivation.vcxproj b/libideviceactivation.vcxproj +index ba473f7a..47a20d15 100644 +--- a/libideviceactivation.vcxproj ++++ b/libideviceactivation.vcxproj +@@ -76,7 +76,7 @@ + $(OutDir)$(ProjectName).pdb + + +- libcurl.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) ++ libcurl-d.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + +@@ -89,7 +89,7 @@ + $(OutDir)$(ProjectName).pdb + + +- libcurl.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) ++ libcurl-d.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + diff --git a/ports/libideviceactivation/libcurl_imp.patch b/ports/libideviceactivation/libcurl_imp.patch new file mode 100644 index 0000000000..bf1bfefac9 --- /dev/null +++ b/ports/libideviceactivation/libcurl_imp.patch @@ -0,0 +1,40 @@ +diff --git a/libideviceactivation.vcxproj b/libideviceactivation.vcxproj +index ba473f7a..47a20d15 100644 +--- a/libideviceactivation.vcxproj ++++ b/libideviceactivation.vcxproj +@@ -76,7 +76,7 @@ + $(OutDir)$(ProjectName).pdb + + +- libcurl.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) ++ libcurl-d_imp.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + +@@ -89,7 +89,7 @@ + $(OutDir)$(ProjectName).pdb + + +- libcurl.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) ++ libcurl-d_imp.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + +@@ -106,7 +106,7 @@ + + true + true +- libcurl.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) ++ libcurl_imp.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + +@@ -123,7 +123,7 @@ + + true + true +- libcurl.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) ++ libcurl_imp.lib;libxml2.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + diff --git a/ports/libideviceactivation/portfile.cmake b/ports/libideviceactivation/portfile.cmake index 7a462834e4..1057c78e63 100644 --- a/ports/libideviceactivation/portfile.cmake +++ b/ports/libideviceactivation/portfile.cmake @@ -10,6 +10,18 @@ vcpkg_from_github( HEAD_REF msvc-master ) +if(${VCPKG_LIBRARY_LINKAGE} MATCHES dynamic) + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + libcurl_imp.patch) +else() + vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + libcurl_d.patch) +endif() + vcpkg_install_msbuild( SOURCE_PATH ${SOURCE_PATH} PROJECT_SUBPATH libideviceactivation.sln