blob: 75417cd1bc54fb0b20a2c0a259d606d8e62a4639 [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001SUMMARY = "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 = "MIT-open-group"
10LIC_FILES_CHKSUM = "file://COPYING;md5=190c514872597083303371684954f238"
11
Andrew Geissler615f2f12022-07-15 14:00:58 -050012SRC_URI = " \
13 https://curl.se/download/${BP}.tar.xz \
14 file://0001-easy_lock.h-include-sched.h-if-available-to-fix-buil.patch \
15 file://0001-easy_lock-switch-to-using-atomic_int-instead-of-bool.patch \
16 file://run-ptest \
17 file://disable-tests \
18"
19SRC_URI[sha256sum] = "2d118b43f547bfe5bae806d8d47b4e596ea5b25a6c1f080aef49fbcd817c5db8"
Andrew Geissler9aee5002022-03-30 16:27:02 +000020
21# Curl has used many names over the years...
22CVE_PRODUCT = "haxx:curl haxx:libcurl curl:curl curl:libcurl libcurl:libcurl daniel_stenberg:curl"
23
Andrew Geissler615f2f12022-07-15 14:00:58 -050024inherit autotools pkgconfig binconfig multilib_header ptest
Andrew Geissler9aee5002022-03-30 16:27:02 +000025
26# Entropy source for random PACKAGECONFIG option
27RANDOM ?= "/dev/urandom"
28
29PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} libidn openssl proxy random threaded-resolver verbose zlib"
30PACKAGECONFIG:class-native = "ipv6 openssl proxy random threaded-resolver verbose zlib"
31PACKAGECONFIG:class-nativesdk = "ipv6 openssl proxy random threaded-resolver verbose zlib"
32
33# 'ares' and 'threaded-resolver' are mutually exclusive
34PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares,,,threaded-resolver"
35PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli"
36PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual"
37PACKAGECONFIG[dict] = "--enable-dict,--disable-dict,"
38PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
39PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher,"
40PACKAGECONFIG[imap] = "--enable-imap,--disable-imap,"
41PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
42PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5"
43PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,"
44PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,"
45PACKAGECONFIG[libgsasl] = "--with-libgsasl,--without-libgsasl,libgsasl"
46PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2"
47PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
48PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls"
49PACKAGECONFIG[mqtt] = "--enable-mqtt,--disable-mqtt,"
50PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2"
51PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
52PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3,"
53PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy,"
54PACKAGECONFIG[random] = "--with-random=${RANDOM},--without-random"
55PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump"
56PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp,"
57PACKAGECONFIG[smb] = "--enable-smb,--disable-smb,"
58PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp,"
59PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss"
60PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet,"
61PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp,"
62PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver,,,,ares"
63PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose"
64PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
65PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
66
67EXTRA_OECONF = " \
68 --disable-libcurl-option \
69 --disable-ntlm-wb \
70 --enable-crypto-auth \
71 --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
72 --without-libpsl \
73 --enable-debug \
74 --enable-optimize \
75 --disable-curldebug \
76 ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls nss openssl', d) == '') else ''} \
77"
78
79do_install:append:class-target() {
80 # cleanup buildpaths from curl-config
81 sed -i \
82 -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
83 -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \
84 -e 's|${DEBUG_PREFIX_MAP}||g' \
85 -e 's|${@" ".join(d.getVar("DEBUG_PREFIX_MAP").split())}||g' \
86 ${D}${bindir}/curl-config
87}
88
Andrew Geissler615f2f12022-07-15 14:00:58 -050089do_compile_ptest() {
90 oe_runmake test
91 oe_runmake -C ${B}/tests/server
92}
93
94do_install_ptest() {
95 cat ${WORKDIR}/disable-tests >> ${S}/tests/data/DISABLED
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050096 rm -f ${B}/tests/configurehelp.pm
Andrew Geissler615f2f12022-07-15 14:00:58 -050097 cp -rf ${B}/tests ${D}${PTEST_PATH}
98 cp -rf ${S}/tests ${D}${PTEST_PATH}
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050099 find ${D}${PTEST_PATH}/ -type f -name Makefile.am -o -name Makefile.in -o -name Makefile -delete
Andrew Geissler615f2f12022-07-15 14:00:58 -0500100 install -d ${D}${PTEST_PATH}/src
101 ln -sf ${bindir}/curl ${D}${PTEST_PATH}/src/curl
102 cp -rf ${D}${bindir}/curl-config ${D}${PTEST_PATH}
103}
104
105RDEPENDS:${PN}-ptest += "bash perl-modules"
106
Andrew Geissler9aee5002022-03-30 16:27:02 +0000107PACKAGES =+ "lib${BPN}"
108
109FILES:lib${BPN} = "${libdir}/lib*.so.*"
110RRECOMMENDS:lib${BPN} += "ca-certificates"
111
112FILES:${PN} += "${datadir}/zsh"
113
114inherit multilib_script
115MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config"
116
117BBCLASSEXTEND = "native nativesdk"