blob: ec8ce9fd28aa68a373bdfe73c837f6b4bc04d185 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001SUMMARY = "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
12SRC_URI = " \
13 https://curl.se/download/${BP}.tar.xz \
14 file://run-ptest \
15 file://disable-tests \
16"
Patrick Williams2390b1b2022-11-03 13:47:49 -050017SRC_URI[sha256sum] = "2d61116e5f485581f6d59865377df4463f2e788677ac43222b496d4e49fb627b"
Patrick Williams92b42cb2022-09-03 06:53:57 -050018
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
27PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} libidn openssl proxy random threaded-resolver verbose zlib"
28PACKAGECONFIG: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"
33PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli"
34PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual"
35PACKAGECONFIG[dict] = "--enable-dict,--disable-dict,"
36PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls"
37PACKAGECONFIG[gopher] = "--enable-gopher,--disable-gopher,"
38PACKAGECONFIG[imap] = "--enable-imap,--disable-imap,"
39PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
40PACKAGECONFIG[krb5] = "--with-gssapi,--without-gssapi,krb5"
41PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,"
42PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,"
43PACKAGECONFIG[libgsasl] = "--with-libgsasl,--without-libgsasl,libgsasl"
44PACKAGECONFIG[libidn] = "--with-libidn2,--without-libidn2,libidn2"
45PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2"
46PACKAGECONFIG[mbedtls] = "--with-mbedtls=${STAGING_DIR_TARGET},--without-mbedtls,mbedtls"
47PACKAGECONFIG[mqtt] = "--enable-mqtt,--disable-mqtt,"
48PACKAGECONFIG[nghttp2] = "--with-nghttp2,--without-nghttp2,nghttp2"
49PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
50PACKAGECONFIG[pop3] = "--enable-pop3,--disable-pop3,"
51PACKAGECONFIG[proxy] = "--enable-proxy,--disable-proxy,"
52PACKAGECONFIG[random] = "--with-random=${RANDOM},--without-random"
53PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump"
54PACKAGECONFIG[rtsp] = "--enable-rtsp,--disable-rtsp,"
55PACKAGECONFIG[smb] = "--enable-smb,--disable-smb,"
56PACKAGECONFIG[smtp] = "--enable-smtp,--disable-smtp,"
57PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss"
58PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet,"
59PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp,"
60PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver,,,,ares"
61PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose"
62PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
63PACKAGECONFIG[zstd] = "--with-zstd,--without-zstd,zstd"
64
65EXTRA_OECONF = " \
66 --disable-libcurl-option \
67 --disable-ntlm-wb \
68 --enable-crypto-auth \
69 --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \
70 --without-libpsl \
71 --enable-debug \
72 --enable-optimize \
73 --disable-curldebug \
74 ${@'--without-ssl' if (bb.utils.filter('PACKAGECONFIG', 'gnutls mbedtls nss openssl', d) == '') else ''} \
75"
76
77do_install:append:class-target() {
78 # cleanup buildpaths from curl-config
79 sed -i \
80 -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
81 -e 's,--with-libtool-sysroot=${STAGING_DIR_TARGET},,g' \
82 -e 's|${DEBUG_PREFIX_MAP}||g' \
83 -e 's|${@" ".join(d.getVar("DEBUG_PREFIX_MAP").split())}||g' \
84 ${D}${bindir}/curl-config
85}
86
87do_compile_ptest() {
88 oe_runmake test
89 oe_runmake -C ${B}/tests/server
90}
91
92do_install_ptest() {
93 cat ${WORKDIR}/disable-tests >> ${S}/tests/data/DISABLED
94 rm -f ${B}/tests/configurehelp.pm
95 cp -rf ${B}/tests ${D}${PTEST_PATH}
96 cp -rf ${S}/tests ${D}${PTEST_PATH}
97 find ${D}${PTEST_PATH}/ -type f -name Makefile.am -o -name Makefile.in -o -name Makefile -delete
98 install -d ${D}${PTEST_PATH}/src
99 ln -sf ${bindir}/curl ${D}${PTEST_PATH}/src/curl
100 cp -rf ${D}${bindir}/curl-config ${D}${PTEST_PATH}
101}
102
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500103RDEPENDS:${PN}-ptest += "bash perl-modules perl-module-time-hires perl-module-digest-md5 \
104 perl-module-digest perl-module-ipc-open2"
Patrick Williams92b42cb2022-09-03 06:53:57 -0500105
106PACKAGES =+ "lib${BPN}"
107
108FILES:lib${BPN} = "${libdir}/lib*.so.*"
109RRECOMMENDS:lib${BPN} += "ca-certificates"
110
111FILES:${PN} += "${datadir}/zsh"
112
113inherit multilib_script
114MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config"
115
116BBCLASSEXTEND = "native nativesdk"