From 6acf81d5ae9bebaa3fec9a5d9aadf6aaddc4965e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 20 Sep 2021 22:59:33 +0200 Subject: [PATCH] python/build/libs.py: build CURL with cmake --- python/build/libs.py | 51 ++++++++++--------- .../no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch | 11 ++++ src/lib/curl/patches/only_lib.patch | 15 ------ src/lib/curl/patches/series | 2 +- 4 files changed, 39 insertions(+), 40 deletions(-) create mode 100644 src/lib/curl/patches/no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch delete mode 100644 src/lib/curl/patches/only_lib.patch diff --git a/python/build/libs.py b/python/build/libs.py index 2ac2a90ba..23149ee6a 100644 --- a/python/build/libs.py +++ b/python/build/libs.py @@ -391,35 +391,38 @@ openssl = OpenSSLProject( 'include/openssl/ossl_typ.h', ) -curl = AutotoolsProject( +curl = CmakeProject( 'https://curl.se/download/curl-7.78.0.tar.xz', 'be42766d5664a739c3974ee3dfbbcbe978a4ccb1fe628bb1d9b59ac79e445fb5', 'lib/libcurl.a', [ - '--disable-shared', '--enable-static', - '--disable-debug', - '--enable-http', - '--enable-ipv6', - '--disable-ftp', '--disable-file', - '--disable-ldap', '--disable-ldaps', - '--disable-rtsp', '--disable-proxy', '--disable-dict', '--disable-telnet', - '--disable-tftp', '--disable-pop3', '--disable-imap', '--disable-smtp', - '--disable-smb', - '--disable-gopher', - '--disable-manual', - '--disable-threaded-resolver', '--disable-verbose', '--disable-sspi', - '--disable-crypto-auth', '--disable-ntlm-wb', '--disable-tls-srp', '--disable-cookies', - '--disable-doh', - '--disable-mime', - '--disable-netrc', - '--disable-progress-meter', - '--disable-alt-svc', - '--without-gnutls', '--without-nss', '--without-libssh2', - - # native Windows SSL/TLS support, option ignored on non-Windows builds - '--with-schannel', + '-DBUILD_CURL_EXE=OFF', + '-DBUILD_SHARED_LIBS=OFF', + '-DCURL_DISABLE_VERBOSE_STRINGS=ON', + '-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=[ + '-DCMAKE_USE_SCHANNEL=ON', ], - patches='src/lib/curl/patches', ) 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 new file mode 100644 index 000000000..d7d0ed678 --- /dev/null +++ b/src/lib/curl/patches/no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch @@ -0,0 +1,11 @@ +--- curl-7.75.0.orig/CMakeLists.txt 2021-02-02 09:26:24.000000000 +0100 ++++ curl-7.75.0/CMakeLists.txt 2021-03-25 20:17:25.445684029 +0100 +@@ -1453,7 +1453,7 @@ + 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(_libtype "${_libname}" TYPE) diff --git a/src/lib/curl/patches/only_lib.patch b/src/lib/curl/patches/only_lib.patch deleted file mode 100644 index 2bc374983..000000000 --- a/src/lib/curl/patches/only_lib.patch +++ /dev/null @@ -1,15 +0,0 @@ -Index: curl-7.58.0/Makefile.in -=================================================================== ---- curl-7.58.0.orig/Makefile.in -+++ curl-7.58.0/Makefile.in -@@ -641,8 +641,8 @@ CLEANFILES = $(VC6_LIBDSP) $(VC6_SRCDSP) - $(VC14_LIBVCXPROJ) $(VC14_SRCVCXPROJ) $(VC15_LIBVCXPROJ) $(VC15_SRCVCXPROJ) - - bin_SCRIPTS = curl-config --SUBDIRS = lib src --DIST_SUBDIRS = $(SUBDIRS) tests packages scripts include docs -+SUBDIRS = lib -+DIST_SUBDIRS = $(SUBDIRS) include - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = libcurl.pc - LIB_VAUTH_CFILES = vauth/vauth.c vauth/cleartext.c vauth/cram.c \ diff --git a/src/lib/curl/patches/series b/src/lib/curl/patches/series index f9bd7bfe3..979436b3c 100644 --- a/src/lib/curl/patches/series +++ b/src/lib/curl/patches/series @@ -1,2 +1,2 @@ -only_lib.patch +no_CMAKE_C_IMPLICIT_LINK_LIBRARIES.patch no_netrc.patch