summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFellype do Nascimento <fellype(at)gmail.com>2017-07-21 23:27:57 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2017-07-22 06:55:39 +0700
commit13e2dc3cf6b127b071cb4db404ffdbbc2866b074 (patch)
tree1bf5a7ec89ecd42db81b23bd77589a0c3007f6e6
parent4f63578983ab7f82364349848096027667ef0325 (diff)
downloadslackbuilds-13e2dc3cf6b127b071cb4db404ffdbbc2866b074.tar.gz
academic/scidavis: Updated for version 1.19.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--academic/scidavis/Fix_FFT_generated_from_graphs.patch221
-rw-r--r--academic/scidavis/desktop_integration.txt36
-rw-r--r--academic/scidavis/fix_translations.patch11
-rw-r--r--academic/scidavis/scidavis.SlackBuild12
-rw-r--r--academic/scidavis/scidavis.info6
5 files changed, 243 insertions, 43 deletions
diff --git a/academic/scidavis/Fix_FFT_generated_from_graphs.patch b/academic/scidavis/Fix_FFT_generated_from_graphs.patch
new file mode 100644
index 0000000000..ec83ce31eb
--- /dev/null
+++ b/academic/scidavis/Fix_FFT_generated_from_graphs.patch
@@ -0,0 +1,221 @@
+--- libscidavis/src/FFT.cpp 2017-07-14 04:54:53.000000000 -0300
++++ /home/fellype/compilando/scidavis-github/libscidavis/src/FFT.cpp 2017-07-19 09:36:40.000000000 -0300
+@@ -50,6 +50,12 @@
+ {
+ init();
+ setDataFromCurve(curveTitle);
++ // intersperse 0 imaginary components
++ double* tmp=new double[2*d_n];
++ memset(tmp,0,2*d_n*sizeof(double));
++ for (size_t i=0; i<d_n; ++i) tmp[2*i]=d_y[i];
++ delete [] d_y;
++ d_y=tmp;
+ }
+
+ void FFT::init ()
+@@ -63,133 +69,13 @@
+ d_sampling = 1.0;
+ }
+
+-QList<Column *> FFT::fftCurve()
++QList<Column *> FFT::fftTable()
+ {
+- int i2;
+- int n2 = d_n/2;
+ double *amp = new double[d_n];
+- double *result = new double[2*d_n];
+-
+- if(!amp || !result)
+- {
+- QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
+- tr("Could not allocate memory, operation aborted!"));
+- d_init_err = true;
+- return QList<Column *>();
+- }
+-
+- double df = 1.0/(double)(d_n*d_sampling);//frequency sampling
+- double aMax = 0.0;//max amplitude
+- QList<Column *> columns;
+- if(!d_inverse)
+- {
+- d_explanation = tr("Forward") + " " + tr("FFT") + " " + tr("of") + " " + d_curve->title().text();
+- columns << new Column(tr("Frequency"), SciDAVis::Numeric);
+-
+- gsl_fft_real_workspace *work=gsl_fft_real_workspace_alloc(d_n);
+- gsl_fft_real_wavetable *real=gsl_fft_real_wavetable_alloc(d_n);
+-
+- if(!work || !real)
+- {
+- QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
+- tr("Could not allocate memory, operation aborted!"));
+- d_init_err = true;
+- return QList<Column *>();
+- }
+-
+- gsl_fft_real_transform(d_y, 1, d_n, real,work);
+- gsl_fft_halfcomplex_unpack (d_y, result, 1, d_n);
+
+- gsl_fft_real_wavetable_free(real);
+- gsl_fft_real_workspace_free(work);
+- }
+- else
+- {
+- d_explanation = tr("Inverse") + " " + tr("FFT") + " " + tr("of") + " " + d_curve->title().text();
+- columns << new Column(tr("Time"), SciDAVis::Numeric);
+-
+- gsl_fft_real_unpack (d_y, result, 1, d_n);
+ gsl_fft_complex_wavetable *wavetable = gsl_fft_complex_wavetable_alloc (d_n);
+ gsl_fft_complex_workspace *workspace = gsl_fft_complex_workspace_alloc (d_n);
+
+- if(!workspace || !wavetable)
+- {
+- QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
+- tr("Could not allocate memory, operation aborted!"));
+- d_init_err = true;
+- return QList<Column *>();
+- }
+-
+- gsl_fft_complex_inverse (result, 1, d_n, wavetable, workspace);
+- gsl_fft_complex_wavetable_free (wavetable);
+- gsl_fft_complex_workspace_free (workspace);
+- }
+-
+- if (d_shift_order)
+- {
+- for(unsigned i=0; i<d_n; i++)
+- {
+- d_x[i] = (i-n2)*df;
+- int j = i + d_n;
+- double aux = result[i];
+- result[i] = result[j];
+- result[j] = aux;
+- }
+- }
+- else
+- {
+- for(unsigned i=0; i<d_n; i++)
+- d_x[i] = i*df;
+- }
+-
+- for(unsigned i=0;i<d_n;i++)
+- {
+- i2 = 2*i;
+- double real_part = result[i2];
+- double im_part = result[i2+1];
+- double a = sqrt(real_part*real_part + im_part*im_part);
+- amp[i]= a;
+- if (a > aMax)
+- aMax = a;
+- }
+-
+- // ApplicationWindow *app = (ApplicationWindow *)parent();
+-
+- columns << new Column(tr("Real"), SciDAVis::Numeric);
+- columns << new Column(tr("Imaginary"), SciDAVis::Numeric);
+- columns << new Column(tr("Amplitude"), SciDAVis::Numeric);
+- columns << new Column(tr("Angle"), SciDAVis::Numeric);
+- for (unsigned i=0;i<d_n;i++)
+- {
+- i2 = 2*i;
+- columns.at(0)->setValueAt(i, d_x[i]);
+- columns.at(1)->setValueAt(i, result[i2]);
+- columns.at(2)->setValueAt(i, result[i2+1]);
+- if (d_normalize)
+- columns.at(3)->setValueAt(i, amp[i]/aMax);
+- else
+- columns.at(3)->setValueAt(i, amp[i]);
+- columns.at(4)->setValueAt(i, atan(result[i2+1]/result[i2]));
+- }
+- delete[] amp;
+- delete[] result;
+- columns.at(0)->setPlotDesignation(SciDAVis::X);
+- columns.at(1)->setPlotDesignation(SciDAVis::Y);
+- columns.at(2)->setPlotDesignation(SciDAVis::Y);
+- columns.at(3)->setPlotDesignation(SciDAVis::Y);
+- columns.at(4)->setPlotDesignation(SciDAVis::Y);
+- return columns;
+-}
+-
+-QList<Column *> FFT::fftTable()
+-{
+- int i;
+- int rows = d_table->numRows();
+- double *amp = new double[rows];
+-
+- gsl_fft_complex_wavetable *wavetable = gsl_fft_complex_wavetable_alloc (rows);
+- gsl_fft_complex_workspace *workspace = gsl_fft_complex_workspace_alloc (rows);
+-
+ if(!amp || !wavetable || !workspace)
+ {
+ QMessageBox::critical((ApplicationWindow *)parent(), tr("SciDAVis") + " - " + tr("Error"),
+@@ -198,18 +84,18 @@
+ return QList<Column *>();
+ }
+
+- double df = 1.0/(double)(rows*d_sampling);//frequency sampling
++ double df = 1.0/(double)(d_n*d_sampling);//frequency sampling
+ double aMax = 0.0;//max amplitude
+ QList<Column *> columns;
+ if(!d_inverse)
+ {
+ columns << new Column(tr("Frequency"), SciDAVis::Numeric);
+- gsl_fft_complex_forward (d_y, 1, rows, wavetable, workspace);
++ gsl_fft_complex_forward (d_y, 1, d_n, wavetable, workspace);
+ }
+ else
+ {
+ columns << new Column(tr("Time"), SciDAVis::Numeric);
+- gsl_fft_complex_inverse (d_y, 1, rows, wavetable, workspace);
++ gsl_fft_complex_inverse (d_y, 1, d_n, wavetable, workspace);
+ }
+
+ gsl_fft_complex_wavetable_free (wavetable);
+@@ -217,11 +103,11 @@
+
+ if (d_shift_order)
+ {
+- int n2 = rows/2;
+- for(i=0; i<rows; i++)
++ int n2 = d_n/2;
++ for(int i=0; i<int(d_n); i++)
+ {
+ d_x[i] = (i-n2)*df;
+- int j = i + rows;
++ int j = i + d_n;
+ double aux = d_y[i];
+ d_y[i] = d_y[j];
+ d_y[j] = aux;
+@@ -229,11 +115,11 @@
+ }
+ else
+ {
+- for(i=0; i<rows; i++)
++ for(size_t i=0; i<d_n; i++)
+ d_x[i] = i*df;
+ }
+
+- for(i=0; i<rows; i++)
++ for(size_t i=0; i<d_n; i++)
+ {
+ int i2 = 2*i;
+ double a = sqrt(d_y[i2]*d_y[i2] + d_y[i2+1]*d_y[i2+1]);
+@@ -246,7 +132,7 @@
+ columns << new Column(tr("Imaginary"), SciDAVis::Numeric);
+ columns << new Column(tr("Amplitude"), SciDAVis::Numeric);
+ columns << new Column(tr("Angle"), SciDAVis::Numeric);
+- for (i=0; i<rows; i++)
++ for (size_t i=0; i<d_n; i++)
+ {
+ int i2 = 2*i;
+ columns.at(0)->setValueAt(i, d_x[i]);
+@@ -270,9 +156,7 @@
+ void FFT::output()
+ {
+ QList<Column *> columns;
+- if (d_graph && d_curve)
+- columns = fftCurve();
+- else if (d_table)
++ if (d_y)
+ columns = fftTable();
+
+ if (!columns.isEmpty())
diff --git a/academic/scidavis/desktop_integration.txt b/academic/scidavis/desktop_integration.txt
deleted file mode 100644
index 029fc66f83..0000000000
--- a/academic/scidavis/desktop_integration.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-###################### DESKTOP INTEGRATION ##################################
-
-unix {
- desktop_entry.files = scidavis.desktop
- desktop_entry.path = "$$INSTALLBASE/share/applications"
-
- mime_package.files = scidavis.xml
- mime_package.path = "$$INSTALLBASE/share/mime/packages"
-
- #deprecated
- mime_link.files = x-sciprj.desktop
- mime_link.path = "$$INSTALLBASE/share/mimelnk/application"
-
- contains(INSTALLS, icons) {
- # scalable icon
- icons.files = icons/scidavis.svg
- icons.path = "$$INSTALLBASE/share/icons/hicolor/scalable/apps"
-
- # hicolor icons for different resolutions
- resolutions = 16 22 32 48 64 128
- for(res, resolutions) {
- eval(icon_hicolor_$${res}.files = icons/hicolor-$${res}/scidavis.png)
- eval(icon_hicolor_$${res}.path = "$$INSTALLBASE/share/icons/hicolor/$${res}x$${res}/apps")
- INSTALLS += icon_hicolor_$${res}
- }
-
- # locolor icons for different resolutions
- resolutions = 16 22 32
- for(res, resolutions) {
- eval(icon_locolor_$${res}.files = icons/locolor-$${res}/scidavis.png)
- eval(icon_locolor_$${res}.path = "$$INSTALLBASE/share/icons/locolor/$${res}x$${res}/apps")
-
- INSTALLS += icon_locolor_$${res}
- }
- }
-}
diff --git a/academic/scidavis/fix_translations.patch b/academic/scidavis/fix_translations.patch
new file mode 100644
index 0000000000..7269e8ddc5
--- /dev/null
+++ b/academic/scidavis/fix_translations.patch
@@ -0,0 +1,11 @@
+--- scidavis/basic.pri 2017-07-14 04:54:53.000000000 -0300
++++ /home/fellype/compilando/scidavis-github/scidavis/basic.pri 2017-07-19 09:36:40.000000000 -0300
+@@ -67,7 +67,7 @@
+ # note the translation files are not writable during AEGIS
+ # integration, so we don't want to perform an update then
+ tstarget.commands = (! test -w translations/scidavis_de.ts || \
+-$$LUPDATE_BIN src/*.cpp ../libscidavis/src/*.cpp -ts translations/*.ts) && $$LRELEASE_BIN translations/*.ts
++$$LUPDATE_BIN src ../libscidavis/src -ts translations/*.ts) && $$LRELEASE_BIN translations/*.ts
+
+ QMAKE_EXTRA_TARGETS += tstarget
+ QMAKE_CLEAN += $$translationfiles.files
diff --git a/academic/scidavis/scidavis.SlackBuild b/academic/scidavis/scidavis.SlackBuild
index 890e30e531..ae0ddc94c9 100644
--- a/academic/scidavis/scidavis.SlackBuild
+++ b/academic/scidavis/scidavis.SlackBuild
@@ -24,7 +24,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=scidavis
-VERSION=${VERSION:-1.18}
+VERSION=${VERSION:-1.19}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -68,8 +68,12 @@ find -L . \
# Correction needed in order to find qwtplot3d in its default path
grep -rl "qwtplot3d/" libscidavis/src/ | xargs sed -i "s:<qwtplot3d/:<:"
-# Correction needed in order to install system icons and desktop integration rightly
-cat $CWD/desktop_integration.txt >> scidavis/basic.pri
+## Applying some upstream patches:
+## 1: Fix translations - see https://sourceforge.net/p/scidavis/scidavis-bugs/301/
+patch -p1 < $CWD/fix_translations.patch scidavis/basic.pri
+
+## 2: Fix FFT generated from graphs - see https://sourceforge.net/p/scidavis/scidavis-bugs/305/
+patch -p1 < $CWD/Fix_FFT_generated_from_graphs.patch libscidavis/src/FFT.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/
@@ -89,7 +93,7 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr
## Sometimes 'make install' fails to install the translation files
mkdir -p $PKG/usr/share/scidavis/translations
-cp scidavis/translations/*.qm $PKG/usr/share/scidavis/translations
+install -m 0644 scidavis/translations/*.qm $PKG/usr/share/scidavis/translations
mkdir -p $PKG/usr/man/man1
docbook2man man/manpage.sgml -o $PKG/usr/man/man1/
diff --git a/academic/scidavis/scidavis.info b/academic/scidavis/scidavis.info
index 0822ae6523..6ab1485605 100644
--- a/academic/scidavis/scidavis.info
+++ b/academic/scidavis/scidavis.info
@@ -1,8 +1,8 @@
PRGNAM="scidavis"
-VERSION="1.18"
+VERSION="1.19"
HOMEPAGE="http://scidavis.sourceforge.net/"
-DOWNLOAD="https://downloads.sourceforge.net/project/scidavis/SciDAVis/1.18/scidavis-1.18.tar.gz"
-MD5SUM="3479b7805517630a9b5aeb6254adb9ed"
+DOWNLOAD="https://ufpr.dl.sourceforge.net/project/scidavis/SciDAVis/scidavis-1.19.tar.gz"
+MD5SUM="5c4af1e3bb1e1b9adaf1c839892c5382"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="muParser qwt5 qwtplot3d"