mirror of
https://github.com/macports/macports-ports.git
synced 2026-07-12 18:20:25 -07:00
qtiplot:
* apply Debian patch to allow qtiplot to work with gsl version 2 (https://trac.macports.org/ticket/50004) * generate pyc files prior in destroot so they are part of the installation * rename qtiplot.app to QtiPlot.app for consistency with other Apps git-svn-id: https://svn.macports.org/repository/macports/trunk/dports@143477 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
+20
-9
@@ -6,7 +6,7 @@ PortGroup qmake 1.0
|
||||
|
||||
name qtiplot
|
||||
version 0.9.8.9
|
||||
revision 11
|
||||
revision 12
|
||||
categories aqua science
|
||||
license GPL-2+
|
||||
maintainers nicos openmaintainer
|
||||
@@ -34,10 +34,12 @@ checksums ${name}-${version}.zip \
|
||||
rmd160 d0ae793b4fbf6eab723f049493d6d954ee8b747e \
|
||||
sha256 3d2cc2503c8f3d4e72af904fd6c8a528f3c38dcfe5eeca5dae64324db9f12d38
|
||||
|
||||
# gsl patch from https://packages.debian.org/sid/math/qtiplot
|
||||
patchfiles patch-ApplicationWindow.diff \
|
||||
patch-qti.sip.diff \
|
||||
patch-scripting.pri.diff \
|
||||
patch-qwt3d_openglhelper.diff \
|
||||
patch-gsl2.diff \
|
||||
patch-sip-4.15.diff
|
||||
|
||||
pre-configure {
|
||||
@@ -59,7 +61,7 @@ pre-configure {
|
||||
puts $confFD "QWT3D_LIBS = \$\$QTI_ROOT/3rdparty/qwtplot3d/lib/libqwtplot3d.a"
|
||||
puts $confFD "LIBPNG_LIBS = -lpng"
|
||||
# Forcing TamuAnova to nothing
|
||||
puts $confFD "TAMUANOVA_LIBS = "
|
||||
puts $confFD "TAMUANOVA_LIBS = "
|
||||
if {[variant_isset qtexengine]} {
|
||||
puts $confFD "TEX_ENGINE_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/QTeXEngine/src"
|
||||
puts $confFD "TEX_ENGINE_LIBS = \$\$QTI_ROOT/3rdparty/QTeXEngine/libQTeXEngine.a"
|
||||
@@ -79,7 +81,7 @@ pre-configure {
|
||||
puts $confFD "DEFINES += SCRIPTING_DIALOG"
|
||||
puts $confFD "CONFIG += release"
|
||||
puts $confFD "\}"
|
||||
close $confFD
|
||||
close $confFD
|
||||
|
||||
# fix a bug in the python init script
|
||||
# append the current path *before* import __main__, else __file__ points to math.so after the import if this module
|
||||
@@ -114,18 +116,16 @@ destroot.destdir INSTALL_ROOT=${destroot}
|
||||
destroot {
|
||||
# install the application bundle and create a symlink for cli invocation
|
||||
xinstall -d ${destroot}${applications_dir}
|
||||
copy "${worksrcpath}/qtiplot/qtiplot.app" ${destroot}${applications_dir}
|
||||
# in this dir python tries to store .pyc files, so it has to be writable
|
||||
file attributes ${destroot}${applications_dir}/qtiplot.app/Contents/MacOS -permissions ugo+w
|
||||
ln -s ${applications_dir}/qtiplot.app/Contents/MacOS/qtiplot ${destroot}${prefix}/bin/qtiplot
|
||||
copy "${worksrcpath}/qtiplot/qtiplot.app" ${destroot}${applications_dir}/QtiPlot.app
|
||||
ln -s ${applications_dir}/QtiPlot.app/Contents/MacOS/qtiplot ${destroot}${prefix}/bin/qtiplot
|
||||
# install some resources
|
||||
xinstall -W ${worksrcpath}/qtiplot/ \
|
||||
qti_wordlist.txt \
|
||||
qtiUtil.py \
|
||||
qtiplotrc.py \
|
||||
${destroot}${applications_dir}/qtiplot.app/Contents/MacOS/
|
||||
${destroot}${applications_dir}/QtiPlot.app/Contents/MacOS/
|
||||
# install the fitting plugins
|
||||
set plugin_dir ${destroot}${applications_dir}/qtiplot.app/Contents/fitPlugins/
|
||||
set plugin_dir ${destroot}${applications_dir}/QtiPlot.app/Contents/fitPlugins/
|
||||
file mkdir ${plugin_dir}
|
||||
xinstall -W ${worksrcpath}/fitPlugins/ \
|
||||
libexp_saturation.dylib \
|
||||
@@ -148,6 +148,17 @@ variant python25 description "Legacy compatibility variant" requires python27 {}
|
||||
variant python26 description "Legacy compatibility variant" requires python27 {}
|
||||
|
||||
variant python27 description "add support for python27 scripting" {
|
||||
|
||||
post-destroot {
|
||||
system "${prefix}/bin/python2.7 -m compileall ${destroot}${applications_dir}/QtiPlot.app/Contents/MacOS"
|
||||
}
|
||||
# prior to r143477 (2015-12-13), pyc files were generated after installation
|
||||
pre-activate {
|
||||
foreach pyc [glob -directory ${applications_dir}/QtiPlot.app/Contents/MacOS -nocomplain *.pyc] {
|
||||
delete ${pyc}
|
||||
}
|
||||
}
|
||||
|
||||
# Can use either py*-pyqt4 or py*-pyqt4-devel.
|
||||
depends_lib-append port:python27 \
|
||||
port:py27-sip \
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
Description: adoptation to gsl2.
|
||||
Author: Damir Islamov <damir@secretlaboratory.ru>, Anton Gladky <gladk@debian.org>
|
||||
Last-Update: 2015-12-04
|
||||
|
||||
Index: qtiplot-0.9.8.9/qtiplot/src/analysis/Fit.cpp
|
||||
===================================================================
|
||||
--- qtiplot/src/analysis/Fit.cpp
|
||||
+++ qtiplot/src/analysis/Fit.cpp
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <gsl/gsl_statistics.h>
|
||||
#include <gsl/gsl_blas.h>
|
||||
#include <gsl/gsl_cdf.h>
|
||||
+#include <gsl/gsl_version.h>
|
||||
|
||||
#include <QApplication>
|
||||
#include <QMessageBox>
|
||||
@@ -126,10 +127,19 @@ gsl_multifit_fdfsolver * Fit::fitGSL(gsl
|
||||
break;
|
||||
}
|
||||
}
|
||||
-
|
||||
if (status){
|
||||
+ // allocate memory and calculate covariance matrix based on residuals
|
||||
+#if GSL_MAJOR_VERSION == 2
|
||||
+ gsl_matrix *J = gsl_matrix_alloc(d_n, d_p);
|
||||
+ gsl_multifit_fdfsolver_jac(s, J);
|
||||
+ gsl_multifit_covar (J, 0.0, covar);
|
||||
+ iterations = 0;
|
||||
+ // free previousely allocated memory
|
||||
+ gsl_matrix_free (J);
|
||||
+#else
|
||||
gsl_multifit_covar (s->J, 0.0, covar);
|
||||
iterations = 0;
|
||||
+#endif
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -154,10 +164,18 @@ gsl_multifit_fdfsolver * Fit::fitGSL(gsl
|
||||
|
||||
status = gsl_multifit_test_delta (s->dx, s->x, d_tolerance, d_tolerance);
|
||||
} while (inRange && status == GSL_CONTINUE && (int)iter < d_max_iterations);
|
||||
-
|
||||
+#if GSL_MAJOR_VERSION == 2
|
||||
+ // allocate memory and calculate covariance matrix based on residuals
|
||||
+ gsl_matrix *J = gsl_matrix_alloc(d_n, d_p);
|
||||
+ gsl_multifit_fdfsolver_jac(s, J);
|
||||
+ gsl_multifit_covar (J, 0.0, covar);
|
||||
+ iterations = iter;
|
||||
+ // free previousely allocated memory
|
||||
+ gsl_matrix_free (J);
|
||||
+#else
|
||||
gsl_multifit_covar (s->J, 0.0, covar);
|
||||
-
|
||||
iterations = iter;
|
||||
+#endif
|
||||
return s;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user