diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2024-05-09 18:20:37 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-09 18:20:37 +1000 |
commit | effb1281ab949a73a267d758351616cafae21892 (patch) | |
tree | 1d1f09f248df7cc900ac68ccc8c5ec28239185b3 | |
parent | 196a2e4244743f3a28cd217af5d1176ebf4f1c2e (diff) | |
parent | 030e62a663ecf1d92e6eab160fd18fd332a1c43d (diff) | |
download | xbmc-effb1281ab949a73a267d758351616cafae21892.tar.xz |
Merge pull request #25115 from fuzzard/cmake_curl
[cmake] Migrate to cmake usage for curl and build for all platforms
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | cmake/modules/FindBrotli.cmake | 68 | ||||
-rw-r--r-- | cmake/modules/FindCurl.cmake | 252 | ||||
-rw-r--r-- | cmake/modules/FindNGHttp2.cmake | 52 | ||||
-rw-r--r-- | cmake/modules/FindTagLib.cmake | 2 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-win10-arm.list | 3 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-win10-win32.list | 3 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-win10-x64.list | 3 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-win32.list | 3 | ||||
-rw-r--r-- | project/BuildDependencies/scripts/0_package.target-x64.list | 3 | ||||
-rw-r--r-- | tools/depends/target/Makefile | 1 | ||||
-rw-r--r-- | tools/depends/target/curl/01-win-nghttp2-add-name.patch | 11 | ||||
-rw-r--r-- | tools/depends/target/curl/CURL-VERSION | 1 | ||||
-rw-r--r-- | tools/depends/target/curl/Makefile | 71 |
14 files changed, 371 insertions, 103 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 01acbbf3f2..1b4348f7a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -89,6 +89,7 @@ option(ENABLE_INTERNAL_FFMPEG "Enable internal ffmpeg?" OFF) # These are built for all platforms not using system libs or disabled by user dependent_option(ENABLE_INTERNAL_CEC "Enable internal libcec?") +dependent_option(ENABLE_INTERNAL_CURL "Enable internal libcurl?") dependent_option(ENABLE_INTERNAL_FLATBUFFERS "Enable internal flatbuffers?") dependent_option(ENABLE_INTERNAL_FMT "Enable internal fmt?") dependent_option(ENABLE_INTERNAL_NFS "Enable internal libnfs?") diff --git a/cmake/modules/FindBrotli.cmake b/cmake/modules/FindBrotli.cmake new file mode 100644 index 0000000000..3b8a0befc6 --- /dev/null +++ b/cmake/modules/FindBrotli.cmake @@ -0,0 +1,68 @@ +#.rst: +# FindBrotli +# ---------- +# Finds the Brotli library +# +# This will define the following target ALIAS: +# +# Brotli::Brotli - The Brotli library +# +# The following IMPORTED targets are made +# +# Brotli::BrotliCommon - The brotlicommon library +# Brotli::BrotliDec - The brotlidec library +# + +if(NOT TARGET Brotli::Brotli) + find_package(PkgConfig) + if(PKG_CONFIG_FOUND AND NOT (WIN32 OR WINDOWSSTORE)) + pkg_check_modules(BROTLICOMMON libbrotlicommon QUIET) + # First item is the full path of the library file found + # pkg_check_modules does not populate a variable of the found library explicitly + list(GET BROTLICOMMON_LINK_LIBRARIES 0 BROTLICOMMON_LIBRARY) + + pkg_check_modules(BROTLIDEC libbrotlidec QUIET) + # First item is the full path of the library file found + # pkg_check_modules does not populate a variable of the found library explicitly + list(GET BROTLIDEC_LINK_LIBRARIES 0 BROTLIDEC_LIBRARY) + + set(BROTLI_INCLUDE_DIR ${BROTLICOMMON_INCLUDEDIR}) + set(BROTLI_VERSION ${BROTLICOMMON_VERSION}) + else() + find_path(BROTLI_INCLUDE_DIR NAMES brotli/decode.h + HINTS ${DEPENDS_PATH}/include ${BROTLICOMMON_INCLUDEDIR} + ${${CORE_PLATFORM_LC}_SEARCH_CONFIG}) + find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon + HINTS ${DEPENDS_PATH}/lib ${BROTLICOMON_LIBDIR} + ${${CORE_PLATFORM_LC}_SEARCH_CONFIG}) + + find_library(BROTLIDEC_LIBRARY NAMES brotlidec + HINTS ${DEPENDS_PATH}/lib ${BROTLIDEC_LIBDIR} + ${${CORE_PLATFORM_LC}_SEARCH_CONFIG}) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Brotli + REQUIRED_VARS BROTLICOMMON_LIBRARY BROTLIDEC_LIBRARY BROTLI_INCLUDE_DIR + VERSION_VAR BROTLI_VERSION) + + if(BROTLI_FOUND) + add_library(Brotli::BrotliCommon UNKNOWN IMPORTED) + set_target_properties(Brotli::BrotliCommon PROPERTIES + IMPORTED_LOCATION "${BROTLICOMMON_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIR}") + + add_library(Brotli::BrotliDec UNKNOWN IMPORTED) + set_target_properties(Brotli::BrotliDec PROPERTIES + IMPORTED_LOCATION "${BROTLIDEC_LIBRARY}" + INTERFACE_LINK_LIBRARIES Brotli::BrotliCommon + INTERFACE_INCLUDE_DIRECTORIES "${BROTLI_INCLUDE_DIR}") + + add_library(Brotli::Brotli ALIAS Brotli::BrotliDec) + + else() + if(Brotli_FIND_REQUIRED) + message(FATAL_ERROR "Brotli libraries were not found.") + endif() + endif() +endif() diff --git a/cmake/modules/FindCurl.cmake b/cmake/modules/FindCurl.cmake index 3dc8bf0231..3872b9c64a 100644 --- a/cmake/modules/FindCurl.cmake +++ b/cmake/modules/FindCurl.cmake @@ -3,72 +3,220 @@ # -------- # Finds the Curl library # -# This will define the following variables:: -# -# CURL_FOUND - system has Curl -# CURL_INCLUDE_DIRS - the Curl include directory -# CURL_LIBRARIES - the Curl libraries -# CURL_DEFINITIONS - the Curl definitions -# -# and the following imported targets:: +# This will define the following target: # # Curl::Curl - The Curl library -find_package(PkgConfig) +if(NOT TARGET Curl::Curl) + include(cmake/scripts/common/ModuleHelpers.cmake) -if(PKG_CONFIG_FOUND) - pkg_check_modules(PC_CURL libcurl QUIET) -endif() + macro(buildCurl) + + find_package(NGHttp2 REQUIRED QUIET) + find_package(OpenSSL REQUIRED QUIET) + find_package(Brotli REQUIRED QUIET) + + # Darwin platforms link against toolchain provided zlib regardless + # They will fail when searching for static. All other platforms, prefer static + # if possible (requires cmake 3.24+ otherwise variable is a no-op) + # Windows still uses dynamic lib for zlib for other purposes, dont mix + if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" AND NOT (WIN32 OR WINDOWS_STORE)) + set(ZLIB_USE_STATIC_LIBS ON) + endif() + find_package(ZLIB REQUIRED) + unset(ZLIB_USE_STATIC_LIBS) -find_path(CURL_INCLUDE_DIR NAMES curl/curl.h - HINTS ${PC_CURL_INCLUDEDIR}) -find_library(CURL_LIBRARY NAMES curl libcurl libcurl_imp - HINTS ${PC_CURL_LIBDIR}) + set(CURL_VERSION ${${MODULE}_VER}) + # Curl debug uses postfix -d for all platforms + set(CURL_DEBUG_POSTFIX -d) -set(CURL_VERSION ${PC_CURL_VERSION}) + if(WIN32 OR WINDOWS_STORE) + set(CURL_C_FLAGS -DNGHTTP2_STATICLIB) + set(PLATFORM_LINK_LIBS crypt32.lib) + endif() -set(CURL_LIB_TYPE SHARED) -set(CURL_LDFLAGS ${PC_CURL_LDFLAGS}) + set(patches "${CORE_SOURCE_DIR}/tools/depends/target/${MODULE_LC}/01-win-nghttp2-add-name.patch") -# check if curl is statically linked -if(${CURL_LIBRARY} MATCHES ".+\.a$" AND PC_CURL_STATIC_LDFLAGS) - set(CURL_LIB_TYPE STATIC) - set(CURL_LDFLAGS ${PC_CURL_STATIC_LDFLAGS}) + generate_patchcommand("${patches}") - pkg_check_modules(PC_NGHTTP2 libnghttp2 QUIET) - find_library(NGHTTP2_LIBRARY NAMES libnghttp2 nghttp2 - HINTS ${PC_NGHTTP2_LIBDIR}) + set(CMAKE_ARGS -DBUILD_CURL_EXE=OFF + -DBUILD_SHARED_LIBS=OFF + -DBUILD_STATIC_LIBS=ON + -DBUILD_LIBCURL_DOCS=OFF + -DENABLE_CURL_MANUAL=OFF + -DCURL_DISABLE_TESTS=OFF + -DCURL_DISABLE_LDAP=ON + -DCURL_DISABLE_LDAPS=ON + -DCURL_DISABLE_SMB=OFF + -DCURL_USE_OPENSSL=ON + -DOPENSSL_ROOT_DIR=${DEPENDS_PATH} + -DCURL_BROTLI=ON + -DUSE_NGHTTP2=ON + -DUSE_LIBIDN2=OFF + -DCURL_USE_LIBSSH2=OFF + -DCURL_USE_GSSAPI=OFF + -DCURL_CA_FALLBACK=ON + ${OPTIONAL_ARGS}) - pkg_check_modules(PC_BROTLIDEC libbrotlidec QUIET) - find_library(BROTLIDEC_LIBRARY NAMES brotlidec - HINTS ${PC_BROTLIDEC_LIBDIR}) + BUILD_DEP_TARGET() - pkg_check_modules(PC_BROTLICOMMON libbrotlicommon QUIET) - find_library(BROTLICOMMON_LIBRARY NAMES brotlicommon - HINTS ${PC_BROTLICOMMON_LIBDIR}) - set(BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY}) + # Link libraries for target interface + set(PC_CURL_LINK_LIBRARIES Brotli::Brotli OpenSSL::Crypto OpenSSL::SSL NGHttp2::NGHttp2 ZLIB::ZLIB ${PLATFORM_LINK_LIBS}) -endif() + # Add dependencies to build target + add_dependencies(${MODULE_LC} NGHttp2::NGHttp2) + add_dependencies(${MODULE_LC} OpenSSL::SSL) + add_dependencies(${MODULE_LC} OpenSSL::Crypto) + add_dependencies(${MODULE_LC} ZLIB::ZLIB) + add_dependencies(${MODULE_LC} Brotli::Brotli) + endmacro() + + set(MODULE_LC curl) + + SETUP_BUILD_VARS() -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Curl - REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR - VERSION_VAR CURL_VERSION) - -if(CURL_FOUND) - set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) - set(CURL_LIBRARIES ${CURL_LIBRARY} ${NGHTTP2_LIBRARY} ${BROTLI_LIBRARIES}) - - if(NOT TARGET Curl::Curl) - add_library(Curl::Curl ${CURL_LIB_TYPE} IMPORTED) - set_target_properties(Curl::Curl PROPERTIES - IMPORTED_LOCATION "${CURL_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}") - if(HAS_CURL_STATIC) + find_package(CURL CONFIG QUIET + HINTS ${DEPENDS_PATH}/lib/cmake + ${${CORE_PLATFORM_NAME_LC}_SEARCH_CONFIG}) + + # Check for existing Curl. If version >= CURL-VERSION file version, dont build + # A corner case, but if a linux/freebsd user WANTS to build internal curl, build anyway + if((CURL_VERSION VERSION_LESS ${${MODULE}_VER} AND ENABLE_INTERNAL_CURL) OR + ((CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) AND ENABLE_INTERNAL_CURL)) + + buildCurl() + else() + # Maybe need to look explicitly for CURL::libcurl_static/shared? + if(NOT TARGET CURL::libcurl) + find_package(PkgConfig) + + # We only rely on pkgconfig for non windows platforms + if(PKG_CONFIG_FOUND AND NOT (WIN32 OR WINDOWS_STORE)) + pkg_check_modules(CURL libcurl QUIET) + + # First item is the full path of the library file found + # pkg_check_modules does not populate a variable of the found library explicitly + list(GET CURL_LINK_LIBRARIES 0 CURL_LIBRARY_RELEASE) + + # Add link libraries for static lib usage + if(${CURL_LIBRARY} MATCHES ".+\.a$" AND CURL_LINK_LIBRARIES) + # Remove duplicates + list(REMOVE_DUPLICATES CURL_LINK_LIBRARIES) + + # Remove own library - eg libcurl.a + list(FILTER CURL_LINK_LIBRARIES EXCLUDE REGEX ".*curl.*\.a$") + set(PC_CURL_LINK_LIBRARIES ${CURL_LINK_LIBRARIES}) + endif() + + # pkgconfig sets CURL_INCLUDEDIR, map this to our "standard" variable name + set(CURL_INCLUDE_DIR ${CURL_INCLUDEDIR}) + else() + find_path(CURL_INCLUDE_DIR NAMES curl/curl.h + HINTS ${DEPENDS_PATH}/include + ${${CORE_PLATFORM_LC}_SEARCH_CONFIG}) + find_library(CURL_LIBRARY_RELEASE NAMES curl libcurl libcurl_imp + HINTS ${DEPENDS_PATH}/lib + ${${CORE_PLATFORM_LC}_SEARCH_CONFIG}) + endif() + else() + # CURL::libcurl is an alias. We need to get the actual aias target, as we cant make an + # alias of an alias (ie our Curl::Curl cant be an alias of Curl::libcurl) + get_target_property(_CURL_ALIASTARGET CURL::libcurl ALIASED_TARGET) + + # This is for the case where a distro provides a non standard (Debug/Release) config type + # eg Debian's config file is CURLConfigTargets-none.cmake + # convert this back to either DEBUG/RELEASE or just RELEASE + # we only do this because we use find_package_handle_standard_args for config time output + # and it isnt capable of handling TARGETS, so we have to extract the info + get_target_property(_CURL_CONFIGURATIONS ${_CURL_ALIASTARGET} IMPORTED_CONFIGURATIONS) + foreach(_curl_config IN LISTS _CURL_CONFIGURATIONS) + # Some non standard config (eg None on Debian) + # Just set to RELEASE var so select_library_configurations can continue to work its magic + string(TOUPPER ${_curl_config} _curl_config_UPPER) + if((NOT ${_curl_config_UPPER} STREQUAL "RELEASE") AND + (NOT ${_curl_config_UPPER} STREQUAL "DEBUG")) + get_target_property(CURL_LIBRARY_RELEASE ${_CURL_ALIASTARGET} IMPORTED_LOCATION_${_curl_config_UPPER}) + else() + get_target_property(CURL_LIBRARY_${_curl_config_UPPER} ${_CURL_ALIASTARGET} IMPORTED_LOCATION_${_curl_config_UPPER}) + endif() + endforeach() + + get_target_property(CURL_INCLUDE_DIR CURL::libcurl INTERFACE_INCLUDE_DIRECTORIES) + endif() + endif() + + include(SelectLibraryConfigurations) + select_library_configurations(CURL) + unset(CURL_LIBRARIES) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Curl + REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR + VERSION_VAR CURL_VERSION) + + if(CURL_FOUND) + # cmake target and not building internal + if(TARGET CURL::libcurl AND NOT TARGET curl) + # CURL::libcurl is an alias. We need to get the actual aias target, as we cant make an + # alias of an alias (ie our Curl::Curl cant be an alias of Curl::libcurl) + if(NOT _CURL_ALIASTARGET) + get_target_property(_CURL_ALIASTARGET CURL::libcurl ALIASED_TARGET) + endif() + + add_library(Curl::Curl ALIAS ${_CURL_ALIASTARGET}) + else() + add_library(Curl::Curl UNKNOWN IMPORTED) + set_target_properties(Curl::Curl PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIR}") + + if(CURL_LIBRARY_RELEASE) + set_target_properties(Curl::Curl PROPERTIES + IMPORTED_CONFIGURATIONS RELEASE + IMPORTED_LOCATION_RELEASE "${CURL_LIBRARY_RELEASE}") + endif() + if(CURL_LIBRARY_DEBUG) set_target_properties(Curl::Curl PROPERTIES - INTERFACE_COMPILE_DEFINITIONS HAS_CURL_STATIC=1) + IMPORTED_CONFIGURATIONS DEBUG + IMPORTED_LOCATION_DEBUG "${CURL_LIBRARY_DEBUG}") + endif() + + # Add link libraries for static lib usage found from pkg-config + if(PC_CURL_LINK_LIBRARIES) + set_target_properties(Curl::Curl PROPERTIES + INTERFACE_LINK_LIBRARIES "${PC_CURL_LINK_LIBRARIES}") + endif() + + if(WIN32 OR WINDOWS_STORE) + set_property(TARGET Curl::Curl APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "CURL_STATICLIB") + endif() + + endif() + + if(TARGET curl) + add_dependencies(Curl::Curl curl) + endif() + + # Add internal build target when a Multi Config Generator is used + # We cant add a dependency based off a generator expression for targeted build types, + # https://gitlab.kitware.com/cmake/cmake/-/issues/19467 + # therefore if the find heuristics only find the library, we add the internal build + # target to the project to allow user to manually trigger for any build type they need + # in case only a specific build type is actually available (eg Release found, Debug Required) + # This is mainly targeted for windows who required different runtime libs for different + # types, and they arent compatible + if(_multiconfig_generator) + if(NOT TARGET curl) + buildCurl() + set_target_properties(curl PROPERTIES EXCLUDE_FROM_ALL TRUE) + endif() + add_dependencies(build_internal_depends curl) + endif() + + set_property(GLOBAL APPEND PROPERTY INTERNAL_DEPS_PROP Curl::Curl) + + else() + if(Curl_FIND_REQUIRED) + message(FATAL_ERROR "Curl libraries were not found.") endif() endif() endif() - -mark_as_advanced(CURL_INCLUDE_DIR CURL_LIBRARY CURL_LDFLAGS) diff --git a/cmake/modules/FindNGHttp2.cmake b/cmake/modules/FindNGHttp2.cmake new file mode 100644 index 0000000000..7dba36e0ed --- /dev/null +++ b/cmake/modules/FindNGHttp2.cmake @@ -0,0 +1,52 @@ +#.rst: +# FindNGHttp2 +# ---------- +# Finds the NGHttp2 library +# +# This will define the following target: +# +# NGHttp2::NGHttp2 - The NGHttp2 library + +if(NOT TARGET NGHttp2::NGHttp2) + find_package(PkgConfig) + if(PKG_CONFIG_FOUND AND NOT (WIN32 OR WINDOWSSTORE)) + pkg_check_modules(NGHTTP2 libnghttp2 QUIET) + + # First item is the full path of the library file found + # pkg_check_modules does not populate a variable of the found library explicitly + list(GET NGHTTP2_LINK_LIBRARIES 0 NGHTTP2_LIBRARY) + + set(NGHTTP2_INCLUDE_DIR ${NGHTTP2_INCLUDEDIR}) + else() + + find_path(NGHTTP2_INCLUDE_DIR NAMES nghttp2/nghttp2.h + HINTS ${DEPENDS_PATH}/include + ${${CORE_PLATFORM_LC}_SEARCH_CONFIG}) + find_library(NGHTTP2_LIBRARY NAMES nghttp2 nghttp2_static + HINTS ${DEPENDS_PATH}/lib + ${${CORE_PLATFORM_LC}_SEARCH_CONFIG}) + endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(NGHttp2 + REQUIRED_VARS NGHTTP2_LIBRARY NGHTTP2_INCLUDE_DIR + VERSION_VAR NGHTTP2_VERSION) + + if(NGHTTP2_FOUND) + add_library(NGHttp2::NGHttp2 UNKNOWN IMPORTED) + + set_target_properties(NGHttp2::NGHttp2 PROPERTIES + IMPORTED_LOCATION "${NGHTTP2_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${NGHTTP2_INCLUDE_DIR}") + + # Todo: for windows, do a find_package config call to retrieve this from the cmake config + # For now just explicitly say its a static build + if(WIN32 OR WINDOWS_STORE) + set_property(TARGET NGHttp2::NGHttp2 APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "NGHTTP2_STATICLIB") + endif() + else() + if(NGHttp2_FIND_REQUIRED) + message(FATAL_ERROR "NGHttp2 libraries were not found.") + endif() + endif() +endif() diff --git a/cmake/modules/FindTagLib.cmake b/cmake/modules/FindTagLib.cmake index 78a0eeeccb..1883d3fd9d 100644 --- a/cmake/modules/FindTagLib.cmake +++ b/cmake/modules/FindTagLib.cmake @@ -71,7 +71,7 @@ if(NOT TARGET TagLib::TagLib) # Build Taglib buildTagLib() else() - if(PKG_CONFIG_FOUND) + if(PKG_CONFIG_FOUND AND NOT (WIN32 OR WINDOWS_STORE)) if(TagLib_FIND_VERSION) if(TagLib_FIND_VERSION_EXACT) set(TagLib_FIND_SPEC "=${TagLib_FIND_VERSION_COMPLETE}") diff --git a/project/BuildDependencies/scripts/0_package.target-win10-arm.list b/project/BuildDependencies/scripts/0_package.target-win10-arm.list index a3490f9e16..04b5887b2a 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-arm.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-arm.list @@ -6,7 +6,7 @@ ; -> sqlite-3.7.12.1-arm\system\sqlite3.dll ; -> ... ;PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER! -curl-7.67.0-win10-arm-v141-20200105.7z +brotli-1.0.7-win10-arm-v141-20200105.7z dav1d-1.4.1-win10-arm-v142-20240331.7z freetype-2.10.1-win10-arm-v141-20200105.7z fstrcmp-0.7-win10-arm-v141-20200105.7z @@ -27,6 +27,7 @@ libxslt-1.1.34-win10-arm-v141-20200105.7z lzo2-2.10-win10-arm-v141-20200105.7z mariadb-connector-c-3.1.6-win10-arm-v141-20200105.7z miniwdk-10.0.17763-20200106.7z +nghttp2-1.40.0-win10-arm-v141-20200105.7z openssl-1.1.1q-win10-arm-v142-20221017.7z pillow-6.2.1-win10-arm-v142-20200803.7z pycryptodome-3.9.4-win10-arm-v142-20200803.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win10-win32.list b/project/BuildDependencies/scripts/0_package.target-win10-win32.list index fda954334d..bf72fde0c8 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-win32.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-win32.list @@ -6,7 +6,7 @@ ; -> sqlite-3.7.12.1-win32\system\sqlite3.dll ; -> ... ;PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER! -curl-7.67.0-win10-win32-v141-20200105.7z +brotli-1.0.7-win10-win32-v141-20200105.7z dav1d-1.4.1-win10-win32-v142-20240331.7z freetype-2.10.1-win10-win32-v141-20200105.7z fstrcmp-0.7-win10-win32-v141-20200105.7z @@ -27,6 +27,7 @@ libxslt-1.1.34-win10-win32-v141-20200105.7z lzo2-2.10-win10-win32-v141-20200105.7z mariadb-connector-c-3.1.6-win10-win32-v141-20200105.7z miniwdk-10.0.17763-20200106.7z +nghttp2-1.40.0-win10-win32-v141-20200105.7z openssl-1.1.1q-win10-win32-v142-20221017.7z pillow-6.2.1-win10-win32-v142-20200803.7z pycryptodome-3.9.4-win10-win32-v142-20200803.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win10-x64.list b/project/BuildDependencies/scripts/0_package.target-win10-x64.list index 2c2635be57..51312322d8 100644 --- a/project/BuildDependencies/scripts/0_package.target-win10-x64.list +++ b/project/BuildDependencies/scripts/0_package.target-win10-x64.list @@ -6,7 +6,7 @@ ; -> sqlite-3.7.12.1-win32\system\sqlite3.dll ; -> ... ;PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER! -curl-7.67.0-win10-x64-v141-20200105.7z +brotli-1.0.7-win10-x64-v141-20200105.7z dav1d-1.4.1-win10-x64-v142-20240331.7z freetype-2.10.1-win10-x64-v141-20200105.7z fstrcmp-0.7-win10-x64-v141-20200105.7z @@ -27,6 +27,7 @@ libxslt-1.1.34-win10-x64-v141-20200105.7z lzo2-2.10-win10-x64-v141-20200105.7z mariadb-connector-c-3.1.6-win10-x64-v141-20200105.7z miniwdk-10.0.17763-20200106.7z +nghttp2-1.40.0-win10-x64-v141-20200105.7z openssl-1.1.1q-win10-x64-v142-20221017.7z pillow-6.2.1-win10-x64-v142-20200803.7z pycryptodome-3.9.4-win10-x64-v142-20200803.7z diff --git a/project/BuildDependencies/scripts/0_package.target-win32.list b/project/BuildDependencies/scripts/0_package.target-win32.list index b0c882344d..9ac7f69e62 100644 --- a/project/BuildDependencies/scripts/0_package.target-win32.list +++ b/project/BuildDependencies/scripts/0_package.target-win32.list @@ -6,7 +6,7 @@ ; -> sqlite-3.7.12.1-win32\system\sqlite3.dll ; -> ... ;PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER! -curl-7.67.0-win32-v141-20200105.7z +brotli-1.0.7-win32-v141-20200105.7z dav1d-1.4.1-win32-v142-20240331.7z detours-64ec13-win32-v141-20200105.7z dnssd-878.260.1-win32-v141-20200105.7z @@ -33,6 +33,7 @@ libxslt-1.1.34-win32-v141-20200105.7z lzo2-2.10-win32-v141-20200105.7z mariadb-connector-c-3.1.6-win32-v141-20200105.7z miniwdk-10.0.17763-20200106.7z +nghttp2-1.40.0-win32-v141-20200105.7z openssl-1.1.1q-win10-win32-v142-20221017.7z pillow-6.2.1-win32-v142-20200803.7z pycryptodome-3.9.4-win32-v142-20200803.7z diff --git a/project/BuildDependencies/scripts/0_package.target-x64.list b/project/BuildDependencies/scripts/0_package.target-x64.list index 7ae89f8c4c..e396e54eb6 100644 --- a/project/BuildDependencies/scripts/0_package.target-x64.list +++ b/project/BuildDependencies/scripts/0_package.target-x64.list @@ -6,7 +6,7 @@ ; -> sqlite-3.7.12.1-win32\system\sqlite3.dll ; -> ... ;PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER! -curl-7.67.0-x64-v141-20200105.7z +brotli-1.0.7-x64-v141-20200105.7z dav1d-1.4.1-x64-v142-20240331.7z detours-64ec13-x64-v141-20200105.7z dnssd-878.260.1-x64-v141-20200105.7z @@ -30,6 +30,7 @@ libxslt-1.1.34-x64-v141-20200105.7z lzo2-2.10-x64-v141-20200105.7z mariadb-connector-c-3.1.6-x64-v141-20200105.7z miniwdk-10.0.17763-20200106.7z +nghttp2-1.40.0-x64-v141-20200105.7z openssl-1.1.1q-x64-v142-20221017.7z pillow-6.2.1-x64-v142-20200803.7z pycryptodome-3.9.4-x64-v142-20200803.7z diff --git a/tools/depends/target/Makefile b/tools/depends/target/Makefile index 11cdbb533b..e47e8bff26 100644 --- a/tools/depends/target/Makefile +++ b/tools/depends/target/Makefile @@ -8,7 +8,6 @@ endif DEPENDS = \ brotli \ bzip2 \ - curl \ dav1d \ expat \ ffmpeg \ diff --git a/tools/depends/target/curl/01-win-nghttp2-add-name.patch b/tools/depends/target/curl/01-win-nghttp2-add-name.patch new file mode 100644 index 0000000000..e07843010a --- /dev/null +++ b/tools/depends/target/curl/01-win-nghttp2-add-name.patch @@ -0,0 +1,11 @@ +--- a/CMake/FindNGHTTP2.cmake ++++ b/CMake/FindNGHTTP2.cmake +@@ -25,7 +25,7 @@ + + find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h") + +-find_library(NGHTTP2_LIBRARY NAMES nghttp2) ++find_library(NGHTTP2_LIBRARY NAMES nghttp2 nghttp2_static) + + find_package_handle_standard_args(NGHTTP2 + FOUND_VAR diff --git a/tools/depends/target/curl/CURL-VERSION b/tools/depends/target/curl/CURL-VERSION index 017b222e75..f9a42c2939 100644 --- a/tools/depends/target/curl/CURL-VERSION +++ b/tools/depends/target/curl/CURL-VERSION @@ -3,3 +3,4 @@ VERSION=8.7.1 ARCHIVE=$(LIBNAME)-$(VERSION).tar.xz SHA512=5bbde9d5648e9226f5490fa951690aaf159149345f3a315df2ba58b2468f3e59ca32e8a49734338afc861803a4f81caac6d642a4699b72c6310ebfb1f618aad2 BYPRODUCT=libcurl.a +BYPRODUCT_WIN=libcurl.lib diff --git a/tools/depends/target/curl/Makefile b/tools/depends/target/curl/Makefile index d4f002df3d..1b5a4c1ab2 100644 --- a/tools/depends/target/curl/Makefile +++ b/tools/depends/target/curl/Makefile @@ -1,65 +1,48 @@ include ../../Makefile.include CURL-VERSION ../../download-files.include DEPS = ../../Makefile.include Makefile CURL-VERSION ../../download-files.include -# configuration settings -CONFIGURE=cp -f $(CONFIG_SUB) $(CONFIG_GUESS) .; \ - ./configure --prefix=$(PREFIX) \ - --disable-shared \ - --disable-docs \ - --disable-ldap \ - --without-libssh2 \ - --disable-ntlm-wb \ - --enable-ipv6 \ - --without-librtmp \ - --without-libidn2 \ - --with-ca-fallback \ - --with-ssl=$(PREFIX) \ - --with-brotli=$(PREFIX) \ - --with-nghttp2=$(PREFIX) \ - --with-zlib \ - --without-libpsl \ - --without-zstd \ - --without-gssapi \ - --without-gsasl \ - --without-hyper \ - --without-ngtcp2 \ - --without-nghttp3 \ - --without-quiche \ - --without-msh3 \ - --without-gnutls \ - --without-nss \ - --without-mbedtls \ - --without-wolfssl - -LIBDYLIB=$(PLATFORM)/lib/.libs/$(BYPRODUCT) +CMAKE_OPTIONS=-DCMAKE_INSTALL_PREFIX=$(PREFIX) \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_CURL_EXE=OFF \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_STATIC_LIBS=ON \ + -DBUILD_LIBCURL_DOCS=OFF \ + -DENABLE_CURL_MANUAL=OFF \ + -DCURL_DISABLE_TESTS=OFF \ + -DCURL_DISABLE_LDAP=ON \ + -DCURL_DISABLE_LDAPS=ON \ + -DCURL_DISABLE_SMB=OFF \ + -DCURL_USE_OPENSSL=ON \ + -DOPENSSL_ROOT_DIR=$(PREFIX) \ + -DCURL_BROTLI=ON \ + -DUSE_NGHTTP2=ON \ + -DUSE_LIBIDN2=OFF \ + -DCURL_USE_LIBSSH2=OFF \ + -DCURL_USE_GSSAPI=OFF \ + -DCURL_CA_FALLBACK=ON + +LIBDYLIB=$(PLATFORM)/build/lib/$(BYPRODUCT) all: .installed-$(PLATFORM) $(PLATFORM): $(DEPS) | $(TARBALLS_LOCATION)/$(ARCHIVE).$(HASH_TYPE) - rm -rf $(PLATFORM)/*; mkdir -p $(PLATFORM) + rm -rf $(PLATFORM); mkdir -p $(PLATFORM)/build cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); $(AUTORECONF) -vif - cd $(PLATFORM); $(CONFIGURE) + cd $(PLATFORM)/build; $(CMAKE) ${CMAKE_OPTIONS} .. $(LIBDYLIB): $(PLATFORM) - $(MAKE) -C $(PLATFORM)/lib + $(MAKE) -C $(PLATFORM)/build .installed-$(PLATFORM): $(LIBDYLIB) - # install only libcurl and includes - $(MAKE) -C $(PLATFORM)/lib install - $(MAKE) -C $(PLATFORM)/include install - # make sure to also install libcurl.pc, we need to do - # this because we are selectively installing only libcurl - $(MAKE) -C $(PLATFORM) install-pkgconfigDATA + $(MAKE) -C $(PLATFORM)/build install touch $@ clean: - $(MAKE) -C $(PLATFORM) clean - rm -f .installed-$(PLATFORM) + rm -rf $(PLATFORM) .installed-$(PLATFORM) distclean:: rm -rf $(PLATFORM) .installed-$(PLATFORM) .PHONY: update-cacert update-cacert: $(PLATFORM) - $(PLATFORM)/lib/mk-ca-bundle.pl -u $(CMAKE_SOURCE_DIR)/system/certs/cacert.pem + $(PLATFORM)/scripts/mk-ca-bundle.pl -u $(CMAKE_SOURCE_DIR)/system/certs/cacert.pem |