From 2ed614a15330b40a8440f91193a78535f857c7f9 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Tue, 17 Sep 2013 14:43:41 -0500 Subject: swig: Update to latest swig from meta-openembedded Updated from: git://git.openembedded.org/meta-openembedded/meta-oe/recipes-devtools/swig As of commit 1d536390dcafe4d539335dec2173aa9ddc3d8b51 Signed-off-by: Mark Hatle Signed-off-by: Joe MacDonald --- recipes-devtools/swig/swig.inc | 46 ++++++++++++--- ...lf-exe-for-swig-swiglib-on-non-Win32-plat.patch | 69 ++++++++++++++++++++++ recipes-devtools/swig/swig_2.0.0.bb | 7 --- recipes-devtools/swig/swig_2.0.10.bb | 9 +++ 4 files changed, 115 insertions(+), 16 deletions(-) create mode 100644 recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch delete mode 100644 recipes-devtools/swig/swig_2.0.0.bb create mode 100644 recipes-devtools/swig/swig_2.0.10.bb diff --git a/recipes-devtools/swig/swig.inc b/recipes-devtools/swig/swig.inc index 833c767..74ce506 100644 --- a/recipes-devtools/swig/swig.inc +++ b/recipes-devtools/swig/swig.inc @@ -3,23 +3,51 @@ HOMEPAGE = "http://swig.sourceforge.net/" LICENSE = "BSD & GPLv3" LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \ file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \ - file://LICENSE-UNIVERSITIES;md5=e0eaeeef7b2662c0c2d0d3c0b2509f75" + file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08" SECTION = "devel" -INC_PR = "r2" +INC_PR = "r3" -DEPENDS = "python" +DEPENDS = "libpcre python" SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz" -inherit autotools - -EXTRA_OECONF = " --without-guile " - -BBCLASSEXTEND = "native" +inherit autotools pythonnative + +EXTRA_OECONF = " \ + --with-python=${PYTHON} \ + --without-allegrocl \ + --without-android \ + --without-boost \ + --without-chicken \ + --without-clisp \ + --without-csharp \ + --without-d \ + --without-gcj \ + --without-go \ + --without-guile \ + --without-java \ + --without-lua \ + --without-mzscheme \ + --without-ocaml \ + --without-octave \ + --without-perl5 \ + --without-pike \ + --without-php \ + --without-python3 \ + --without-r \ + --without-ruby \ + --without-tcl \ +" + +BBCLASSEXTEND = "native nativesdk" do_configure() { - oe_runconf + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/Tools/config + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/Tools/config + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S} + install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S} + oe_runconf } def swiglib_relpath(d): diff --git a/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch new file mode 100644 index 0000000..81df3e2 --- /dev/null +++ b/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch @@ -0,0 +1,69 @@ +From a4a0440a644c6c5e5da096efe3cf05ba309a284f Mon Sep 17 00:00:00 2001 +From: "NODA, Kai" +Date: Sun, 22 Apr 2012 17:01:02 +0900 +Subject: [PATCH] Use /proc/self/exe for "swig -swiglib" on non-Win32 + platforms. + +If it wasn't found, then fall back to a fixed string just as before. + +Upstream-Status: Submitted +http://sourceforge.net/mailarchive/message.php?msg_id=29179733 + +--- + Source/Modules/main.cxx | 24 ++++++++++++++++++++++-- + 1 file changed, 22 insertions(+), 2 deletions(-) + +diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx +index d2f5d3b..cbb0a12 100644 +--- a/Source/Modules/main.cxx ++++ b/Source/Modules/main.cxx +@@ -26,6 +26,11 @@ char cvsroot_main_cxx[] = "$Id$"; + #include "cparse.h" + #include + #include // for INT_MAX ++#ifndef _WIN32 ++#include ++#include // for readlink ++#include // for stat ++#endif + + // Global variables + +@@ -902,9 +907,9 @@ int SWIG_main(int argc, char *argv[], Language *l) { + + // Check for SWIG_LIB environment variable + if ((c = getenv("SWIG_LIB")) == (char *) 0) { ++ char *p; + #if defined(_WIN32) + char buf[MAX_PATH]; +- char *p; + if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) { + *(p + 1) = '\0'; + SwigLib = NewStringf("%sLib", buf); // Native windows installation path +@@ -914,7 +919,22 @@ int SWIG_main(int argc, char *argv[], Language *l) { + if (Len(SWIG_LIB_WIN_UNIX) > 0) + SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw) + #else +- SwigLib = NewString(SWIG_LIB); ++ char buf[PATH_MAX]; ++ if (0 < ::readlink("/proc/self/exe", buf, sizeof(buf)) && ++ (p = ::strstr(buf, "/bin/swig"))) { ++ int major, minor, patch; ++ const int ret = ::sscanf(VERSION, "%d.%d.%d", &major, &minor, &patch); ++ if (3 == ret) { ++ const ::ptrdiff_t dir_part_len = p - buf; ++ ::snprintf(p, PATH_MAX - dir_part_len, "/share/swig/%d.%d.%d", major, minor, patch); ++ struct ::stat stat_res; ++ if (0 == ::stat(buf, &stat_res) && S_ISDIR(stat_res.st_mode)) { ++ SwigLib = NewString(buf); ++ } ++ } ++ } ++ if (NULL == SwigLib) ++ SwigLib = NewString(SWIG_LIB); + #endif + } else { + SwigLib = NewString(c); +-- +1.7.9.5 + diff --git a/recipes-devtools/swig/swig_2.0.0.bb b/recipes-devtools/swig/swig_2.0.0.bb deleted file mode 100644 index b443def..0000000 --- a/recipes-devtools/swig/swig_2.0.0.bb +++ /dev/null @@ -1,7 +0,0 @@ -require swig.inc - -PR = "${INC_PR}.0" - -SRC_URI[md5sum] = "36ee2d9974be46a9f0a36460af928eb9" -SRC_URI[sha256sum] = "2568d042d3c7cfbcb17e2471b0434bd3aa78d7a1829f9ef6f1b9fc522e4754ea" - diff --git a/recipes-devtools/swig/swig_2.0.10.bb b/recipes-devtools/swig/swig_2.0.10.bb new file mode 100644 index 0000000..312ce11 --- /dev/null +++ b/recipes-devtools/swig/swig_2.0.10.bb @@ -0,0 +1,9 @@ +require ${BPN}.inc + +PR = "${INC_PR}.0" + +SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch" + +SRC_URI[md5sum] = "6d5e7ad05b4a404e5e85db9befb70c9a" +SRC_URI[sha256sum] = "d1eef329e867124ce60838b5ad07c763146b6c8f250dd22a861ead7406f78e63" + -- cgit v1.2.3-54-g00ecf