diff --git a/academic/ViennaRNA/ViennaRNA.SlackBuild b/academic/ViennaRNA/ViennaRNA.SlackBuild index 42ae76bbd7..aecfae4f20 100644 --- a/academic/ViennaRNA/ViennaRNA.SlackBuild +++ b/academic/ViennaRNA/ViennaRNA.SlackBuild @@ -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). diff --git a/academic/ViennaRNA/swig_4.2.0.txt b/academic/ViennaRNA/swig_4.2.0.txt new file mode 100644 index 0000000000..80c1ba2b82 --- /dev/null +++ b/academic/ViennaRNA/swig_4.2.0.txt @@ -0,0 +1,22 @@ +Description: rewriting code to build against swig 4.2.0 +Author: Pierre Gruet +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 {