blob: 5f97730bf4ccb78653564d854d68615617e8d00b [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"
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060010LIC_FILES_CHKSUM = "file://COPYING;md5=db8448a1e43eb2125f7740fc397db1f6"
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 \
16"
Andrew Geissler20137392023-10-12 04:59:14 -060017SRC_URI[sha256sum] = "16c62a9c4af0f703d28bda6d7bbf37ba47055ad3414d70dec63e2e6336f2a82d"
Andrew Geissler517393d2023-01-13 08:55:19 -060018
19# Curl has used many names over the years...
20CVE_PRODUCT = "haxx:curl haxx:libcurl curl:curl curl:libcurl libcurl:libcurl daniel_stenberg:curl"
21
22inherit autotools pkgconfig binconfig multilib_header ptest
23
24# Entropy source for random PACKAGECONFIG option
25RANDOM ?= "/dev/urandom"
26
Andrew Geissler220dafd2023-10-04 10:18:08 -050027PACKAGECONFIG ??= "${@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 -060028PACKAGECONFIG:class-native = "ipv6 openssl proxy random threaded-resolver verbose zlib"
29PACKAGECONFIG:class-nativesdk = "ipv6 openssl proxy random threaded-resolver verbose zlib"
30
31# 'ares' and 'threaded-resolver' are mutually exclusive
32PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares,,,threaded-resolver"
Andrew Geissler220dafd2023-10-04 10:18:08 -050033PACKAGECONFIG[aws] = "--enable-aws,--disable-aws"
34PACKAGECONFIG[basic-auth] = "--enable-basic-auth,--disable-basic-auth"
35PACKAGECONFIG[bearer-auth] = "--enable-bearer-auth,--disable-bearer-auth"
Andrew Geissler517393d2023-01-13 08:55:19 -060036PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli"
37PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual"
38# Don't use this in production
39PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
40PACKAGECONFIG[dict] = "--enable-dict,--disable-dict,"
Andrew Geissler220dafd2023-10-04 10:18:08 -050041PACKAGECONFIG[digest-auth] = "--enable-digest-auth,--disable-digest-auth"
Andrew Geissler517393d2023-01-13 08:55:19 -060042PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
43PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher,"
44PACKAGECONFIG[imap] = "--enable-imap,--disable-imap,"
45PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Andrew Geissler220dafd2023-10-04 10:18:08 -050046PACKAGECONFIG[kerberos-auth] = "--enable-kerberos-auth,--disable-kerberos-auth"
Andrew Geissler517393d2023-01-13 08:55:19 -060047PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5"
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060048PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap"
49PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,openldap"
Andrew Geissler517393d2023-01-13 08:55:19 -060050PACKAGECONFIG[libgsasl] = "--with-libgsasl,--without-libgsasl,libgsasl"
51PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2"
52PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
53PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls"
54PACKAGECONFIG[mqtt] = "--enable-mqtt,--disable-mqtt,"
Andrew Geissler220dafd2023-10-04 10:18:08 -050055PACKAGECONFIG[negotiate-auth] = "--enable-negotiate-auth,--disable-negotiate-auth"
Andrew Geissler517393d2023-01-13 08:55:19 -060056PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2"
57PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
58PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3,"
59PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy,"
60PACKAGECONFIG[random] = "--with-random=${RANDOM},--without-random"
61PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump"
62PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp,"
63PACKAGECONFIG[smb] = "--enable-smb,--disable-smb,"
64PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp,"
Andrew Geissler517393d2023-01-13 08:55:19 -060065PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet,"
66PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp,"
67PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver,,,,ares"
68PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose"
69PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
70PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
71
72EXTRA_OECONF = " \
73 --disable-libcurl-option \
74 --disable-ntlm-wb \
Andrew Geissler517393d2023-01-13 08:55:19 -060075 --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
76 --without-libpsl \
77 --enable-optimize \
Andrew Geissler220dafd2023-10-04 10:18:08 -050078 ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls openssl', d) == '') else ''} \
Andrew Geissler517393d2023-01-13 08:55:19 -060079"
80
81do_install:append:class-target() {
82 # cleanup buildpaths from curl-config
83 sed -i \
84 -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
85 -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \
86 -e 's|${DEBUG_PREFIX_MAP}||g' \
87 -e 's|${@" ".join(d.getVar("DEBUG_PREFIX_MAP").split())}||g' \
88 ${D}${bindir}/curl-config
89}
90
91do_compile_ptest() {
Andrew Geissler220dafd2023-10-04 10:18:08 -050092 oe_runmake -C ${B}/tests
Andrew Geissler517393d2023-01-13 08:55:19 -060093}
94
95do_install_ptest() {
96 cat ${WORKDIR}/disable-tests >> ${S}/tests/data/DISABLED
97 rm -f ${B}/tests/configurehelp.pm
98 cp -rf ${B}/tests ${D}${PTEST_PATH}
Andrew Geissler220dafd2023-10-04 10:18:08 -050099 rm -f ${D}${PTEST_PATH}/tests/libtest/.libs/libhostname.la
100 rm -f ${D}${PTEST_PATH}/tests/libtest/libhostname.la
101 mv ${D}${PTEST_PATH}/tests/libtest/.libs/* ${D}${PTEST_PATH}/tests/libtest/
102 mv ${D}${PTEST_PATH}/tests/libtest/libhostname.so ${D}${PTEST_PATH}/tests/libtest/.libs/
103 mv ${D}${PTEST_PATH}/tests/http/clients/.libs/* ${D}${PTEST_PATH}/tests/http/clients/
Andrew Geissler517393d2023-01-13 08:55:19 -0600104 cp -rf ${S}/tests ${D}${PTEST_PATH}
105 find ${D}${PTEST_PATH}/ -type f -name Makefile.am -o -name Makefile.in -o -name Makefile -delete
106 install -d ${D}${PTEST_PATH}/src
107 ln -sf ${bindir}/curl ${D}${PTEST_PATH}/src/curl
108 cp -rf ${D}${bindir}/curl-config ${D}${PTEST_PATH}
109}
110
Patrick Williams2a254922023-08-11 09:48:11 -0500111RDEPENDS:${PN}-ptest += " \
112 bash \
113 perl-module-b \
114 perl-module-base \
115 perl-module-cwd \
116 perl-module-digest \
117 perl-module-digest-md5 \
118 perl-module-file-basename \
119 perl-module-file-spec \
120 perl-module-file-temp \
121 perl-module-io-socket \
122 perl-module-ipc-open2 \
123 perl-module-list-util \
124 perl-module-memoize \
125 perl-module-storable \
126 perl-module-time-hires \
127"
Andrew Geissler517393d2023-01-13 08:55:19 -0600128
129PACKAGES =+ "lib${BPN}"
130
131FILES:lib${BPN} = "${libdir}/lib*.so.*"
132RRECOMMENDS:lib${BPN} += "ca-certificates"
133
134FILES:${PN} += "${datadir}/zsh"
135
136inherit multilib_script
137MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config"
138
139BBCLASSEXTEND = "native nativesdk"