diff options
author | Fellype do Nascimento <fellype(at)gmail.com> | 2018-06-08 23:30:51 +0100 |
---|---|---|
committer | David Spencer <idlemoor@slackbuilds.org> | 2018-06-08 23:30:51 +0100 |
commit | 31e3deb9e27779a38800afe16c7d0b9fd4f7e96f (patch) | |
tree | 9fa9cf7128b22d2b1ea10f09b2497f78e5d8373e /academic/scidavis | |
parent | 077bd4c446b6d6c329054430f353c256a0d66bfb (diff) |
academic/scidavis: Updated for version 1.23.
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'academic/scidavis')
-rw-r--r-- | academic/scidavis/README | 8 | ||||
-rw-r--r-- | academic/scidavis/crash_integration_with_too_few_points_bug_321.patch | 28 | ||||
-rw-r--r-- | academic/scidavis/fix_issue_with_scipy_vesions.patch | 184 | ||||
-rw-r--r-- | academic/scidavis/integration_with_python_crash_bug_320.patch | 20 | ||||
-rw-r--r-- | academic/scidavis/scidavis.SlackBuild | 30 | ||||
-rw-r--r-- | academic/scidavis/scidavis.info | 6 |
6 files changed, 214 insertions, 62 deletions
diff --git a/academic/scidavis/README b/academic/scidavis/README index 8f0e95561f0af..a9cfc5d263356 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 6050d3c3df15b..0000000000000 --- 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 0000000000000..653ce97f9e61b --- /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 bef207656d531..0000000000000 --- 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 17883a6a205cf..eb2f44118da0d 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:<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 +# Patch to fix issues when SciPy is installed. Without this there may be a +# problem when running python scripts due to differences between SciPy versions +# higher or lower than 1.0.0 +patch -p1 < $CWD/fix_issue_with_scipy_vesions.patch scidavis/scidavisrc.py + +# Since version 1.23 it is possible to build/use SciDAVis with Python 3 - just use +# PYTHON3=yes before execute scidavis.SlackBuild. Default is to use python 2 (PYTHON3=no). +# *** It does not build using Python 3 in Slackware 14.2 or previous because PyQt was not built with +# Python 3 support. I'm adding this here because I know it will be useful in the future and for the +# tests currently done in -current +if [ "${PYTHON3:-no}" = "yes" ]; then + export PYTHON=python3 +else + export PYTHON=python2 +fi ## 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/ diff --git a/academic/scidavis/scidavis.info b/academic/scidavis/scidavis.info index 3a49802ad4e7f..2527497640cb1 100644 --- a/academic/scidavis/scidavis.info +++ b/academic/scidavis/scidavis.info @@ -1,8 +1,8 @@ PRGNAM="scidavis" -VERSION="1.22" +VERSION="1.23" HOMEPAGE="http://scidavis.sourceforge.net/" -DOWNLOAD="https://ufpr.dl.sourceforge.net/project/scidavis/SciDAVis/1.22/scidavis-1.22.tar.gz" -MD5SUM="755c35c8c4b5890af3db701a633c4923" +DOWNLOAD="https://ufpr.dl.sourceforge.net/project/scidavis/SciDAVis/1.23/scidavis-1.23.tar.gz" +MD5SUM="e6459782ce41e63266a32be9bd4f8cb3" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="muParser qwt5 qwtplot3d" |