From 31e3deb9e27779a38800afe16c7d0b9fd4f7e96f Mon Sep 17 00:00:00 2001 From: Fellype do Nascimento Date: Fri, 8 Jun 2018 23:30:51 +0100 Subject: academic/scidavis: Updated for version 1.23. Signed-off-by: David Spencer --- academic/scidavis/README | 8 + ...h_integration_with_too_few_points_bug_321.patch | 28 ---- .../scidavis/fix_issue_with_scipy_vesions.patch | 184 +++++++++++++++++++++ .../integration_with_python_crash_bug_320.patch | 20 --- academic/scidavis/scidavis.SlackBuild | 30 ++-- academic/scidavis/scidavis.info | 6 +- 6 files changed, 214 insertions(+), 62 deletions(-) delete mode 100644 academic/scidavis/crash_integration_with_too_few_points_bug_321.patch create mode 100644 academic/scidavis/fix_issue_with_scipy_vesions.patch delete mode 100644 academic/scidavis/integration_with_python_crash_bug_320.patch diff --git a/academic/scidavis/README b/academic/scidavis/README index 8f0e95561f..a9cfc5d263 100644 --- a/academic/scidavis/README +++ b/academic/scidavis/README @@ -9,3 +9,11 @@ SciDAVis started as a fork of QtiPlot. Optional dependencies, after installation, are scipy and pygsl (to improve python scripting). + +Note for Slackware-current + +Since version 1.23 it is possible to build/use SciDAVis with Python 3 +- just use PYTHON3=yes before executing scidavis.SlackBuild. Default is +to use python 2 (PYTHON3=no). +*** It does not build using Python 3 in Slackware 14.2 or previous +because the shipped PyQt was not built with Python 3 support. *** 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 deleted file mode 100644 index 6050d3c3df..0000000000 --- a/academic/scidavis/crash_integration_with_too_few_points_bug_321.patch +++ /dev/null @@ -1,28 +0,0 @@ -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/fix_issue_with_scipy_vesions.patch b/academic/scidavis/fix_issue_with_scipy_vesions.patch new file mode 100644 index 0000000000..653ce97f9e --- /dev/null +++ b/academic/scidavis/fix_issue_with_scipy_vesions.patch @@ -0,0 +1,184 @@ +--- ../../scidavis-1.23/scidavis/scidavisrc.py 2018-06-04 03:22:50.000000000 -0300 ++++ /home/fellype/github/scidavis/scidavis/scidavisrc.py 2018-06-05 15:12:17.000000000 -0300 +@@ -50,6 +50,84 @@ + # Import standard math functions and constants into global namespace. + import_to_global("math", None, True) + ++# make Qt API available (it gets imported in any case by the scidavis module) ++global QtGui ++from PyQt4 import QtGui ++ ++global QtCore ++from PyQt4 import QtCore ++ ++global Qt ++from PyQt4.QtCore import Qt ++ ++# import SciDAVis' classes to the global namespace (particularly useful for fits) ++for name in dir(__main__.scidavis): ++ setattr(__main__, name, getattr(__main__.scidavis, name)) ++ ++# import selected methods of ApplicationWindow into the global namespace ++appImports = ( ++ "table", "newTable", ++ "matrix", "newMatrix", ++ "graph", "newGraph", ++ "note", "newNote", ++ "plot", "plotContour", "plotColorMap", "plotGrayScale", ++ "activeFolder", "rootFolder", "saveFolder", ++ "renameWindow", "clone", ++ "importImage" ++ ) ++for name in appImports: ++ setattr(__main__,name,getattr(__main__.scidavis.app,name)) ++ ++# make Y columns indexable (using lookup in corresponding X column) ++def __column_getitem(self, index): ++ if self.plotDesignation() != "Y": ++ return None ++ x = self.x() ++ for row in range(self.rowCount()): ++ if x.columnMode() == "Numeric": ++ xval = x.valueAt(row) ++ elif x.columnMode() == "Text": ++ xval = x.textAt(row) ++ else: ++ xval = x.dateTimeAt(row) ++ if xval == index: ++ if self.columnMode() == "Numeric": ++ return self.valueAt(row) ++ elif self.columnMode() == "Text": ++ return self.textAt(row) ++ else: ++ return self.dateTimeAt(row) ++__main__.scidavis.Column.__getitem__ = __column_getitem ++ ++def __column_setitem(self, index, value): ++ if self.plotDesignation() != "Y": ++ return None ++ x = self.x() ++ for row in range(x.rowCount()): ++ if x.columnMode() == "Numeric": ++ xval = x.valueAt(row) ++ elif x.columnMode() == "Text": ++ xval = x.textAt(row) ++ else: ++ xval = x.dateTimeAt(row) ++ if xval == index: ++ if self.columnMode() == "Numeric": ++ return self.setValueAt(row, value) ++ elif self.columnMode() == "Text": ++ return self.setTextAt(row, value) ++ else: ++ return self.setDateTimeAt(row, value) ++__main__.scidavis.Column.__setitem__ = __column_setitem ++ ++# import utility module ++import sys ++sys.path.append(".") ++try: ++ import_to_global("scidavisUtil") ++ print("scidavisUtil successfully imported") ++except(ImportError): ++ print("failed to import scidavisUtil") ++ + # Import selected parts of scipy.special (if available) into global namespace. + # See www.scipy.org for information on SciPy and how to get it. + have_scipy = False +@@ -76,7 +154,11 @@ + # Derivatives of Bessel Functions + "jvp", "yvp", "kvp", "ivp", "h1vp", "h2vp", + # Spherical Bessel Functions +- "sph_jn", "sph_yn", "sph_jnyn", "sph_in", "sph_kn", "sph_inkn", ++ ## if scipy version is < 1.0.0 ++ #"sph_jn", "sph_yn", "sph_jnyn", "sph_in", "sph_kn", "sph_inkn", ++ ## else ++ #"spherical_jn", "spherical_yn", "spherical_in", "spherical_kn", ++ ### removing SBFs for a while, until someone finds a way for these two options to coexist + # Ricatti-Bessel Functions + "riccati_jn", "riccati_yn", + # Struve Functions +@@ -246,83 +328,3 @@ + import_to_global("pygsl.sf", special_functions_doublets, True) + print("Loaded %d special functions from pygsl.sf." % (len(special_functions) + len(special_functions_doublets))) + except(ImportError): pass +- +- +-# make Qt API available (it gets imported in any case by the scidavis module) +-global QtGui +-from PyQt4 import QtGui +- +-global QtCore +-from PyQt4 import QtCore +- +-global Qt +-from PyQt4.QtCore import Qt +- +-# import SciDAVis' classes to the global namespace (particularly useful for fits) +-for name in dir(__main__.scidavis): +- setattr(__main__, name, getattr(__main__.scidavis, name)) +- +-# import selected methods of ApplicationWindow into the global namespace +-appImports = ( +- "table", "newTable", +- "matrix", "newMatrix", +- "graph", "newGraph", +- "note", "newNote", +- "plot", "plotContour", "plotColorMap", "plotGrayScale", +- "activeFolder", "rootFolder", "saveFolder", +- "renameWindow", "clone", +- "importImage" +- ) +-for name in appImports: +- setattr(__main__,name,getattr(__main__.scidavis.app,name)) +- +-# make Y columns indexable (using lookup in corresponding X column) +-def __column_getitem(self, index): +- if self.plotDesignation() != "Y": +- return None +- x = self.x() +- for row in range(self.rowCount()): +- if x.columnMode() == "Numeric": +- xval = x.valueAt(row) +- elif x.columnMode() == "Text": +- xval = x.textAt(row) +- else: +- xval = x.dateTimeAt(row) +- if xval == index: +- if self.columnMode() == "Numeric": +- return self.valueAt(row) +- elif self.columnMode() == "Text": +- return self.textAt(row) +- else: +- return self.dateTimeAt(row) +-__main__.scidavis.Column.__getitem__ = __column_getitem +- +-def __column_setitem(self, index, value): +- if self.plotDesignation() != "Y": +- return None +- x = self.x() +- for row in range(x.rowCount()): +- if x.columnMode() == "Numeric": +- xval = x.valueAt(row) +- elif x.columnMode() == "Text": +- xval = x.textAt(row) +- else: +- xval = x.dateTimeAt(row) +- if xval == index: +- if self.columnMode() == "Numeric": +- return self.setValueAt(row, value) +- elif self.columnMode() == "Text": +- return self.setTextAt(row, value) +- else: +- return self.setDateTimeAt(row, value) +-__main__.scidavis.Column.__setitem__ = __column_setitem +- +-# import utility module +-import sys +-sys.path.append(".") +-try: +- import_to_global("scidavisUtil") +- print("scidavisUtil successfully imported") +-except(ImportError): +- print("failed to import scidavisUtil") +- diff --git a/academic/scidavis/integration_with_python_crash_bug_320.patch b/academic/scidavis/integration_with_python_crash_bug_320.patch deleted file mode 100644 index bef207656d..0000000000 --- a/academic/scidavis/integration_with_python_crash_bug_320.patch +++ /dev/null @@ -1,20 +0,0 @@ -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 17883a6a20..eb2f44118d 100644 --- a/academic/scidavis/scidavis.SlackBuild +++ b/academic/scidavis/scidavis.SlackBuild @@ -3,7 +3,7 @@ # Slackware build script for SciDAVis # Based on the Slackware 14.2 SlackBuild # -# Copyright 2017, Fellype do Nascimento, Campinas - Brazil +# Copyright 2017-2018, Fellype do Nascimento, Campinas - Brazil # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -24,8 +24,8 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=scidavis -VERSION=${VERSION:-1.22} -BUILD=${BUILD:-2} +VERSION=${VERSION:-1.23} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -66,18 +66,26 @@ find -L . \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; # Correct the manpage path -sed -i -e 's#share/man/man1/scidavis.1#man/man1#' scidavis/scidavis.pro +sed -i -e 's#share/man#man#' scidavis/scidavis.pro # Correction needed in order to find qwtplot3d in its default path grep -rl "qwtplot3d/" libscidavis/src/ | xargs sed -i "s: