blob: 9c16d3d51530b46c9e73bb3b1fbe767974b2c3f2 [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"
Patrick Williams2a254922023-08-11 09:48:11 -050017SRC_URI[sha256sum] = "2859ec79e2cd96e976a99493547359b8001af1d1e21f3a3a3b846544ef54500f"
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
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"
35# Don't use this in production
36PACKAGECONFIG[debug] = "--enable-debug,--disable-debug"
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"
Andrew Geissler6aa7eec2023-03-03 12:41:14 -060043PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap"
44PACKAGECONFIG[ldaps] = "--enable-ldaps,--disable-ldaps,openldap"
Andrew Geissler517393d2023-01-13 08:55:19 -060045PACKAGECONFIG[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-optimize \
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
Patrick Williams2a254922023-08-11 09:48:11 -0500103RDEPENDS:${PN}-ptest += " \
104 bash \
105 perl-module-b \
106 perl-module-base \
107 perl-module-cwd \
108 perl-module-digest \
109 perl-module-digest-md5 \
110 perl-module-file-basename \
111 perl-module-file-spec \
112 perl-module-file-temp \
113 perl-module-io-socket \
114 perl-module-ipc-open2 \
115 perl-module-list-util \
116 perl-module-memoize \
117 perl-module-storable \
118 perl-module-time-hires \
119"
Andrew Geissler517393d2023-01-13 08:55:19 -0600120
121PACKAGES =+ "lib${BPN}"
122
123FILES:lib${BPN} = "${libdir}/lib*.so.*"
124RRECOMMENDS:lib${BPN} += "ca-certificates"
125
126FILES:${PN} += "${datadir}/zsh"
127
128inherit multilib_script
129MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/curl-config"
130
131BBCLASSEXTEND = "native nativesdk"