academic/ViennaRNA: patch to compile against swig_4.2

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
brobr 2024-07-27 17:05:40 +01:00 committed by Willy Sudiarto Raharjo
parent eb4b9071e6
commit a31f117413
No known key found for this signature in database
GPG key ID: 3F617144D7238786
2 changed files with 25 additions and 0 deletions

View file

@ -82,6 +82,9 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# https://github.com/ViennaRNA/ViennaRNA/issues/243
patch -p1 < $CWD/swig_4.2.0.txt
# You can configure some ViennaRNA features that are (not) compiled by default.
# See the README.md for details. You can enable/disable a these features by
# passing variables to the script (VAR=yes/no ./ViennaRNA.SlackBuild).

View file

@ -0,0 +1,22 @@
Description: rewriting code to build against swig 4.2.0
Author: Pierre Gruet <pgt@debian.org>
Forwarded: no
Last-Update: 2024-07-26
--- a/interfaces/inverse.i
+++ b/interfaces/inverse.i
@@ -78,7 +78,14 @@
#ifdef SWIGPYTHON
%typemap(varin) char * symbolset {
free(symbolset);
+
+#if SWIG_VERSION >= 0x040200
+ PyObject *pbytes = NULL;
+ symbolset = strdup(SWIG_PyUnicode_AsUTF8AndSize($input, NULL, &pbytes));
+ Py_XDECREF(pbytes);
+#else
symbolset = strdup(SWIG_Python_str_AsChar($input));
+#endif
}
%typemap(varout) char * symbolset {