summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFellype do Nascimento <fellype(at)gmail.com>2017-11-29 17:28:58 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-12-02 06:31:04 +0700
commitb285d0650e849850b2ccf3acdb2614d343d74841 (patch)
treeae5c1bae086b9cbdd405893a221027258ebee0f2
parent20970278afd68598cd1f861bbbdab02f6250831b (diff)
downloadslackbuilds-b285d0650e849850b2ccf3acdb2614d343d74841.tar.gz
academic/scidavis: Patched to fix crashes.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
-rw-r--r--academic/scidavis/crash_integration_with_too_few_points_bug_321.patch28
-rw-r--r--academic/scidavis/integration_with_python_crash_bug_320.patch20
-rw-r--r--academic/scidavis/scidavis.SlackBuild10
3 files changed, 57 insertions, 1 deletions
diff --git a/academic/scidavis/crash_integration_with_too_few_points_bug_321.patch b/academic/scidavis/crash_integration_with_too_few_points_bug_321.patch
new file mode 100644
index 0000000000..6050d3c3df
--- /dev/null
+++ b/academic/scidavis/crash_integration_with_too_few_points_bug_321.patch
@@ -0,0 +1,28 @@
+diff --git a/libscidavis/src/Integration.cpp b/libscidavis/src/Integration.cpp
+index b9cb786..0b22272 100644
+--- a/libscidavis/src/Integration.cpp
++++ b/libscidavis/src/Integration.cpp
+@@ -135,17 +135,17 @@ QString Integration::logInfo()
+ throw runtime_error("invalid method");
+ }
+
+- gsl_interp *interpolation = gsl_interp_alloc(method_t, d_n);
+- gsl_interp_init(interpolation, d_x, d_y, d_n);
+-
+- if (d_n < gsl_interp_min_size(interpolation))
++ if (d_n < gsl_interp_type_min_size(method_t))
+ {
+ QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
+- tr("You need at least %1 points in order to perform this operation!").arg(gsl_interp_min_size(interpolation)));
++ tr("You need at least %1 points in order to perform this operation!").arg(gsl_interp_type_min_size(method_t)));
+ d_init_err = true;
+- return "";
++ return QString("");
+ }
+
++ gsl_interp *interpolation = gsl_interp_alloc(method_t, d_n);
++ gsl_interp_init(interpolation, d_x, d_y, d_n);
++
+ QString logInfo = "[" + QDateTime::currentDateTime().toString(Qt::LocalDate) + "\t" + tr("Plot")+ ": ''" + d_graph->parentPlotName() + "'']\n";
+ logInfo += "\n" + tr("Numerical integration of") + ": " + d_curve->title().text() + tr(" using ") + method_name + tr("Interpolation") + "\n";
+
diff --git a/academic/scidavis/integration_with_python_crash_bug_320.patch b/academic/scidavis/integration_with_python_crash_bug_320.patch
new file mode 100644
index 0000000000..bef207656d
--- /dev/null
+++ b/academic/scidavis/integration_with_python_crash_bug_320.patch
@@ -0,0 +1,20 @@
+diff --git a/libscidavis/src/PythonScript.cpp b/libscidavis/src/PythonScript.cpp
+index 27d4eec..a8b8ac2 100644
+--- a/libscidavis/src/PythonScript.cpp
++++ b/libscidavis/src/PythonScript.cpp
+@@ -43,6 +43,7 @@ PythonScript::PythonScript(PythonScripting *env, const QString &code, QObject *c
+ : Script(env, code, context, name)
+ {
+ PyCode = NULL;
++ PyGILState_STATE state = PyGILState_Ensure();
+ // Old: All scripts share a global namespace, and module top-level has its own nonstandard local namespace
+ modLocalDict = PyDict_New();
+ // A bit of a hack, but we need either IndexError or len() from __builtins__.
+@@ -71,6 +72,7 @@ PythonScript::PythonScript(PythonScripting *env, const QString &code, QObject *c
+ else
+ PyErr_Print();
+ // "self" is unique to each script, so they can't all run in the __main__ namespace
++ PyGILState_Release(state);
+ setQObject(Context, "self");
+ }
+
diff --git a/academic/scidavis/scidavis.SlackBuild b/academic/scidavis/scidavis.SlackBuild
index d1c9670bb7..17883a6a20 100644
--- a/academic/scidavis/scidavis.SlackBuild
+++ b/academic/scidavis/scidavis.SlackBuild
@@ -25,7 +25,7 @@
PRGNAM=scidavis
VERSION=${VERSION:-1.22}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -71,6 +71,14 @@ sed -i -e 's#share/man/man1/scidavis.1#man/man1#' scidavis/scidavis.pro
# Correction needed in order to find qwtplot3d in its default path
grep -rl "qwtplot3d/" libscidavis/src/ | xargs sed -i "s:<qwtplot3d/:<:"
+# Patch to fix crashes using integration in python scripts
+# See https://sourceforge.net/p/scidavis/scidavis-bugs/320/
+patch -p1 < $CWD/integration_with_python_crash_bug_320.patch libscidavis/src/PythonScript.cpp
+
+# Patch to fix crashes when integration is performed with less points than required by interpolation method
+# See https://sourceforge.net/p/scidavis/scidavis-bugs/321/
+patch -p1 < $CWD/crash_integration_with_too_few_points_bug_321.patch libscidavis/src/Integration.cpp
+
## For some unknown reason, to build in Slackware we need to run qmake twice in order to get the app icons working properly
## See https://sourceforge.net/p/scidavis/scidavis-bugs/259/
qmake