Re: [OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-05-05 Thread Khem Raj
On Thu, May 5, 2011 at 2:41 AM, Richard Purdie
richard.pur...@linuxfoundation.org wrote:
 On Wed, 2011-05-04 at 18:07 -0700, Khem Raj wrote:
 a build from scratch revealed few more issues with this patch too.

 1. We have to only remove gettext from dependencies if its a target
 package for all other it still it needed otherwise all native and
 cross tools start failing to build
  e.g. binutils-cross this can be easily solved by a patch

 iff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
 index 6f79e5e..cc39204 100644
 --- a/meta/classes/gettext.bbclass
 +++ b/meta/classes/gettext.bbclass
 @@ -1,5 +1,5 @@
  def gettext_dependencies(d):
 -    if d.getVar('USE_NLS', True) == 'no':
 +    if d.getVar('USE_NLS', True) == 'no' and not oe.utils.inherits(d,
 'native', 'nativesdk', 'cross')
          return 
      if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not
 oe.utils.inherits(d, 'cross-canadian')
          return 

 This looks reasonable, its still much clearer what is happening and why
 compared to the original version...

 second problem is that EXTRA_OECONF when recipes override it instead
 of += or appending etc.
 then --enable|--disable-nls that we added via gettext_oeconf() is lost
 as a result some packages complain about config.rpath
 when USE_NLS is set to no the reason is their configure is missing the
 argument --disable-nls this works ok
 for eglibc based targets since default is to enable-nls if nothing is
 specified but uclibc fails. As a testcase try to preprocess
 utils-linux
 recipe and check the contents of EXTRA_OECONF

 I suspect we can fix this with:

 -EXTRA_OECONF += ${@gettext_oeconf(d)}
 +EXTRA_OECONF_append =  ${@gettext_oeconf(d)}

 ?

yes something like that
somehow the patch I attached did not make it to ml
I have sent it separately now.


 Cheers,

 Richard



___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-05-04 Thread Khem Raj
On Tue, May 3, 2011 at 3:39 PM, Richard Purdie
richard.pur...@linuxfoundation.org wrote:
 On Tue, 2011-05-03 at 11:04 -0700, Khem Raj wrote:
 This has the same problem It empties out DEPENDS_GETTEXT after they have
 have already been added to DEPENDS via virtclass e.g. when you build
 gcc-runtime-nativesdk it will report a dep loop since now it depends on
 virtual/gettext-nativesdk (added by gettext class)
 and virtual/gettext-nativesdk depends on compilerlibs
 provided by gcc-runtime-nativesdk. This was same problem I was trying to
 circumvent

 Ok, how about this version:

 diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
 index 4f20bc2..3b83e42 100644
 --- a/meta/classes/base.bbclass
 +++ b/meta/classes/base.bbclass
 @@ -89,9 +89,11 @@ def base_dep_prepend(d):
                        deps +=  virtual/${TARGET_PREFIX}gcc 
 virtual/${TARGET_PREFIX}compilerlibs virtual/libc 
        return deps

 -DEPENDS_prepend=${@base_dep_prepend(d)} 
 -DEPENDS_virtclass-native_prepend=${@base_dep_prepend(d)} 
 -DEPENDS_virtclass-nativesdk_prepend=${@base_dep_prepend(d)} 
 +BASEDEPENDS = ${@base_dep_prepend(d)}
 +
 +DEPENDS_prepend=${BASEDEPENDS} 
 +DEPENDS_virtclass-native_prepend=${BASEDEPENDS} 
 +DEPENDS_virtclass-nativesdk_prepend=${BASEDEPENDS} 

  FILESPATH = ${@base_set_filespath([ ${FILE_DIRNAME}/${PF}, 
 ${FILE_DIRNAME}/${P}, ${FILE_DIRNAME}/${PN}, ${FILE_DIRNAME}/${BP}, 
 ${FILE_DIRNAME}/${BPN}, ${FILE_DIRNAME}/files, ${FILE_DIRNAME} ], d)}
  # THISDIR only works properly with imediate expansion as it has to run
 diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
 index a40e74f..6f79e5e 100644
 --- a/meta/classes/gettext.bbclass
 +++ b/meta/classes/gettext.bbclass
 @@ -1,17 +1,17 @@
 -def gettext_after_parse(d):
 -    # Remove the NLS bits if USE_NLS is no.
 -    if bb.data.getVar('USE_NLS', d, 1) == 'no':
 -        cfg = oe_filter_out('^--(dis|en)able-nls$', 
 bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
 -        cfg +=  --disable-nls
 -        depends = bb.data.getVar('DEPENDS', d, 1) or 
 -        bb.data.setVar('DEPENDS', 
 oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
 -        bb.data.setVar('EXTRA_OECONF', cfg, d)
 +def gettext_dependencies(d):
 +    if d.getVar('USE_NLS', True) == 'no':
 +        return 
 +    if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not 
 oe.utils.inherits(d, 'cross-canadian'):
 +        return 
 +    return d.getVar('DEPENDS_GETTEXT', False)

 -python () {
 -    gettext_after_parse(d)
 -}
 +def gettext_oeconf(d):
 +    # Remove the NLS bits if USE_NLS is no.
 +    if d.getVar('USE_NLS', True) == 'no':
 +        return '--disable-nls'
 +    return --enable-nls

 -DEPENDS_GETTEXT = gettext gettext-native
 +DEPENDS_GETTEXT = virtual/gettext gettext-native

 -DEPENDS =+ ${DEPENDS_GETTEXT}
 -EXTRA_OECONF += --enable-nls
 +BASEDEPENDS =+ ${@gettext_dependencies(d)}
 +EXTRA_OECONF += ${@gettext_oeconf(d)}



a build from scratch revealed few more issues with this patch too.

1. We have to only remove gettext from dependencies if its a target
package for all other it still it needed otherwise all native and
cross tools start failing to build
 e.g. binutils-cross this can be easily solved by a patch

iff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
index 6f79e5e..cc39204 100644
--- a/meta/classes/gettext.bbclass
+++ b/meta/classes/gettext.bbclass
@@ -1,5 +1,5 @@
 def gettext_dependencies(d):
-if d.getVar('USE_NLS', True) == 'no':
+if d.getVar('USE_NLS', True) == 'no' and not oe.utils.inherits(d,
'native', 'nativesdk', 'cross')
 return 
 if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not
oe.utils.inherits(d, 'cross-canadian')
 return 


second problem is that EXTRA_OECONF when recipes override it instead
of += or appending etc.
then --enable|--disable-nls that we added via gettext_oeconf() is lost
as a result some packages complain about config.rpath
when USE_NLS is set to no the reason is their configure is missing the
argument --disable-nls this works ok
for eglibc based targets since default is to enable-nls if nothing is
specified but uclibc fails. As a testcase try to preprocess
utils-linux
recipe and check the contents of EXTRA_OECONF

___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-05-04 Thread Khem Raj
On (04/05/11 18:07), Khem Raj wrote:
 On Tue, May 3, 2011 at 3:39 PM, Richard Purdie
 richard.pur...@linuxfoundation.org wrote:
  On Tue, 2011-05-03 at 11:04 -0700, Khem Raj wrote:
  This has the same problem It empties out DEPENDS_GETTEXT after they have
  have already been added to DEPENDS via virtclass e.g. when you build
  gcc-runtime-nativesdk it will report a dep loop since now it depends on
  virtual/gettext-nativesdk (added by gettext class)
  and virtual/gettext-nativesdk depends on compilerlibs
  provided by gcc-runtime-nativesdk. This was same problem I was trying to
  circumvent
 
  Ok, how about this version:
 
  diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
  index 4f20bc2..3b83e42 100644
  --- a/meta/classes/base.bbclass
  +++ b/meta/classes/base.bbclass
  @@ -89,9 +89,11 @@ def base_dep_prepend(d):
                         deps +=  virtual/${TARGET_PREFIX}gcc 
  virtual/${TARGET_PREFIX}compilerlibs virtual/libc 
         return deps
 
  -DEPENDS_prepend=${@base_dep_prepend(d)} 
  -DEPENDS_virtclass-native_prepend=${@base_dep_prepend(d)} 
  -DEPENDS_virtclass-nativesdk_prepend=${@base_dep_prepend(d)} 
  +BASEDEPENDS = ${@base_dep_prepend(d)}
  +
  +DEPENDS_prepend=${BASEDEPENDS} 
  +DEPENDS_virtclass-native_prepend=${BASEDEPENDS} 
  +DEPENDS_virtclass-nativesdk_prepend=${BASEDEPENDS} 
 
   FILESPATH = ${@base_set_filespath([ ${FILE_DIRNAME}/${PF}, 
  ${FILE_DIRNAME}/${P}, ${FILE_DIRNAME}/${PN}, ${FILE_DIRNAME}/${BP}, 
  ${FILE_DIRNAME}/${BPN}, ${FILE_DIRNAME}/files, ${FILE_DIRNAME} ], d)}
   # THISDIR only works properly with imediate expansion as it has to run
  diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
  index a40e74f..6f79e5e 100644
  --- a/meta/classes/gettext.bbclass
  +++ b/meta/classes/gettext.bbclass
  @@ -1,17 +1,17 @@
  -def gettext_after_parse(d):
  -    # Remove the NLS bits if USE_NLS is no.
  -    if bb.data.getVar('USE_NLS', d, 1) == 'no':
  -        cfg = oe_filter_out('^--(dis|en)able-nls$', 
  bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
  -        cfg +=  --disable-nls
  -        depends = bb.data.getVar('DEPENDS', d, 1) or 
  -        bb.data.setVar('DEPENDS', 
  oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
  -        bb.data.setVar('EXTRA_OECONF', cfg, d)
  +def gettext_dependencies(d):
  +    if d.getVar('USE_NLS', True) == 'no':
  +        return 
  +    if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not 
  oe.utils.inherits(d, 'cross-canadian'):
  +        return 
  +    return d.getVar('DEPENDS_GETTEXT', False)
 
  -python () {
  -    gettext_after_parse(d)
  -}
  +def gettext_oeconf(d):
  +    # Remove the NLS bits if USE_NLS is no.
  +    if d.getVar('USE_NLS', True) == 'no':
  +        return '--disable-nls'
  +    return --enable-nls
 
  -DEPENDS_GETTEXT = gettext gettext-native
  +DEPENDS_GETTEXT = virtual/gettext gettext-native
 
  -DEPENDS =+ ${DEPENDS_GETTEXT}
  -EXTRA_OECONF += --enable-nls
  +BASEDEPENDS =+ ${@gettext_dependencies(d)}
  +EXTRA_OECONF += ${@gettext_oeconf(d)}
 
 
 
 a build from scratch revealed few more issues with this patch too.
 
 1. We have to only remove gettext from dependencies if its a target
 package for all other it still it needed otherwise all native and
 cross tools start failing to build
  e.g. binutils-cross this can be easily solved by a patch
 
 iff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
 index 6f79e5e..cc39204 100644
 --- a/meta/classes/gettext.bbclass
 +++ b/meta/classes/gettext.bbclass
 @@ -1,5 +1,5 @@
  def gettext_dependencies(d):
 -if d.getVar('USE_NLS', True) == 'no':
 +if d.getVar('USE_NLS', True) == 'no' and not oe.utils.inherits(d,
 'native', 'nativesdk', 'cross')
  return 
  if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not
 oe.utils.inherits(d, 'cross-canadian')
  return 
 
 
 second problem is that EXTRA_OECONF when recipes override it instead
 of += or appending etc.
 then --enable|--disable-nls that we added via gettext_oeconf() is lost
 as a result some packages complain about config.rpath
 when USE_NLS is set to no the reason is their configure is missing the
 argument --disable-nls this works ok
 for eglibc based targets since default is to enable-nls if nothing is
 specified but uclibc fails. As a testcase try to preprocess
 utils-linux
 recipe and check the contents of EXTRA_OECONF

attached is a patch on top of this patch which fixes both the issues I
mentioned. I also thought of defining USE_NLS to yes in
native/cross/nativesdk classes but then I resorted to add the check in
gettext.bbclass

Please review and apply if appropriate

Thanks

-- 
-Khem
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-05-03 Thread Richard Purdie
On Fri, 2011-04-29 at 09:11 -0700, Khem Raj wrote:
 On Thu, Apr 28, 2011 at 2:01 AM, Richard Purdie
 richard.pur...@linuxfoundation.org wrote:
  We can make this simpler. We should just setVar(DEPENDS_GETTEXT, )
  in the INHIBIT_DEFAULT_DEPS case. If anything is expanding the variables
  somewhere, we should fix that.
 
 
 Infact the virtclass stuff complicates this since they are evaluated
 specially and I am not clear weather _append gets
 evaluation before that or after and also the anon python function
 evaluation as the one we are defining in this class.
 
 I tried to empty out DEPENDS_GETTEXT but it does not work in nativesdk cases.

I still think we can simplify this. Could you try the following patch
please?:

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 4f20bc2..3b83e42 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -89,9 +89,11 @@ def base_dep_prepend(d):
deps +=  virtual/${TARGET_PREFIX}gcc 
virtual/${TARGET_PREFIX}compilerlibs virtual/libc 
return deps
 
-DEPENDS_prepend=${@base_dep_prepend(d)} 
-DEPENDS_virtclass-native_prepend=${@base_dep_prepend(d)} 
-DEPENDS_virtclass-nativesdk_prepend=${@base_dep_prepend(d)} 
+BASEDEPENDS = ${@base_dep_prepend(d)}
+
+DEPENDS_prepend=${BASEDEPENDS} 
+DEPENDS_virtclass-native_prepend=${BASEDEPENDS} 
+DEPENDS_virtclass-nativesdk_prepend=${BASEDEPENDS} 
 
 FILESPATH = ${@base_set_filespath([ ${FILE_DIRNAME}/${PF}, 
${FILE_DIRNAME}/${P}, ${FILE_DIRNAME}/${PN}, ${FILE_DIRNAME}/${BP}, 
${FILE_DIRNAME}/${BPN}, ${FILE_DIRNAME}/files, ${FILE_DIRNAME} ], d)}
 # THISDIR only works properly with imediate expansion as it has to run
diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
index a40e74f..57b551e 100644
--- a/meta/classes/gettext.bbclass
+++ b/meta/classes/gettext.bbclass
@@ -1,17 +1,17 @@
 def gettext_after_parse(d):
 # Remove the NLS bits if USE_NLS is no.
-if bb.data.getVar('USE_NLS', d, 1) == 'no':
-cfg = oe_filter_out('^--(dis|en)able-nls$', 
bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
-cfg +=  --disable-nls
-depends = bb.data.getVar('DEPENDS', d, 1) or 
-bb.data.setVar('DEPENDS', 
oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
-bb.data.setVar('EXTRA_OECONF', cfg, d)
+if bb.data.getVar('USE_NLS', d, True) == 'no':
+bb.data.setVar('DEPENDS_GETTEXT', , d)
+bb.data.setVar('OECONFNLSOPTION', '--disable-nls', d)
+if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not 
oe.utils.inherits(d, 'cross-canadian'):
+bb.data.setVar('DEPENDS_GETTEXT', , d)
 
 python () {
 gettext_after_parse(d)
 }
 
-DEPENDS_GETTEXT = gettext gettext-native
+DEPENDS_GETTEXT = virtual/gettext gettext-native
+OECONFNLSOPTION = --enable-nls
 
-DEPENDS =+ ${DEPENDS_GETTEXT}
-EXTRA_OECONF += --enable-nls
+BASEDEPENDS =+ ${DEPENDS_GETTEXT}
+EXTRA_OECONF += ${OECONFNLSOPTION}




___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-05-03 Thread Khem Raj
On (03/05/11 13:14), Richard Purdie wrote:
 On Fri, 2011-04-29 at 09:11 -0700, Khem Raj wrote:
  On Thu, Apr 28, 2011 at 2:01 AM, Richard Purdie
  richard.pur...@linuxfoundation.org wrote:
   We can make this simpler. We should just setVar(DEPENDS_GETTEXT, )
   in the INHIBIT_DEFAULT_DEPS case. If anything is expanding the variables
   somewhere, we should fix that.
  
  
  Infact the virtclass stuff complicates this since they are evaluated
  specially and I am not clear weather _append gets
  evaluation before that or after and also the anon python function
  evaluation as the one we are defining in this class.
  
  I tried to empty out DEPENDS_GETTEXT but it does not work in nativesdk 
  cases.
 
 I still think we can simplify this. Could you try the following patch
 please?:
 
 diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
 index 4f20bc2..3b83e42 100644
 --- a/meta/classes/base.bbclass
 +++ b/meta/classes/base.bbclass
 @@ -89,9 +89,11 @@ def base_dep_prepend(d):
   deps +=  virtual/${TARGET_PREFIX}gcc 
 virtual/${TARGET_PREFIX}compilerlibs virtual/libc 
   return deps
  
 -DEPENDS_prepend=${@base_dep_prepend(d)} 
 -DEPENDS_virtclass-native_prepend=${@base_dep_prepend(d)} 
 -DEPENDS_virtclass-nativesdk_prepend=${@base_dep_prepend(d)} 
 +BASEDEPENDS = ${@base_dep_prepend(d)}
 +
 +DEPENDS_prepend=${BASEDEPENDS} 
 +DEPENDS_virtclass-native_prepend=${BASEDEPENDS} 
 +DEPENDS_virtclass-nativesdk_prepend=${BASEDEPENDS} 
  
  FILESPATH = ${@base_set_filespath([ ${FILE_DIRNAME}/${PF}, 
 ${FILE_DIRNAME}/${P}, ${FILE_DIRNAME}/${PN}, ${FILE_DIRNAME}/${BP}, 
 ${FILE_DIRNAME}/${BPN}, ${FILE_DIRNAME}/files, ${FILE_DIRNAME} ], d)}
  # THISDIR only works properly with imediate expansion as it has to run
 diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
 index a40e74f..57b551e 100644
 --- a/meta/classes/gettext.bbclass
 +++ b/meta/classes/gettext.bbclass
 @@ -1,17 +1,17 @@
  def gettext_after_parse(d):
  # Remove the NLS bits if USE_NLS is no.
 -if bb.data.getVar('USE_NLS', d, 1) == 'no':
 -cfg = oe_filter_out('^--(dis|en)able-nls$', 
 bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
 -cfg +=  --disable-nls
 -depends = bb.data.getVar('DEPENDS', d, 1) or 
 -bb.data.setVar('DEPENDS', 
 oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
 -bb.data.setVar('EXTRA_OECONF', cfg, d)
 +if bb.data.getVar('USE_NLS', d, True) == 'no':
 +bb.data.setVar('DEPENDS_GETTEXT', , d)
 +bb.data.setVar('OECONFNLSOPTION', '--disable-nls', d)
 +if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not 
 oe.utils.inherits(d, 'cross-canadian'):
 +bb.data.setVar('DEPENDS_GETTEXT', , d)
  
  python () {
  gettext_after_parse(d)
  }
  
 -DEPENDS_GETTEXT = gettext gettext-native
 +DEPENDS_GETTEXT = virtual/gettext gettext-native
 +OECONFNLSOPTION = --enable-nls
  
 -DEPENDS =+ ${DEPENDS_GETTEXT}
 -EXTRA_OECONF += --enable-nls
 +BASEDEPENDS =+ ${DEPENDS_GETTEXT}
 +EXTRA_OECONF += ${OECONFNLSOPTION}
 
 
 

This has the same problem It empties out DEPENDS_GETTEXT after they have
have already been added to DEPENDS via virtclass e.g. when you build
gcc-runtime-nativesdk it will report a dep loop since now it depends on
virtual/gettext-nativesdk (added by gettext class)
and virtual/gettext-nativesdk depends on compilerlibs
provided by gcc-runtime-nativesdk. This was same problem I was trying to
circumvent



-- 
-Khem

___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-05-03 Thread Richard Purdie
On Tue, 2011-05-03 at 11:04 -0700, Khem Raj wrote:
 This has the same problem It empties out DEPENDS_GETTEXT after they have
 have already been added to DEPENDS via virtclass e.g. when you build
 gcc-runtime-nativesdk it will report a dep loop since now it depends on
 virtual/gettext-nativesdk (added by gettext class)
 and virtual/gettext-nativesdk depends on compilerlibs
 provided by gcc-runtime-nativesdk. This was same problem I was trying to
 circumvent

Ok, how about this version:

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 4f20bc2..3b83e42 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -89,9 +89,11 @@ def base_dep_prepend(d):
deps +=  virtual/${TARGET_PREFIX}gcc 
virtual/${TARGET_PREFIX}compilerlibs virtual/libc 
return deps
 
-DEPENDS_prepend=${@base_dep_prepend(d)} 
-DEPENDS_virtclass-native_prepend=${@base_dep_prepend(d)} 
-DEPENDS_virtclass-nativesdk_prepend=${@base_dep_prepend(d)} 
+BASEDEPENDS = ${@base_dep_prepend(d)}
+
+DEPENDS_prepend=${BASEDEPENDS} 
+DEPENDS_virtclass-native_prepend=${BASEDEPENDS} 
+DEPENDS_virtclass-nativesdk_prepend=${BASEDEPENDS} 
 
 FILESPATH = ${@base_set_filespath([ ${FILE_DIRNAME}/${PF}, 
${FILE_DIRNAME}/${P}, ${FILE_DIRNAME}/${PN}, ${FILE_DIRNAME}/${BP}, 
${FILE_DIRNAME}/${BPN}, ${FILE_DIRNAME}/files, ${FILE_DIRNAME} ], d)}
 # THISDIR only works properly with imediate expansion as it has to run
diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
index a40e74f..6f79e5e 100644
--- a/meta/classes/gettext.bbclass
+++ b/meta/classes/gettext.bbclass
@@ -1,17 +1,17 @@
-def gettext_after_parse(d):
-# Remove the NLS bits if USE_NLS is no.
-if bb.data.getVar('USE_NLS', d, 1) == 'no':
-cfg = oe_filter_out('^--(dis|en)able-nls$', 
bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
-cfg +=  --disable-nls
-depends = bb.data.getVar('DEPENDS', d, 1) or 
-bb.data.setVar('DEPENDS', 
oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
-bb.data.setVar('EXTRA_OECONF', cfg, d)
+def gettext_dependencies(d):
+if d.getVar('USE_NLS', True) == 'no':
+return 
+if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True) and not 
oe.utils.inherits(d, 'cross-canadian'):
+return 
+return d.getVar('DEPENDS_GETTEXT', False)
 
-python () {
-gettext_after_parse(d)
-}
+def gettext_oeconf(d):
+# Remove the NLS bits if USE_NLS is no.
+if d.getVar('USE_NLS', True) == 'no':
+return '--disable-nls'
+return --enable-nls
 
-DEPENDS_GETTEXT = gettext gettext-native
+DEPENDS_GETTEXT = virtual/gettext gettext-native
 
-DEPENDS =+ ${DEPENDS_GETTEXT}
-EXTRA_OECONF += --enable-nls
+BASEDEPENDS =+ ${@gettext_dependencies(d)}
+EXTRA_OECONF += ${@gettext_oeconf(d)}


___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-04-29 Thread Khem Raj
On Thu, Apr 28, 2011 at 2:01 AM, Richard Purdie
richard.pur...@linuxfoundation.org wrote:
 We can make this simpler. We should just setVar(DEPENDS_GETTEXT, )
 in the INHIBIT_DEFAULT_DEPS case. If anything is expanding the variables
 somewhere, we should fix that.


Infact the virtclass stuff complicates this since they are evaluated
specially and I am not clear weather _append gets
evaluation before that or after and also the anon python function
evaluation as the one we are defining in this class.

I tried to empty out DEPENDS_GETTEXT but it does not work in nativesdk cases.

 In fact, rather than all this ugly manipulation can't we just set
 DEPENDS_GETTEXT to  in the INHIBIT_DEFAULT_DEPS or USE_NLS cases? If
 that doesn't work, the recipes dependencies are broken and should be
 fixed to inherit this class, right?


___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-04-28 Thread Richard Purdie
On Wed, 2011-04-27 at 00:29 -0700, Saul Wold wrote:
 From: Khem Raj raj.k...@gmail.com
 
 Ensure gettext and gettext-native are removed from DEPENDS when
 not using NLS
 
 Use append instead of += to get gettext dependecies processed
 correctly in all cases
 
 Dont remove gettext-native for native recipes as ENABLE_NLS is
 only for target and not for native recipes
 
 Replace using 1 for a boolean type with True
 
 Honor INHIBIT_DEFAULT_DEPS
 
 Remove the added dependencies for gettext if INHIBIT_DEFAULT_DEPS is non
 null
 
 operate on virtclass overrides individually
 
 virtclass classes are parsed at the end hence
 just doing DEPENDS munging is not enough since
 it will be overridden

This patch is better but I have a couple of things I'd like to see
tweaked.

 Signed-off-by: Khem Raj raj.k...@gmail.com
 ---
  meta/classes/gettext.bbclass |   38 ++
  1 files changed, 26 insertions(+), 12 deletions(-)
 
 diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
 index a40e74f..f7b84ec 100644
 --- a/meta/classes/gettext.bbclass
 +++ b/meta/classes/gettext.bbclass
 @@ -1,17 +1,31 @@
  def gettext_after_parse(d):
 -# Remove the NLS bits if USE_NLS is no.
 -if bb.data.getVar('USE_NLS', d, 1) == 'no':
 -cfg = oe_filter_out('^--(dis|en)able-nls$', 
 bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
 -cfg +=  --disable-nls
 -depends = bb.data.getVar('DEPENDS', d, 1) or 
 -bb.data.setVar('DEPENDS', 
 oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
 -bb.data.setVar('EXTRA_OECONF', cfg, d)
 -
 +   # Remove the NLS bits if USE_NLS is no.
 +   if bb.data.getVar('USE_NLS', d, True) == 'no':
 +   cfg = oe_filter_out('^--(dis|en)able-nls$', 
 bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
 +   cfg +=  --disable-nls
 +   depends = bb.data.getVar('DEPENDS', d, True) or 

These lines all look the same but the indentation is different. Python
should always be four spaces and indentation changes should always be as
a separate patch from code changes anyway. Please fix :)

 +   depends = 
 oe_filter_out('^(virtual/libiconv|virtual/libintl|virtual/gettext|gettext)$', 
 depends, d)
 +   if not oe.utils.inherits(d, 'native', 'nativesdk', 'cross', 
 'crosssdk'):
 +   depends = oe_filter_out('^(gettext-native)$', depends, d)
 +   bb.data.setVar('DEPENDS', depends, d)
 +   bb.data.setVar('EXTRA_OECONF', cfg, d)
 +   # check if INHIBIT_DEFAULT_DEPS is 1 then we forcibly remove dependencies
 +   # added by this class through DEPENDS_GETTEXT
 +   if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True):
 +   depends_native = bb.data.getVar('DEPENDS_virtclass-native', d, True) 
 or 
 +   depends_nativesdk = bb.data.getVar('DEPENDS_virtclass-nativesdk', d, 
 True) or 
 +   depends = bb.data.getVar('DEPENDS', d, True) or 
 +   gettext_deps = bb.data.getVar('DEPENDS_GETTEXT', d, True).replace(' 
 ','|')
 +   gettext_deps = '^(' + gettext_deps + ')$'
 +   depends_native = oe_filter_out(gettext_deps, depends_native, d)
 +   depends_nativesdk = oe_filter_out(gettext_deps, depends_nativesdk, d)
 +   depends = oe_filter_out(gettext_deps, depends, d)
 +   bb.data.setVar('DEPENDS_virtclass-native', depends, d)
 +   bb.data.setVar('DEPENDS_virtclass-nativesdk', depends, d)
 +   bb.data.setVar('DEPENDS', depends, d)

We can make this simpler. We should just setVar(DEPENDS_GETTEXT, )
in the INHIBIT_DEFAULT_DEPS case. If anything is expanding the variables
somewhere, we should fix that.

In fact, rather than all this ugly manipulation can't we just set
DEPENDS_GETTEXT to  in the INHIBIT_DEFAULT_DEPS or USE_NLS cases? If
that doesn't work, the recipes dependencies are broken and should be
fixed to inherit this class, right? 

  python () {
  gettext_after_parse(d)
  }
 -
 -DEPENDS_GETTEXT = gettext gettext-native
 -
 -DEPENDS =+ ${DEPENDS_GETTEXT}
  EXTRA_OECONF += --enable-nls
 +DEPENDS_GETTEXT ?= virtual/gettext
 +DEPENDS_append =  ${DEPENDS_GETTEXT} 

I think this needs to be:

DEPENDS_GETTEXT ?= virtual/gettext virtual/gettext-native

as I'm sure we're been bitten by a lack of the native dependency
before :/. Target packages using gettext do definitely need both to be
available.

Cheers,

Richard


___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core


[OE-core] [PATCH 36/52] gettext.bbclass: Use _append instead of =+

2011-04-27 Thread Saul Wold
From: Khem Raj raj.k...@gmail.com

Ensure gettext and gettext-native are removed from DEPENDS when
not using NLS

Use append instead of += to get gettext dependecies processed
correctly in all cases

Dont remove gettext-native for native recipes as ENABLE_NLS is
only for target and not for native recipes

Replace using 1 for a boolean type with True

Honor INHIBIT_DEFAULT_DEPS

Remove the added dependencies for gettext if INHIBIT_DEFAULT_DEPS is non
null

operate on virtclass overrides individually

virtclass classes are parsed at the end hence
just doing DEPENDS munging is not enough since
it will be overridden

Signed-off-by: Khem Raj raj.k...@gmail.com
---
 meta/classes/gettext.bbclass |   38 ++
 1 files changed, 26 insertions(+), 12 deletions(-)

diff --git a/meta/classes/gettext.bbclass b/meta/classes/gettext.bbclass
index a40e74f..f7b84ec 100644
--- a/meta/classes/gettext.bbclass
+++ b/meta/classes/gettext.bbclass
@@ -1,17 +1,31 @@
 def gettext_after_parse(d):
-# Remove the NLS bits if USE_NLS is no.
-if bb.data.getVar('USE_NLS', d, 1) == 'no':
-cfg = oe_filter_out('^--(dis|en)able-nls$', 
bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
-cfg +=  --disable-nls
-depends = bb.data.getVar('DEPENDS', d, 1) or 
-bb.data.setVar('DEPENDS', 
oe_filter_out('^(virtual/libiconv|virtual/libintl)$', depends, d), d)
-bb.data.setVar('EXTRA_OECONF', cfg, d)
-
+   # Remove the NLS bits if USE_NLS is no.
+   if bb.data.getVar('USE_NLS', d, True) == 'no':
+   cfg = oe_filter_out('^--(dis|en)able-nls$', 
bb.data.getVar('EXTRA_OECONF', d, 1) or , d)
+   cfg +=  --disable-nls
+   depends = bb.data.getVar('DEPENDS', d, True) or 
+   depends = 
oe_filter_out('^(virtual/libiconv|virtual/libintl|virtual/gettext|gettext)$', 
depends, d)
+   if not oe.utils.inherits(d, 'native', 'nativesdk', 'cross', 'crosssdk'):
+   depends = oe_filter_out('^(gettext-native)$', depends, d)
+   bb.data.setVar('DEPENDS', depends, d)
+   bb.data.setVar('EXTRA_OECONF', cfg, d)
+   # check if INHIBIT_DEFAULT_DEPS is 1 then we forcibly remove dependencies
+   # added by this class through DEPENDS_GETTEXT
+   if bb.data.getVar('INHIBIT_DEFAULT_DEPS', d, True):
+   depends_native = bb.data.getVar('DEPENDS_virtclass-native', d, True) or 

+   depends_nativesdk = bb.data.getVar('DEPENDS_virtclass-nativesdk', d, 
True) or 
+   depends = bb.data.getVar('DEPENDS', d, True) or 
+   gettext_deps = bb.data.getVar('DEPENDS_GETTEXT', d, True).replace(' 
','|')
+   gettext_deps = '^(' + gettext_deps + ')$'
+   depends_native = oe_filter_out(gettext_deps, depends_native, d)
+   depends_nativesdk = oe_filter_out(gettext_deps, depends_nativesdk, d)
+   depends = oe_filter_out(gettext_deps, depends, d)
+   bb.data.setVar('DEPENDS_virtclass-native', depends, d)
+   bb.data.setVar('DEPENDS_virtclass-nativesdk', depends, d)
+   bb.data.setVar('DEPENDS', depends, d)
 python () {
 gettext_after_parse(d)
 }
-
-DEPENDS_GETTEXT = gettext gettext-native
-
-DEPENDS =+ ${DEPENDS_GETTEXT}
 EXTRA_OECONF += --enable-nls
+DEPENDS_GETTEXT ?= virtual/gettext
+DEPENDS_append =  ${DEPENDS_GETTEXT} 
-- 
1.7.1.1


___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core