diff options
Diffstat (limited to 'meta/recipes-devtools/swig')
-rw-r--r-- | meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch | 64 | ||||
-rw-r--r-- | meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch | 59 | ||||
-rw-r--r-- | meta/recipes-devtools/swig/swig/determinism.patch | 13 | ||||
-rw-r--r-- | meta/recipes-devtools/swig/swig_4.0.2.bb | 7 | ||||
-rw-r--r-- | meta/recipes-devtools/swig/swig_4.2.1.bb (renamed from meta/recipes-devtools/swig/swig.inc) | 52 |
5 files changed, 26 insertions, 169 deletions
diff --git a/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch b/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch deleted file mode 100644 index f27f80ea18..0000000000 --- a/meta/recipes-devtools/swig/swig/0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch +++ /dev/null @@ -1,64 +0,0 @@ -From a4a0440a644c6c5e5da096efe3cf05ba309a284f Mon Sep 17 00:00:00 2001 -From: "NODA, Kai" <nodakai@gmail.com> -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(-) - ---- a/Source/Modules/main.cxx -+++ b/Source/Modules/main.cxx -@@ -25,6 +25,11 @@ - #include <ctype.h> - #include <errno.h> - #include <limits.h> // for INT_MAX -+#ifndef _WIN32 -+#include <cstddef> -+#include <unistd.h> // for readlink -+#include <sys/stat.h> // for stat -+#endif - - // Global variables - -@@ -934,9 +939,9 @@ int SWIG_main(int argc, char *argv[], co - - // 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 -@@ -946,7 +951,22 @@ int SWIG_main(int argc, char *argv[], co - 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); diff --git a/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch b/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch deleted file mode 100644 index fdb9760e89..0000000000 --- a/meta/recipes-devtools/swig/swig/0001-configure-use-pkg-config-for-pcre-detection.patch +++ /dev/null @@ -1,59 +0,0 @@ -From 5c4d6d8538994d5fe9b3b46bfafaf0a605e3bda6 Mon Sep 17 00:00:00 2001 -From: Koen Kooi <koen.kooi@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@linaro.org> -Upstream-Status: Pending ---- - configure.ac | 38 +++++++------------------------------- - 1 file changed, 7 insertions(+), 31 deletions(-) - ---- a/configure.ac -+++ b/configure.ac -@@ -52,38 +52,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 diff --git a/meta/recipes-devtools/swig/swig/determinism.patch b/meta/recipes-devtools/swig/swig/determinism.patch index 84c399182a..9c49414ad7 100644 --- a/meta/recipes-devtools/swig/swig/determinism.patch +++ b/meta/recipes-devtools/swig/swig/determinism.patch @@ -1,13 +1,22 @@ +From 28648b3873d83e26bd19b64ce2c0a41ced9292d3 Mon Sep 17 00:00:00 2001 +From: Richard Purdie <richard.purdie@linuxfoundation.org> +Date: Mon, 1 Mar 2021 00:11:10 +0000 +Subject: [PATCH] swig: Fix reproducibility issue + Remove the compiler commandline/platform from the compiled binary as this breaks reproducibilty. Upstream-Status: Inappropriate [OE reproducibiity fix upstream unlikely to take] RP 2021/3/1 +--- + Source/Modules/main.cxx | 1 - + 1 file changed, 1 deletion(-) - +diff --git a/Source/Modules/main.cxx b/Source/Modules/main.cxx +index de0a512..ac9e825 100644 --- a/Source/Modules/main.cxx +++ b/Source/Modules/main.cxx -@@ -642,7 +642,6 @@ static void getoptions(int argc, char *a +@@ -638,7 +638,6 @@ static void getoptions(int argc, char *argv[]) { } } else if (strcmp(argv[i], "-version") == 0) { fprintf(stdout, "\nSWIG Version %s\n", Swig_package_version()); diff --git a/meta/recipes-devtools/swig/swig_4.0.2.bb b/meta/recipes-devtools/swig/swig_4.0.2.bb deleted file mode 100644 index 718ad89a5d..0000000000 --- a/meta/recipes-devtools/swig/swig_4.0.2.bb +++ /dev/null @@ -1,7 +0,0 @@ -require ${BPN}.inc - -SRC_URI += "file://0001-Use-proc-self-exe-for-swig-swiglib-on-non-Win32-plat.patch \ - file://0001-configure-use-pkg-config-for-pcre-detection.patch \ - file://determinism.patch \ - " -SRC_URI[sha256sum] = "d53be9730d8d58a16bf0cbd1f8ac0c0c3e1090573168bfa151b01eb47fa906fc" diff --git a/meta/recipes-devtools/swig/swig.inc b/meta/recipes-devtools/swig/swig_4.2.1.bb index e8562a91bb..b564be9b36 100644 --- a/meta/recipes-devtools/swig/swig.inc +++ b/meta/recipes-devtools/swig/swig_4.2.1.bb @@ -3,56 +3,26 @@ DESCRIPTION = "SWIG is a compiler that makes it easy to integrate C and C++ \ code with other languages including Perl, Tcl, Ruby, Python, Java, Guile, \ Mzscheme, Chicken, OCaml, Pike, and C#." HOMEPAGE = "http://swig.sourceforge.net/" -LICENSE = "BSD-3-Clause & GPLv3" +LICENSE = "BSD-3-Clause & GPL-3.0-only" LIC_FILES_CHKSUM = "file://LICENSE;md5=e7807a6282784a7dde4c846626b08fc6 \ file://LICENSE-GPL;md5=d32239bcb673463ab874e80d47fae504 \ file://LICENSE-UNIVERSITIES;md5=8ce9dcc8f7c994de4a408b205c72ba08" SECTION = "devel" -DEPENDS = "libpcre bison-native" +DEPENDS = "libpcre2 bison-native" -SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz" +SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BPN}-${PV}.tar.gz \ + file://determinism.patch \ + " +SRC_URI[sha256sum] = "fa045354e2d048b2cddc69579e4256245d4676894858fcf0bab2290ecf59b7d8" UPSTREAM_CHECK_URI = "https://sourceforge.net/projects/swig/files/swig/" UPSTREAM_CHECK_REGEX = "swig-(?P<pver>\d+(\.\d+)+)" -inherit autotools python3native pkgconfig - -EXTRA_OECONF = " \ - --with-python3=${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-r \ - --without-ruby \ - --without-tcl \ -" - -EXTRA_AUTORECONF += "-I Tools/config" +inherit cmake pkgconfig BBCLASSEXTEND = "native nativesdk" -# necessary together with bison dependency until a new upstream version after -# 3.0.12 includes 0001-Fix-generated-code-for-constant-expressions-containi.patch -do_configure:append() { - mkdir -p ${B}/Source/CParse -} - do_install:append:class-nativesdk() { cd ${D}${bindir} ln -s swig swig2.0 @@ -65,3 +35,11 @@ def swiglib_relpath(d): do_install:append:class-native() { create_wrapper ${D}${bindir}/swig SWIG_LIB='`dirname $''realpath`'/${@swiglib_relpath(d)} } + +PACKAGE_PREPROCESS_FUNCS += "src_package_preprocess" +src_package_preprocess () { + # Trim build paths from comments and defines in generated sources to ensure reproducibility + sed -i -e "s,${WORKDIR},,g" \ + -e "s,YY_YY_.*_CPARSE_PARSER_H_INCLUDED,YY_YY_CPARSE_PARSER_H_INCLUDED,g" \ + ${B}/Source/CParse/parser.* +} |