From dfef30a737068335a509b605ac7ef14b704e29bd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 11 Dec 2023 10:02:35 +0100 Subject: [PATCH] subprojects: add curl --- android/build.py | 1 - meson.build | 30 ++++++++++++++++ python/build/libs.py | 35 ------------------- .../no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch | 13 ------- src/lib/curl/patches/no_netrc.patch | 20 ----------- src/lib/curl/patches/series | 2 -- subprojects/.gitignore | 1 + subprojects/curl.wrap | 13 +++++++ win32/build.py | 1 - 9 files changed, 44 insertions(+), 72 deletions(-) delete mode 100644 src/lib/curl/patches/no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch delete mode 100644 src/lib/curl/patches/no_netrc.patch delete mode 100644 src/lib/curl/patches/series create mode 100644 subprojects/curl.wrap diff --git a/android/build.py b/android/build.py index 0216bc064..0babb3ad2 100755 --- a/android/build.py +++ b/android/build.py @@ -38,7 +38,6 @@ thirdparty_libs = [ gme, ffmpeg, openssl, - curl, libnfs, ] diff --git a/meson.build b/meson.build index 9e196e268..acd18de34 100644 --- a/meson.build +++ b/meson.build @@ -12,6 +12,7 @@ project( # If we build those libraries as Meson subproject, they shall be # linked statically into the MPD executable. + 'curl:default_library=static', 'expat:default_library=static', 'flac:default_library=static', 'fmt:default_library=static', @@ -23,6 +24,8 @@ project( 'vorbis:default_library=static', # Not interested in compiler warnings from subprojects. + 'curl:werror=false', + 'curl:warning_level=0', 'expat:werror=false', 'expat:warning_level=0', 'flac:werror=false', @@ -38,6 +41,33 @@ project( 'vorbis:warning_level=0', # Disable subprojects features we don't need + 'curl:tool=disabled', + 'curl:tests=disabled', + 'curl:unittests=disabled', + 'curl:brotli=disabled', + 'curl:cookies=disabled', + 'curl:progress-meter=disabled', + 'curl:zstd=disabled', + 'curl:kerberos-auth=disabled', + 'curl:negotiate-auth=disabled', + 'curl:gss-api=disabled', + 'curl:ntlm=disabled', + 'curl:ssh=disabled', + 'curl:dict=disabled', + 'curl:file=disabled', + 'curl:ftp=disabled', + 'curl:gopher=disabled', + 'curl:imap=disabled', + 'curl:ldap=disabled', + 'curl:ldaps=disabled', + 'curl:mqtt=disabled', + 'curl:pop3=disabled', + 'curl:rtmp=disabled', + 'curl:rtsp=disabled', + 'curl:smb=disabled', + 'curl:smtp=disabled', + 'curl:telnet=disabled', + 'curl:tftp=disabled', 'opus:docs=disabled', 'opus:extra-programs=disabled', 'opus:tests=disabled', diff --git a/python/build/libs.py b/python/build/libs.py index 451d52ef7..a05ef112c 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -578,41 +578,6 @@ openssl = OpenSSLProject( 'include/openssl/ossl_typ.h', ) -curl = CmakeProject( - ('https://curl.se/download/curl-8.4.0.tar.xz', - 'https://github.com/curl/curl/releases/download/curl-8_4_0/curl-8.4.0.tar.xz'), - '16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d', - 'lib/libcurl.a', - [ - '-DBUILD_CURL_EXE=OFF', - '-DBUILD_SHARED_LIBS=OFF', - '-DCURL_DISABLE_LDAP=ON', - '-DCURL_DISABLE_TELNET=ON', - '-DCURL_DISABLE_DICT=ON', - '-DCURL_DISABLE_FILE=ON', - '-DCURL_DISABLE_FTP=ON', - '-DCURL_DISABLE_TFTP=ON', - '-DCURL_DISABLE_LDAPS=ON', - '-DCURL_DISABLE_RTSP=ON', - '-DCURL_DISABLE_PROXY=ON', - '-DCURL_DISABLE_POP3=ON', - '-DCURL_DISABLE_IMAP=ON', - '-DCURL_DISABLE_SMTP=ON', - '-DCURL_DISABLE_GOPHER=ON', - '-DCURL_DISABLE_COOKIES=ON', - '-DCURL_DISABLE_CRYPTO_AUTH=ON', - '-DCURL_DISABLE_ALTSVC=ON', - '-DCMAKE_USE_LIBSSH2=OFF', - '-DCURL_WINDOWS_SSPI=OFF', - '-DCURL_DISABLE_NTLM=ON', - '-DBUILD_TESTING=OFF', - ], - windows_configure_args=[ - '-DCURL_USE_SCHANNEL=ON', - ], - patches='src/lib/curl/patches', -) - libnfs = AutotoolsProject( 'https://github.com/sahlberg/libnfs/archive/libnfs-5.0.2.tar.gz', '637e56643b19da9fba98f06847788c4dad308b723156a64748041035dcdf9bd3', diff --git a/src/lib/curl/patches/no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch b/src/lib/curl/patches/no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch deleted file mode 100644 index dfa126374..000000000 --- a/src/lib/curl/patches/no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: curl-7.84.0/CMakeLists.txt -=================================================================== ---- curl-7.84.0.orig/CMakeLists.txt -+++ curl-7.84.0/CMakeLists.txt -@@ -1536,7 +1536,7 @@ set(includedir "\${prefix}/ - set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") - set(LIBCURL_LIBS "") - set(libdir "${CMAKE_INSTALL_PREFIX}/lib") --foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS}) -+foreach(_lib ${CURL_LIBS}) - if(TARGET "${_lib}") - set(_libname "${_lib}") - get_target_property(_imported "${_libname}" IMPORTED) diff --git a/src/lib/curl/patches/no_netrc.patch b/src/lib/curl/patches/no_netrc.patch deleted file mode 100644 index 35b83b621..000000000 --- a/src/lib/curl/patches/no_netrc.patch +++ /dev/null @@ -1,20 +0,0 @@ -Index: curl-7.84.0/lib/url.c -=================================================================== ---- curl-7.84.0.orig/lib/url.c -+++ curl-7.84.0/lib/url.c -@@ -3003,6 +3003,7 @@ static CURLcode override_login(struct Cu - - #ifndef CURL_DISABLE_NETRC - conn->bits.netrc = FALSE; -+#ifndef __BIONIC__ - if(data->set.use_netrc && !data->set.str[STRING_USERNAME]) { - bool netrc_user_changed = FALSE; - bool netrc_passwd_changed = FALSE; -@@ -3079,6 +3080,7 @@ static CURLcode override_login(struct Cu - return CURLE_OUT_OF_MEMORY; - } - } -+#endif - - return CURLE_OK; - } diff --git a/src/lib/curl/patches/series b/src/lib/curl/patches/series deleted file mode 100644 index 979436b3c..000000000 --- a/src/lib/curl/patches/series +++ /dev/null @@ -1,2 +0,0 @@ -no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch -no_netrc.patch diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 655b5b70b..d2bddb08b 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -1,5 +1,6 @@ /packagecache/ +/curl-*/ /expat-*/ /flac-*/ /fmt-*/ diff --git a/subprojects/curl.wrap b/subprojects/curl.wrap new file mode 100644 index 000000000..81d347cbb --- /dev/null +++ b/subprojects/curl.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = curl-8.5.0 +source_url = https://github.com/curl/curl/releases/download/curl-8_5_0/curl-8.5.0.tar.xz +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/curl_8.5.0-1/curl-8.5.0.tar.xz +source_filename = curl-8.5.0.tar.xz +source_hash = 42ab8db9e20d8290a3b633e7fbb3cec15db34df65fd1015ef8ac1e4723750eeb +patch_filename = curl_8.5.0-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/curl_8.5.0-1/get_patch +patch_hash = cd7b3a1944a7a0e2004a04c8901e3a3dabf87fed939db824bcd4b831acd808a9 +wrapdb_version = 8.5.0-1 + +[provide] +dependency_names = libcurl diff --git a/win32/build.py b/win32/build.py index 64e3fdf0f..2c02c58f3 100755 --- a/win32/build.py +++ b/win32/build.py @@ -47,7 +47,6 @@ thirdparty_libs = [ wildmidi, gme, ffmpeg, - curl, libnfs, libsamplerate, ]