Skip to contentSkip to conversation

curl: make CURL_FEATURES configurable again

PATCH In review Michael Smith 3 participants 10 messages Oct 28, 2010 – Nov 2, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 curl: make CURL_FEATURES configurable again

Lock down CURL_FEATURES for virtclass-native, but make CURL_FEATURES for target a weak assignment.

---
 recipes/curl/curl-common.inc |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
recipes/curl/curl-common.inc +3 -2
index ddaebb8..8ffefeb 100644
@@ -6,9 +6,10 @@ SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2;name=tarball \
            file://pkgconfig_fix.patch"
 S = "${WORKDIR}/curl-${PV}"
 
-INC_PR = "r4"
+INC_PR = "r5"
 
-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}"]}
+CURL_FEATURES ?= "zlib,gnutls,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"
+CURL_FEATURES_virtclass-native = "zlib,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"
 # other allowed features: ipv6, ares, openssl
 
 inherit autotools pkgconfig binconfig
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 16 lines · Michael Smith

Lock down CURL_FEATURES for virtclass-native, but make CURL_FEATURES for target a weak assignment.

---
 recipes/curl/curl-common.inc |    5 +++--

 1 files changed, 3 insertions(+), 2 deletions(-)
recipes/curl/curl-common.inc +0 -0
index ddaebb8..8ffefeb 100644
@@ -6,9 +6,10 @@ SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2;name=tarball \

           file://pkgconfig_fix.patch"
 S = "${WORKDIR}/curl-${PV}"

recipes/curl/curl-common.inc SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2;name=tarball \ · line 12

Quoted 6 lines
recipes/curl/curl-common.inc +3 -2
-INC_PR = "r4"
+INC_PR = "r5"
 
-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}"]}
+CURL_FEATURES ?= "zlib,gnutls,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"
+CURL_FEATURES_virtclass-native = "zlib,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"

this change was done for a reason. this will not set correct override for native recipes and
we dont want gnutls on native recipe but if you look closely the output then it will enable gnutls
because CURL_FEATURES_virtclass-native is ineffective in this case as you already have a
weak assignment.

This was the reason why I proposed my fix for having recipe type OVERRIDE but unfortunately
that patch has different issue which prevents it from being applied.

Quoted 12 lines
 # other allowed features: ipv6, ares, openssl

 inherit autotools pkgconfig binconfig
--
1.7.0.4

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#2 lore raw
Quoted 9 lines · Khem Raj
recipes/curl/curl-common.inc +2 -1
-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}"]}
+CURL_FEATURES ?= "zlib,gnutls,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"
+CURL_FEATURES_virtclass-native = "zlib,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"

this change was done for a reason. this will not set correct override for native recipes and we dont want gnutls on native recipe but if you look closely the output then it will enable gnutls because CURL_FEATURES_virtclass-native is ineffective in this case as you already have a weak assignment.

It seems to do the right thing here - CURL_FEATURES_virtclass-native is not weak, so in my curl-native config.log, I see --disable-gnutls.

(btw: why do we not want gnutls in curl-native?)

Mike

#3 lore raw
Quoted 6 lines · Michael Smith
Quoted 3 lines · Khem Raj
recipes/curl/curl-common.inc +2 -1
-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}"]}
+CURL_FEATURES ?= "zlib,gnutls,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"
+CURL_FEATURES_virtclass-native = "zlib,cookies,crypto-auth,dict,file,ftp,http,telnet,tftp"
Quoted 8 lines
Quoted 5 lines

this change was done for a reason. this will not set correct override for native recipes and we dont want gnutls on native recipe but if you look closely the output then it will enable gnutls because CURL_FEATURES_virtclass-native is ineffective in this case as you already have a weak assignment.

It seems to do the right thing here - CURL_FEATURES_virtclass-native is not weak, so in my curl-native config.log, I see --disable-gnutls.

certainly nor for me. here is what I get

oe_runconf() {
        if [ -x

/scratch/oe/work/x86_64-linux/curl-native-7.21.1-r4.1/curl-7.21.1/configure ] ; then

/scratch/oe/work/x86_64-linux/curl-native-7.21.1-r4.1/curl-7.21.1/configure

\
                 --build=x86_64-linux             --host=x86_64-linux
           --target=x86_64-linux

--prefix=/scratch/oe/sysroots/x86_64-linux/usr --exec_prefix=/scratch/oe/sysroots/x86_64-linux/usr --bindir=/scratch/oe/sysroots/x86_64-linux/usr/bin --sbindir=/scratch/oe/sysroots/x86_64-linux/usr/sbin --libexecdir=/scratch/oe/sysroots/x86_64-linux/usr/libexec
--datadir=/scratch/oe/sysroots/x86_64-linux/usr/share
--sysconfdir=/scratch/oe/sysroots/x86_64-linux/etc
--sharedstatedir=/scratch/oe/sysroots/x86_64-linux/com
--localstatedir=/scratch/oe/sysroots/x86_64-linux/var
--libdir=/scratch/oe/sysroots/x86_64-linux/usr/lib
--includedir=/scratch/oe/sysroots/x86_64-linux/usr/include
--oldincludedir=/scratch/oe/sysroots/x86_64-linux/usr/include

          --infodir=/scratch/oe/sysroots/x86_64-linux/usr/share/info
           --mandir=/scratch/oe/sysroots/x86_64-linux/usr/share/man
            --with-libtool-sysroot

--without-libssh2 --with-random=/dev/urandom
--without-libidn --enable-cookies --enable-crypto-auth
--enable-dict --enable-file --enable-ftp --enable-http --enable-telnet --enable-tftp --disable-ipv6 --with-zlib=/scratch/oe/sysroots/x86_64-linux/usr/lib/../ --with-gnutls=/scratch/oe/sysroots/x86_64-linux/usr/bin --without-ssl --disable-ares "$@"
else
oefatal "no configure script found"
fi

}

