-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* (#13741) Add recipe for SWIG 4.1.0 The 0001 patch fails for 4.1.0, so make a specific one. * swig 4.1.0 upgraded from PCRE to PCRE2 * Need to pass PCRE2_LIBS now too. Note that I think swig uses PCRE_CFLAGS / PCRE2_CFLAGS, not PCRE_CPPFLAGS cf https://github.com/swig/swig/blob/efe5f181cf69975cf2fa1dcddefc29b93e4a6196/configure.ac#L71 * Bump build requirements while I'm at it
- Loading branch information
Showing
5 changed files
with
85 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
recipes/swig/all/patches/0001-4.1.0-swig-linux-library-path.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
--- Source/Modules/main.cxx | ||
+++ Source/Modules/main.cxx | ||
@@ -886,6 +886,32 @@ static void getoptions(int argc, char *argv[]) { | ||
|
||
static void SWIG_exit_handler(int status); | ||
|
||
+#if defined(HAVE_UNISTD_H) && !defined(_WIN32) | ||
+#include <libgen.h> | ||
+#include <unistd.h> | ||
+#include <dlfcn.h> | ||
+ | ||
+static String *get_exe_path(void) { | ||
+ Dl_info info; | ||
+ if (dladdr("main", &info)) { | ||
+ char realp_buffer[PATH_MAX]; | ||
+ char* res = NULL; | ||
+ | ||
+ res = realpath(info.dli_fname, realp_buffer); | ||
+ if (!res) { | ||
+ return NewString(SWIG_LIB); | ||
+ } | ||
+ | ||
+ const char* dir = dirname(realp_buffer); | ||
+ char dest_buf[PATH_MAX]; | ||
+ strcpy(dest_buf, dir); | ||
+ strcat(dest_buf, "/swiglib"); | ||
+ return NewStringWithSize(dest_buf, strlen(dest_buf)); | ||
+ } | ||
+ return NewString(SWIG_LIB); | ||
+} | ||
+#endif | ||
+ | ||
int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { | ||
char *c; | ||
|
||
@@ -935,12 +961,14 @@ int SWIG_main(int argc, char *argv[], const TargetLanguageModule *tlm) { | ||
char *p; | ||
if (!(GetModuleFileName(0, buf, MAX_PATH) == 0 || (p = strrchr(buf, '\\')) == 0)) { | ||
*(p + 1) = '\0'; | ||
- SwigLib = NewStringf("%sLib", buf); // Native windows installation path | ||
+ SwigLib = NewStringf("%sswiglib", buf); // Native windows installation path | ||
} else { | ||
SwigLib = NewStringf(""); // Unexpected error | ||
} | ||
if (Len(SWIG_LIB_WIN_UNIX) > 0) | ||
SwigLibWinUnix = NewString(SWIG_LIB_WIN_UNIX); // Unix installation path using a drive letter (for msys/mingw) | ||
+#elif defined(HAVE_UNISTD_H) && !defined(_WIN32) | ||
+ SwigLib = get_exe_path(); | ||
#else | ||
SwigLib = NewString(SWIG_LIB); | ||
#endif |
11 changes: 11 additions & 0 deletions
11
recipes/swig/all/patches/0002-4.1.0-do-not-define-SWIG_LIB_WIN_UNIX.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- configure.ac | ||
+++ configure.ac | ||
@@ -2825,7 +2825,7 @@ case $build in | ||
*-*-cygwin*) SWIG_LIB_WIN_UNIX=`cygpath --mixed "$SWIG_LIB"`;; | ||
*) SWIG_LIB_WIN_UNIX="";; | ||
esac | ||
-AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, ["$SWIG_LIB_WIN_UNIX"], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) | ||
+AC_DEFINE_UNQUOTED(SWIG_LIB_WIN_UNIX, [""], [Directory for SWIG system-independent libraries (Unix install on native Windows)]) | ||
|
||
SWIG_LIB_PREINST=$ABS_SRCDIR/Lib | ||
AC_SUBST(SWIG_LIB_PREINST) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
versions: | ||
"4.1.0": | ||
folder: "all" | ||
"4.0.2": | ||
folder: "all" | ||
"4.0.1": | ||
|