Skip to contentSkip to conversation

swig: add native wrapper for SWIGLIB

PATCH Applied Kai Kang 2 participants 4 messages Apr 9, 2014 – Apr 20, 2014

lore
Share & tools
lore

Kai Kang

author
#0 lore raw

PATCH 1/1 swig: add native wrapper for SWIGLIB

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.

---
 meta-oe/recipes-devtools/swig/swig.inc | 7 +++++++
 1 file changed, 7 insertions(+)
meta-oe/recipes-devtools/swig/swig.inc +7 -0
index 8e83526..96cd02a 100644
@@ -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)}
+}
Signature · 1 line
1.8.4
#1 lore raw
Quoted 20 lines · Kai Kang

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.

---
 meta-oe/recipes-devtools/swig/swig.inc | 7 +++++++
 1 file changed, 7 insertions(+)
meta-oe/recipes-devtools/swig/swig.inc +0 -0
index 8e83526..96cd02a 100644

meta-oe/recipes-devtools/swig/swig.inc do_configure() { · line 58

Quoted 9 lines
meta-oe/recipes-devtools/swig/swig.inc +6 -0
@@ -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.

Quoted 9 lines
meta-oe/recipes-devtools/swig/swig.inc +1 -0
+}
Signature · 7 lines
1.8.4

-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
author
#2 lore raw
Quoted 24 lines · Martin Jansa
Quoted 23 lines · Kai Kang

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.

---
  meta-oe/recipes-devtools/swig/swig.inc | 7 +++++++
  1 file changed, 7 insertions(+)
meta-oe/recipes-devtools/swig/swig.inc +0 -0
index 8e83526..96cd02a 100644
@@ -50,3 +50,10 @@ do_configure() {
      oe_runconf
  }
 
Quoted 8 lines

meta-oe/recipes-devtools/swig/swig.inc do_configure() { · line 58

Quoted 6 lines
meta-oe/recipes-devtools/swig/swig.inc +6 -0
+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

Quoted 12 lines
Quoted 10 lines
meta-oe/recipes-devtools/swig/swig.inc +1 -0
+}
Signature · 7 lines
1.8.4

-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 2 lines
Regards,
Neil | Kai Kang
Applied
#3 lore raw
In reply to Kai Kang
Quoted 7 lines · Kai Kang

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!

Quoted 31 lines
---
 meta-oe/recipes-devtools/swig/swig.inc | 7 +++++++
 1 file changed, 7 insertions(+)
meta-oe/recipes-devtools/swig/swig.inc +7 -0
index 8e83526..96cd02a 100644
@@ -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)}
+}
Signature · 7 lines
1.8.4

-- 
_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-devel
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]