diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
commit | 1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch) | |
tree | 0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-oe/recipes-devtools/swig | |
download | meta-openembedded-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-oe/recipes-devtools/swig')
3 files changed, 139 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/swig/swig.inc b/meta-oe/recipes-devtools/swig/swig.inc new file mode 100644 index 0000000000..9821fa560b --- /dev/null +++ b/meta-oe/recipes-devtools/swig/swig.inc | |||
@@ -0,0 +1,63 @@ | |||
1 | DESCRIPTION = "SWIG - Simplified Wrapper and Interface Generator" | ||
2 | HOMEPAGE = "http://swig.sourceforge.net/" | ||
3 | LICENSE = "BSD & GPLv3" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \ | ||
5 | file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \ | ||
6 | file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08" | ||
7 | |||
8 | SECTION = "devel" | ||
9 | |||
10 | DEPENDS = "libpcre python" | ||
11 | |||
12 | SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz" | ||
13 | |||
14 | inherit autotools pythonnative | ||
15 | |||
16 | EXTRA_OECONF = " \ | ||
17 | --with-python=${PYTHON} \ | ||
18 | --without-allegrocl \ | ||
19 | --without-android \ | ||
20 | --without-boost \ | ||
21 | --without-chicken \ | ||
22 | --without-clisp \ | ||
23 | --without-csharp \ | ||
24 | --without-d \ | ||
25 | --without-gcj \ | ||
26 | --without-go \ | ||
27 | --without-guile \ | ||
28 | --without-java \ | ||
29 | --without-lua \ | ||
30 | --without-mzscheme \ | ||
31 | --without-ocaml \ | ||
32 | --without-octave \ | ||
33 | --without-perl5 \ | ||
34 | --without-pike \ | ||
35 | --without-php \ | ||
36 | --without-python3 \ | ||
37 | --without-r \ | ||
38 | --without-ruby \ | ||
39 | --without-tcl \ | ||
40 | " | ||
41 | |||
42 | BBCLASSEXTEND = "native nativesdk" | ||
43 | |||
44 | do_configure() { | ||
45 | install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/Tools/config | ||
46 | install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/Tools/config | ||
47 | install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S} | ||
48 | install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S} | ||
49 | oe_runconf | ||
50 | } | ||
51 | |||
52 | do_install_append_class-nativesdk() { | ||
53 | cd ${D}${bindir} | ||
54 | ln -s swig swig2.0 | ||
55 | } | ||
56 | |||
57 | def swiglib_relpath(d): | ||
58 | swiglib = d.getVar('datadir', True) + "/" + d.getVar('BPN', True) + "/" + d.getVar('PV', True) | ||
59 | return os.path.relpath(swiglib, d.getVar('bindir', True)) | ||
60 | |||
61 | do_install_append_class-native() { | ||
62 | create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)} | ||
63 | } | ||
diff --git a/meta-oe/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/meta-oe/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch new file mode 100644 index 0000000000..81df3e264f --- /dev/null +++ b/meta-oe/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | From a4a0440a644c6c5e5da096efe3cf05ba309a284f Mon Sep 17 00:00:00 2001 | ||
2 | From: "NODA, Kai" <nodakai@gmail.com> | ||
3 | Date: Sun, 22 Apr 2012 17:01:02 +0900 | ||
4 | Subject: [PATCH] Use /proc/self/exe for "swig -swiglib" on non-Win32 | ||
5 | platforms. | ||
6 | |||
7 | If it wasn't found, then fall back to a fixed string just as before. | ||
8 | |||
9 | Upstream-Status: Submitted | ||
10 | http://sourceforge.net/mailarchive/message.php?msg_id=29179733 | ||
11 | |||
12 | --- | ||
13 | Source/Modules/main.cxx | 24 ++++++++++++++++++++++-- | ||
14 | 1 file changed, 22 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx | ||
17 | index d2f5d3b..cbb0a12 100644 | ||
18 | --- a/Source/Modules/main.cxx | ||
19 | +++ b/Source/Modules/main.cxx | ||
20 | @@ -26,6 +26,11 @@ char cvsroot_main_cxx[] = "$Id$"; | ||
21 | #include "cparse.h" | ||
22 | #include <ctype.h> | ||
23 | #include <limits.h> // for INT_MAX | ||
24 | +#ifndef _WIN32 | ||
25 | +#include <cstddef> | ||
26 | +#include <unistd.h> // for readlink | ||
27 | +#include <sys/stat.h> // for stat | ||
28 | +#endif | ||
29 | |||
30 | // Global variables | ||
31 | |||
32 | @@ -902,9 +907,9 @@ int SWIG_main(int argc, char *argv[], Language *l) { | ||
33 | |||
34 | // Check for SWIG_LIB environment variable | ||
35 | if ((c = getenv("SWIG_LIB")) == (char *) 0) { | ||
36 | + char *p; | ||
37 | #if defined(_WIN32) | ||
38 | char buf[MAX_PATH]; | ||
39 | - char *p; | ||
40 | if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) { | ||
41 | *(p + 1) = '\0'; | ||
42 | SwigLib = NewStringf("%sLib", buf); // Native windows installation path | ||
43 | @@ -914,7 +919,22 @@ int SWIG_main(int argc, char *argv[], Language *l) { | ||
44 | if (Len(SWIG_LIB_WIN_UNIX) > 0) | ||
45 | SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw) | ||
46 | #else | ||
47 | - SwigLib = NewString(SWIG_LIB); | ||
48 | + char buf[PATH_MAX]; | ||
49 | + if (0 < ::readlink("/proc/self/exe", buf, sizeof(buf)) && | ||
50 | + (p = ::strstr(buf, "/bin/swig"))) { | ||
51 | + int major, minor, patch; | ||
52 | + const int ret = ::sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch); | ||
53 | + if (3 == ret) { | ||
54 | + const ::ptrdiff_t dir_part_len = p - buf; | ||
55 | + ::snprintf(p, PATH_MAX - dir_part_len, "/share/swig/%d.%d.%d", major, minor, patch); | ||
56 | + struct ::stat stat_res; | ||
57 | + if (0 == ::stat(buf, &stat_res) && S_ISDIR(stat_res.st_mode)) { | ||
58 | + SwigLib = NewString(buf); | ||
59 | + } | ||
60 | + } | ||
61 | + } | ||
62 | + if (NULL == SwigLib) | ||
63 | + SwigLib = NewString(SWIG_LIB); | ||
64 | #endif | ||
65 | } else { | ||
66 | SwigLib = NewString(c); | ||
67 | -- | ||
68 | 1.7.9.5 | ||
69 | |||
diff --git a/meta-oe/recipes-devtools/swig/swig_2.0.12.bb b/meta-oe/recipes-devtools/swig/swig_2.0.12.bb new file mode 100644 index 0000000000..0fbcfa1bf5 --- /dev/null +++ b/meta-oe/recipes-devtools/swig/swig_2.0.12.bb | |||
@@ -0,0 +1,7 @@ | |||
1 | require ${BPN}.inc | ||
2 | |||
3 | SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch" | ||
4 | |||
5 | SRC_URI[md5sum] = "c3fb0b2d710cc82ed0154b91e43085a4" | ||
6 | SRC_URI[sha256sum] = "65e13f22a60cecd7279c59882ff8ebe1ffe34078e85c602821a541817a4317f7" | ||
7 | |||