blob: c6654bbad6d489eb71cccf5238113aa260c37aec [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "Command line tool and library for client-side URL transfers"
2DESCRIPTION = "It uses URL syntax to transfer data to and from servers. \
3curl is a widely used because of its ability to be flexible and complete \
4complex tasks. For example, you can use curl for things like user authentication, \
5HTTP post, SSL connections, proxy support, FTP uploads, and more!"
6HOMEPAGE = "https://curl.se/"
7BUGTRACKER = "https://github.com/curl/curl/issues"
8SECTION = "console/network"
9LICENSE = "curl"
Patrick Williams73bd93f2024-02-20 08:07:48 -060010LIC_FILES_CHKSUM = "file://COPYING;md5=eed2e5088e1ac619c9a1c747da291d75"
Andrew Geissler517393d2023-01-13 08:55:19 -060011
12SRC_URI = " \
13 https://curl.se/download/${BP}.tar.xz \
14 file://run-ptest \
15 file://disable-tests \
Patrick Williams03514f12024-04-05 07:04:11 -050016 file://no-test-timeout.patch \
Andrew Geissler517393d2023-01-13 08:55:19 -060017"
Patrick Williams44b3caf2024-04-12 16:51:14 -050018SRC_URI[sha256sum] = "6fea2aac6a4610fbd0400afb0bcddbe7258a64c63f1f68e5855ebc0c659710cd"
Andrew Geissler517393d2023-01-13 08:55:19 -060019
20# Curl has used many names over the years...
21CVE_PRODUCT = "haxx:curl haxx:libcurl curl:curl curl:libcurl libcurl:libcurl daniel_stenberg:curl"
22
23inherit autotools pkgconfig binconfig multilib_header ptest
24
25# Entropy source for random PACKAGECONFIG option
26RANDOM ?= "/dev/urandom"
27
Andrew Geissler220dafd2023-10-04 10:18:08 -050028PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} aws basic-auth bearer-auth digest-auth negotiate-auth libidn openssl proxy random threaded-resolver verbose zlib"
Andrew Geissler517393d2023-01-13 08:55:19 -060029PACKAGECONFIG:class-native = "ipv6 openssl proxy random threaded-resolver verbose zlib"
30PACKAGECONFIG:class-nativesdk = "ipv6 openssl proxy random threaded-resolver verbose zlib"
31
32# 'ares' and 'threaded-resolver' are mutually exclusive
33PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares,,,threaded-resolver"
Andrew Geissler220dafd2023-10-04 10:18:08 -050034PACKAGECONFIG[aws] = "--enable-aws,--disable-aws"
35PACKAGECONFIG[basic-auth] = "--enable-basic-auth,--disable-basic-auth"
36PACKAGECONFIG[bearer-auth] = "--enable-bearer-auth,--disable-bearer-auth"
Andrew Geissler517393d2023-01-13 08:55:19 -060037PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli"
38PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual"
39# Don't use this in production
40PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
41PACKAGECONFIG[dict] = "--enable-dict,--disable-dict,"
Andrew Geissler220dafd2023-10-04 10:18:08 -050042PACKAGECONFIG[digest-auth] = "--enable-digest-auth,--disable-digest-auth"
Andrew Geissler517393d2023-01-13 08:55:19 -060043PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
44PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher,"
45PACKAGECONFIG[imap] = "--enable-imap,--disable-imap,"
46PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Andrew Geissler220dafd2023-10-04 10:18:08 -050047PACKAGECONFIG[kerberos-auth] = "--enable-kerberos-auth,--disable-kerberos-auth"
Andrew Geissler517393d2023-01-13 08:55:19 -060048PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5"
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060049PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap"
50PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,openldap"
Andrew Geissler517393d2023-01-13 08:55:19 -060051PACKAGECONFIG[libgsasl] = "--with-libgsasl,--without-libgsasl,libgsasl"
52PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2"
53PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
54PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls"
55PACKAGECONFIG[mqtt] = "--enable-mqtt,--disable-mqtt,"
Andrew Geissler220dafd2023-10-04 10:18:08 -050056PACKAGECONFIG[negotiate-auth] = "--enable-negotiate-auth,--disable-negotiate-auth"
Andrew Geissler517393d2023-01-13 08:55:19 -060057PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2"
58PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
59PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3,"
60PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy,"
61PACKAGECONFIG[random] = "--with-random=${RANDOM},--without-random"
62PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump"
63PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp,"
64PACKAGECONFIG[smb] = "--enable-smb,--disable-smb,"
65PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp,"
Andrew Geissler517393d2023-01-13 08:55:19 -060066PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet,"
67PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp,"
68PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver,,,,ares"
69PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose"
70PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
71PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
72
73EXTRA_OECONF = " \
74 --disable-libcurl-option \
75 --disable-ntlm-wb \
Andrew Geissler517393d2023-01-13 08:55:19 -060076 --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
77 --without-libpsl \
78 --enable-optimize \
Andrew Geissler220dafd2023-10-04 10:18:08 -050079 ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls openssl', d) == '') else ''} \
Andrew Geissler517393d2023-01-13 08:55:19 -060080"
81
Patrick Williams03514f12024-04-05 07:04:11 -050082fix_absolute_paths () {
Andrew Geissler517393d2023-01-13 08:55:19 -060083 # cleanup buildpaths from curl-config
84 sed -i \
85 -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
86 -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \
87 -e 's|${DEBUG_PREFIX_MAP}||g' \
88 -e 's|${@" ".join(d.getVar("DEBUG_PREFIX_MAP").split())}||g' \
89 ${D}${bindir}/curl-config
90}
91
Patrick Williams03514f12024-04-05 07:04:11 -050092do_install:append:class-target() {
93 fix_absolute_paths
94}
95
96do_install:append:class-nativesdk() {
97 fix_absolute_paths
98}
99
Andrew Geissler517393d2023-01-13 08:55:19 -0600100do_compile_ptest() {
Andrew Geissler220dafd2023-10-04 10:18:08 -0500101 oe_runmake -C ${B}/tests
Andrew Geissler517393d2023-01-13 08:55:19 -0600102}
103
104do_install_ptest() {
105 cat ${WORKDIR}/disable-tests >> ${S}/tests/data/DISABLED
106 rm -f ${B}/tests/configurehelp.pm
107 cp -rf ${B}/tests ${D}${PTEST_PATH}
Andrew Geissler220dafd2023-10-04 10:18:08 -0500108 rm -f ${D}${PTEST_PATH}/tests/libtest/.libs/libhostname.la
109 rm -f ${D}${PTEST_PATH}/tests/libtest/libhostname.la
110 mv ${D}${PTEST_PATH}/tests/libtest/.libs/* ${D}${PTEST_PATH}/tests/libtest/
111 mv ${D}${PTEST_PATH}/tests/libtest/libhostname.so ${D}${PTEST_PATH}/tests/libtest/.libs/
112 mv ${D}${PTEST_PATH}/tests/http/clients/.libs/* ${D}${PTEST_PATH}/tests/http/clients/
Andrew Geissler517393d2023-01-13 08:55:19 -0600113 cp -rf ${S}/tests ${D}${PTEST_PATH}
114 find ${D}${PTEST_PATH}/ -type f -name Makefile.am -o -name Makefile.in -o -name Makefile -delete
115 install -d ${D}${PTEST_PATH}/src
116 ln -sf ${bindir}/curl ${D}${PTEST_PATH}/src/curl
117 cp -rf ${D}${bindir}/curl-config ${D}${PTEST_PATH}
118}
119
Patrick Williams2a254922023-08-11 09:48:11 -0500120RDEPENDS:${PN}-ptest += " \
121 bash \
122 perl-module-b \
123 perl-module-base \
124 perl-module-cwd \
125 perl-module-digest \
126 perl-module-digest-md5 \
127 perl-module-file-basename \
128 perl-module-file-spec \
129 perl-module-file-temp \
130 perl-module-io-socket \
131 perl-module-ipc-open2 \
132 perl-module-list-util \
133 perl-module-memoize \
134 perl-module-storable \
135 perl-module-time-hires \
136"
Patrick Williams03514f12024-04-05 07:04:11 -0500137RDEPENDS:${PN}-ptest:append:libc-glibc = " locale-base-en-us"
Andrew Geissler517393d2023-01-13 08:55:19 -0600138
139PACKAGES =+ "lib${BPN}"
140
141FILES:lib${BPN} = "${libdir}/lib*.so.*"
142RRECOMMENDS:lib${BPN} += "ca-certificates"
143
144FILES:${PN} += "${datadir}/zsh"
145
146inherit multilib_script
147MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config"
148
149BBCLASSEXTEND = "native nativesdk"