[oe] [PATCH v2] curl: remove anon python block

Michael Smith msmith at cbnco.com
Fri Oct 29 15:02:12 UTC 2010


Remove the anonymous Python block that was parsing CURL_FEATURES.
Configurability of CURL_FEATURES was removed in bf2f44fc.
Distros or overlays that want control (e.g. to use openssl instead of
gnutls) can override variables in a recipe amend.

Signed-off-by: Michael Smith <msmith at cbnco.com>
---
 recipes/curl/curl-common.inc |   98 +++++++++++++++++++++--------------------
 1 files changed, 50 insertions(+), 48 deletions(-)

diff --git a/recipes/curl/curl-common.inc b/recipes/curl/curl-common.inc
index ddaebb8..fd5638f 100644
--- a/recipes/curl/curl-common.inc
+++ b/recipes/curl/curl-common.inc
@@ -6,58 +6,60 @@ SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2;name=tarball \
            file://pkgconfig_fix.patch"
 S = "${WORKDIR}/curl-${PV}"
 
-INC_PR = "r4"
-
-CURL_FEATURES = ${@['zlib,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp','zlib,gnutls,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp']["${BPN}" == "${PN}"]}
-# other allowed features: ipv6, ares, openssl
+INC_PR = "r5"
 
 inherit autotools pkgconfig binconfig
 
-EXTRA_OECONF = " \
-                --without-libssh2 \
-		--with-random=/dev/urandom \
-		--without-libidn \
-		"
-
-python __anonymous() {
-	f = bb.data.getVar("CURL_FEATURES", d, True).split(",")
-        oeconf = bb.data.getVar("EXTRA_OECONF", d, False)
-        deps = bb.data.getVar("DEPENDS", d, False).split()
-        pn = bb.data.getVar("PN", d, True)
-        if "native" in pn:
-                native = "-native"
-        else:
-                native = ""
-        for x in [ 'cookies', 'crypto-auth', 'dict', 'file', 'ftp', 'http', 'telnet', 'tftp', 'ipv6' ]:
-                if x in f:
-                        oeconf += " --enable-%s" % x
-                else:
-                        oeconf += " --disable-%s" % x
-        if 'zlib' in f:
-                oeconf += " --with-zlib=${STAGING_LIBDIR}/../"
-                deps.append("zlib" + native)
-        else:
-                oeconf += " --without-zlib"
-        if 'gnutls' in f:
-                oeconf += " --with-gnutls=${STAGING_BINDIR_CROSS}"
-                deps.append("gnutls" + native)
-        else:
-                oeconf += " --without-gnutls"
-        if 'openssl' in f:
-                oeconf += " --with-ssl=${STAGING_LIBDIR}/../"
-                deps.append("openssl" + native)
-        else:
-                oeconf += " --without-ssl"
-        if 'ares' in f:
-                oeconf += " --enable-ares"
-                deps.append("c-ares" + native)
-        else:
-                oeconf += " --disable-ares"
-        bb.data.setVar('EXTRA_OECONF', oeconf, d)
-        bb.data.setVar('DEPENDS', " ".join(deps), d)
-}
+# Historically the curl recipe had configurable CURL_FEATURES. Distros
+# that want to control features may override the CURL_DEPENDS_* and
+# CURL_CONF_* variables in an amend.inc.
+
+CURL_DEPENDS_TLS_GNUTLS = "gnutls"
+CURL_DEPENDS_TLS_OPENSSL = "openssl"
+CURL_DEPENDS_TLS = "${CURL_DEPENDS_TLS_GNUTLS}"
+
+CURL_DEPENDS_ARES_YES = "c-ares"
+CURL_DEPENDS_ARES = ""
+
+CURL_DEPENDS_BASE = "zlib ${CURL_DEPENDS_ARES}"
+
+# Don't use gnutls in native build
+DEPENDS = "${CURL_DEPENDS_BASE} ${CURL_DEPENDS_TLS}"
+DEPENDS_virtclass-native = "${CURL_DEPENDS_BASE}"
+
+
+CURL_CONF_FEATURES_BASE = "--enable-cookies --enable-crypto-auth --enable-ftp"
+CURL_CONF_FEATURES_BLOAT = "--enable-dict --enable-telnet --enable-tftp"
+
+CURL_CONF_ZLIB = "--with-zlib=${STAGING_LIBDIR}/../"
+
+CURL_CONF_TLS_GNUTLS = "--without-ssl --with-gnutls=${STAGING_BINDIR_CROSS}"
+CURL_CONF_TLS_OPENSSL = "--without-gnutls --with-ssl=${STAGING_LIBDIR}/../"
+CURL_CONF_TLS = "${CURL_CONF_TLS_GNUTLS}"
+
+CURL_CONF_IPV6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', \
+			'--enable-ipv6', '--disable-ipv6', d)}"
+
+CURL_CONF_ARES = "--disable-ares"
+
+CURL_CONF_BASE = " \
+	--without-libssh2 \
+	--with-random=/dev/urandom \
+	--without-libidn \
+	--enable-file \
+	--enable-http \
+	${CURL_CONF_FEATURES_BASE} \
+	${CURL_CONF_FEATURES_BLOAT} \
+	${CURL_CONF_ZLIB} \
+	${CURL_CONF_IPV6} \
+	${CURL_CONF_ARES} \
+"
+
+EXTRA_OECONF = "${CURL_CONF_BASE} ${CURL_CONF_TLS}"
+EXTRA_OECONF_virtclass-native = " \
+	${CURL_CONF_BASE} --without-gnutls --without-ssl \
+"
 
 do_configure_prepend() {
 	sed -i s:OPT_GNUTLS/bin:OPT_GNUTLS:g configure.ac
 }
-
-- 
1.7.0.4





More information about the Openembedded-devel mailing list