[meta-intel] [PATCH][meta-intel-iot-middleware] swig: update swig recipe to match meta-oe

brendan.le.foll at intel.com brendan.le.foll at intel.com
Thu Mar 26 10:15:01 PDT 2015


From: Brendan Le Foll <brendan.le.foll at intel.com>

The recipe keeps 3.0.5 and adds the relpath fixes for swig native that works
correctly. It also adds a patch for finding pcre using pkg-config. The only
difference with the upstream version is the explicit enabling of javascript &
version upgrade to 3.0.5

Signed-off-by: Brendan Le Foll <brendan.le.foll at intel.com>
---
 recipes-devtools/swig/swig.inc                     | 64 ++++++++++++++++++++++
 ...nfigure-use-pkg-config-for-pcre-detection.patch | 64 ++++++++++++++++++++++
 recipes-devtools/swig/swig_3.0.5.bb                | 51 +----------------
 3 files changed, 130 insertions(+), 49 deletions(-)
 create mode 100644 recipes-devtools/swig/swig.inc
 create mode 100644 recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch

diff --git a/recipes-devtools/swig/swig.inc b/recipes-devtools/swig/swig.inc
new file mode 100644
index 0000000..bcf1873
--- /dev/null
+++ b/recipes-devtools/swig/swig.inc
@@ -0,0 +1,64 @@
+DESCRIPTION = "SWIG - Simplified Wrapper and Interface Generator"
+HOMEPAGE = "http://swig.sourceforge.net/"
+LICENSE = "BSD & GPLv3"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \
+                    file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \
+                    file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08"
+
+SECTION = "devel"
+
+DEPENDS = "libpcre python nodejs"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz"
+
+inherit autotools pythonnative
+
+EXTRA_OECONF = " \
+    --with-python=${PYTHON} \
+    --with-javascript \
+    --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() {
+    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
+}
+
+do_install_append_class-nativesdk() {
+    cd ${D}${bindir}
+    ln -s swig swig2.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)}
+}
diff --git a/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch b/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
new file mode 100644
index 0000000..1b1128a
--- /dev/null
+++ b/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch
@@ -0,0 +1,64 @@
+From 5c4d6d8538994d5fe9b3b46bfafaf0a605e3bda6 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen.kooi at linaro.org>
+Date: Tue, 17 Jun 2014 08:18:17 +0200
+Subject: [PATCH] configure: use pkg-config for pcre detection
+
+Signed-off-by: Koen Kooi <koen.kooi at linaro.org>
+Upstream-Status: pending
+---
+ configure.ac | 38 +++++++-------------------------------
+ 1 file changed, 7 insertions(+), 31 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0c984b7..6edcec1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -70,38 +70,14 @@ AC_MSG_RESULT([$with_pcre])
+ 
+ dnl To make configuring easier, check for a locally built PCRE using the Tools/pcre-build.sh script
+ if test x"${with_pcre}" = xyes ; then
+-  AC_MSG_CHECKING([whether to use local PCRE])
+-  local_pcre_config=no
+-  if test -z $PCRE_CONFIG; then
+-    if test -f `pwd`/pcre/pcre-swig-install/bin/pcre-config; then
+-      PCRE_CONFIG=`pwd`/pcre/pcre-swig-install/bin/pcre-config
+-      local_pcre_config=$PCRE_CONFIG
+-    fi
+-  fi
+-  AC_MSG_RESULT([$local_pcre_config])
+-fi
+-AS_IF([test "x$with_pcre" != xno],
+-  [AX_PATH_GENERIC([pcre],
+-    [], dnl Minimal version of PCRE we need -- accept any
+-    [], dnl custom sed script for version parsing is not needed
+-    [AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
+-     LIBS="$LIBS $PCRE_LIBS"
+-     CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
+-    ],
+-    [AC_MSG_FAILURE([
+-        Cannot find pcre-config script from PCRE (Perl Compatible Regular Expressions)
+-        library package. This dependency is needed for configure to complete,
+-        Either:
+-        - Install the PCRE developer package on your system (preferred approach).
+-        - Download the PCRE source tarball, build and install on your system
+-          as you would for any package built from source distribution.
+-        - Use the Tools/pcre-build.sh script to build PCRE just for SWIG to statically
+-          link against. Run 'Tools/pcre-build.sh --help' for instructions.
+-          (quite easy and does not require privileges to install PCRE on your system)
+-        - Use configure --without-pcre to disable regular expressions support in SWIG
+-          (not recommended).])
+-    ])
++  PKG_CHECK_MODULES([PCRE], [libpcre], [
++    AC_DEFINE([HAVE_PCRE], [1], [Define if you have PCRE library])
++    LIBS="$LIBS $PCRE_LIBS"
++    CPPFLAGS="$CPPFLAGS $PCRE_CFLAGS"
++  ], [
++    AC_MSG_WARN([$PCRE_PKG_ERRORS])
+   ])
++fi
+ 
+ 
+ dnl CCache
+-- 
+1.9.3
+
diff --git a/recipes-devtools/swig/swig_3.0.5.bb b/recipes-devtools/swig/swig_3.0.5.bb
index 39ddaeb..7c3b789 100644
--- a/recipes-devtools/swig/swig_3.0.5.bb
+++ b/recipes-devtools/swig/swig_3.0.5.bb
@@ -1,53 +1,6 @@
-DESCRIPTION = "SWIG - Simplified Wrapper and Interface Generator"
-HOMEPAGE = "http://swig.sourceforge.net/"
-LICENSE = "BSD & GPLv3"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \
-                    file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \
-                    file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08"
+require ${BPN}.inc
 
-SECTION = "devel"
+SRC_URI += " file://0001-configure-use-pkg-config-for-pcre-detection.patch"
 
-DEPENDS = "libpcre python nodejs"
-
-inherit autotools pythonnative
-
-BBCLASSEXTEND = "native"
-
-SRC_URI = "http://prdownloads.sourceforge.net/swig/swig-${PV}.tar.gz"
 SRC_URI[md5sum] = "dcb9638324461b9baba8e044fe59031d"
 SRC_URI[sha256sum] = "9f4cb9e8f213f041853646f58fe5e8428d63250d05f5c943b6fa759c77322a3c"
-
-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 \
-    --disable-ccache \
-"
-
-do_configure() {
-   export NOCONFIGURE="no"; ./autogen.sh
-   oe_runconf
-}
-
-FILES_${PN} += "${datadir}/*"
-FILES_${PN}-native += "${datadir}/*"
-- 
2.3.2



More information about the meta-intel mailing list