Patchwork [meta-oe] swig: add native wrapper for SWIGLIB

login
register
mail settings
Submitter Kang Kai
Date April 9, 2014, 7:34 a.m.
Message ID <1397028897-4991-1-git-send-email-kai.kang@windriver.com>
Download mbox | patch
Permalink /patch/70347/
State Accepted, archived
Headers show

Comments

Kang Kai - April 9, 2014, 7:34 a.m.
Native swig will read data from hard-coded SWIGLIB or the same
environment variable.

While using sstate, the hard-coded SWIGLIB will point to the project
that create original sstates. This would cause build issues, so add
a wrapper to set the environment variable SWIGLIB to a relative path
on current sysroot.

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta-oe/recipes-devtools/swig/swig.inc | 7 +++++++
 1 file changed, 7 insertions(+)
Martin Jansa - April 10, 2014, 8:39 a.m.
On Wed, Apr 09, 2014 at 03:34:57PM +0800, Kai Kang wrote:
> Native swig will read data from hard-coded SWIGLIB or the same
> environment variable.
> 
> While using sstate, the hard-coded SWIGLIB will point to the project
> that create original sstates. This would cause build issues, so add
> a wrapper to set the environment variable SWIGLIB to a relative path
> on current sysroot.
> 
> Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  meta-oe/recipes-devtools/swig/swig.inc | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/meta-oe/recipes-devtools/swig/swig.inc b/meta-oe/recipes-devtools/swig/swig.inc
> index 8e83526..96cd02a 100644
> --- a/meta-oe/recipes-devtools/swig/swig.inc
> +++ b/meta-oe/recipes-devtools/swig/swig.inc
> @@ -50,3 +50,10 @@ do_configure() {
>      oe_runconf
>  }
>  
> +def swiglib_relpath(d):
> +    swiglib = d.getVar('datadir', True) + "/" + d.getVar('BPN', True) + "/" + d.getVar('PV', True)
> +    return os.path.relpath(swiglib, d.getVar('bindir', True))
> +
> +do_install_append_class-native() {
> +       create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)}

This should use 4 spaces for indentation, but I'll fix it while
cherry-picking => no need to resend.

> +}
> -- 
> 1.8.4
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Kang Kai - April 10, 2014, 9:37 a.m.
On 2014?04?10? 16:39, Martin Jansa wrote:
> On Wed, Apr 09, 2014 at 03:34:57PM +0800, Kai Kang wrote:
>> Native swig will read data from hard-coded SWIGLIB or the same
>> environment variable.
>>
>> While using sstate, the hard-coded SWIGLIB will point to the project
>> that create original sstates. This would cause build issues, so add
>> a wrapper to set the environment variable SWIGLIB to a relative path
>> on current sysroot.
>>
>> Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
>> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
>> Signed-off-by: Kai Kang <kai.kang@windriver.com>
>> ---
>>   meta-oe/recipes-devtools/swig/swig.inc | 7 +++++++
>>   1 file changed, 7 insertions(+)
>>
>> diff --git a/meta-oe/recipes-devtools/swig/swig.inc b/meta-oe/recipes-devtools/swig/swig.inc
>> index 8e83526..96cd02a 100644
>> --- a/meta-oe/recipes-devtools/swig/swig.inc
>> +++ b/meta-oe/recipes-devtools/swig/swig.inc
>> @@ -50,3 +50,10 @@ do_configure() {
>>       oe_runconf
>>   }
>>   
>> +def swiglib_relpath(d):
>> +    swiglib = d.getVar('datadir', True) + "/" + d.getVar('BPN', True) + "/" + d.getVar('PV', True)
>> +    return os.path.relpath(swiglib, d.getVar('bindir', True))
>> +
>> +do_install_append_class-native() {
>> +       create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)}
> This should use 4 spaces for indentation, but I'll fix it while
> cherry-picking => no need to resend.

Thanks.

--Kai

>
>> +}
>> -- 
>> 1.8.4
>>
>> -- 
>> _______________________________________________
>> Openembedded-devel mailing list
>> Openembedded-devel@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-devel
>
>
Martin Jansa - April 20, 2014, 9:26 a.m.
On Wed, Apr 09, 2014 at 03:34:57PM +0800, Kai Kang wrote:
> Native swig will read data from hard-coded SWIGLIB or the same
> environment variable.
> 
> While using sstate, the hard-coded SWIGLIB will point to the project
> that create original sstates. This would cause build issues, so add
> a wrapper to set the environment variable SWIGLIB to a relative path
> on current sysroot.

Merged, thanks!

> 
> Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
> Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>  meta-oe/recipes-devtools/swig/swig.inc | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/meta-oe/recipes-devtools/swig/swig.inc b/meta-oe/recipes-devtools/swig/swig.inc
> index 8e83526..96cd02a 100644
> --- a/meta-oe/recipes-devtools/swig/swig.inc
> +++ b/meta-oe/recipes-devtools/swig/swig.inc
> @@ -50,3 +50,10 @@ do_configure() {
>      oe_runconf
>  }
>  
> +def swiglib_relpath(d):
> +    swiglib = d.getVar('datadir', True) + "/" + d.getVar('BPN', True) + "/" + d.getVar('PV', True)
> +    return os.path.relpath(swiglib, d.getVar('bindir', True))
> +
> +do_install_append_class-native() {
> +       create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)}
> +}
> -- 
> 1.8.4
> 
> -- 
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel

Patch

diff --git a/meta-oe/recipes-devtools/swig/swig.inc b/meta-oe/recipes-devtools/swig/swig.inc
index 8e83526..96cd02a 100644
--- a/meta-oe/recipes-devtools/swig/swig.inc
+++ b/meta-oe/recipes-devtools/swig/swig.inc
@@ -50,3 +50,10 @@  do_configure() {
     oe_runconf
 }
 
+def swiglib_relpath(d):
+    swiglib = d.getVar('datadir', True) + "/" + d.getVar('BPN', True) + "/" + d.getVar('PV', True)
+    return os.path.relpath(swiglib, d.getVar('bindir', True))
+
+do_install_append_class-native() {
+       create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)}
+}