Quoted 3 lines

(btw: why do we not want gnutls in curl-native?)

thats a different question does not solve the problem at hand.

Quoted 7 lines

Mike

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#4 lore raw
Quoted 5 lines · Khem Raj
Quoted 2 lines · Michael Smith

It seems to do the right thing here - CURL_FEATURES_virtclass-native is not weak, so in my curl-native config.log, I see --disable-gnutls.

certainly nor for me. here is what I get

Maybe because I have a setting for CURL_FEATURES in my conf? If so, that sounds like odd bitbake behaviour. :(

Do you have any thoughts on how to solve it? There is not much point to having CURL_FEATURES as a variable if it's not configurable. I can just hack over it in an amend.inc, but the recipe as it stands is broken.

Quoted 3 lines
Quoted 1 line

(btw: why do we not want gnutls in curl-native?)

thats a different question does not solve the problem at hand.

Yes, it's a different question. I didn't realize I was limited to one per e-mail. :)

Mike

#5 lore raw
Quoted 7 lines · Michael Smith
Quoted 6 lines · Khem Raj
Quoted 3 lines · Michael Smith

It seems to do the right thing here - CURL_FEATURES_virtclass-native is not weak, so in my curl-native config.log, I see --disable-gnutls.

Quoted 8 lines
Quoted 1 line

certainly nor for me. here is what I get

Maybe because I have a setting for CURL_FEATURES in my conf? If so, that sounds like odd bitbake behaviour. :(

Do you have any thoughts on how to solve it? There is not much point to having CURL_FEATURES as a variable if it's not configurable. I can just hack over it in an amend.inc, but the recipe as it stands is broken.

yes if we had the recipe type overrides for native sdk and target separate then this could
be done probably by appending to concerning override

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

(btw: why do we not want gnutls in curl-native?)

thats a different question does not solve the problem at hand.

Yes, it's a different question. I didn't realize I was limited to one per e-mail. :)

you can ask as many I just wanted to keep focus on the topic at hand in a thread it helps people who read it later.

Quoted 8 lines

Mike

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

#6 lore raw
Quoted 8 lines · Khem Raj
Quoted 3 lines · Michael Smith

Do you have any thoughts on how to solve it? There is not much point to having CURL_FEATURES as a variable if it's not configurable. I can just hack over it in an amend.inc, but the recipe as it stands is broken.

yes if we had the recipe type overrides for native sdk and target separate then this could
be done probably by appending to concerning override

OK, what if we get rid of CURL_FEATURES entirely, and the anon python that handles it. No one in-tree is using CURL_FEATURES, and it's been broken for a couple weeks now.

It'll be easy enough to override the depends and configure opts in a recipe amend for anyone who needs that control (i.e. me).

Mike

#7 lore raw
Quoted 10 lines · Michael Smith
Quoted 8 lines · Khem Raj
Quoted 4 lines · Michael Smith

Do you have any thoughts on how to solve it? There is not much point to having CURL_FEATURES as a variable if it's not configurable. I can just hack
over it in an amend.inc, but the recipe as it stands is broken.

yes if we had the recipe type overrides for native sdk and target separate then this could
be done probably by appending to concerning override

Quoted 6 lines

OK, what if we get rid of CURL_FEATURES entirely, and the anon python that handles it. No one in-tree is using CURL_FEATURES, and it's been broken for a couple weeks now.

It'll be easy enough to override the depends and configure opts in a recipe amend for anyone who needs that control (i.e. me).

It has been discussed before (check irc logs 7-10 days ago) and Khem made a change to introduce new override called "target", which can be used in this case. Anyway, I ended up fixing it by amend in my overlay:

http://arago-project.org/git/?p=arago.git;a=commitdiff;h=37979c41a04f7712dbf9c325871fea7c01cc737a

Signature · 1 line
Denys
#8 lore raw
Quoted 3 lines · Denys Dmytriyenko

It has been discussed before (check irc logs 7-10 days ago) and Khem made a change to introduce new override called "target", which can be used in this case. Anyway, I ended up fixing it by amend in my overlay:

http://arago-project.org/git/?p=arago.git;a=commitdiff;h=37979c41a04f7712dbf9c325871fea7c01cc737a

Yes - the target override patch didn't go in, but I agree it would make this easier.

Anon python seems to be going out of style so the v2 curl patch uses variable settings with a native override to ensure gnutls isn't in the feature list.

Mike

#9 lore raw

PATCH v2 1/1 curl: remove anon python block

In reply to Michael Smith

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.

---
 recipes/curl/curl-common.inc |   98 +++++++++++++++++++++--------------------
 1 files changed, 50 insertions(+), 48 deletions(-)
recipes/curl/curl-common.inc +50 -48
index ddaebb8..fd5638f 100644
@@ -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
 }
-
Signature · 1 line
1.7.0.4