source: trunk/dports/aqua/qtiplot/Portfile @ 91994

Last change on this file since 91994 was 91994, checked in by nicos@…, 8 years ago

qtiplot: ensuring compilation with qt 4.8, taking maintainership

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.8 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 91994 2012-04-15 11:19:48Z nicos@macports.org $
3
4PortSystem  1.0
5PortGroup           qt4 1.0
6
7name                qtiplot
8version             0.9.8.9
9categories          aqua science
10license             GPL-2+
11maintainers         nicos openmaintainer
12
13description         Data Analysis and Scientific Plotting
14long_description    Similar to Origin or SigmaPlot, QtiPlot can be used to \
15                    present 2D and 3D data and has various data analysis functions \
16                    like curve fitting. Plotting of 3D data can be rendered using \
17                    OpenGL using the Qwt3D libraries.\
18                    It is a full-featured data analysis and plotting package available \
19                    on Linux, Windows and Mac OS X platforms that supports python scripting.
20
21platforms           darwin
22homepage            http://soft.proindependent.com/qtiplot.html
23master_sites        http://download.berlios.de/qtiplot/
24
25depends_lib-append  port:muparser \
26                    port:boost \
27                    port:gsl \
28                    port:libpng \
29                    port:zlib
30
31checksums           ${name}-${version}.zip \
32                    rmd160  d0ae793b4fbf6eab723f049493d6d954ee8b747e \
33                    sha256  3d2cc2503c8f3d4e72af904fd6c8a528f3c38dcfe5eeca5dae64324db9f12d38
34
35patchfiles          patch-ApplicationWindow.diff \
36                    patch-qti.sip.diff \
37                    patch-scripting.pri.diff \
38                    patch-qwt3d_openglhelper.diff
39
40#Workaround as qtiplot build-phase hangs indefinitely on
41#Lion (ticket #30761)
42platform darwin 11 {
43    patchfiles-append   patch-disable-O2.diff
44}
45
46use_zip             yes
47
48universal_variant   no
49
50use_parallel_build  yes
51
52pre-configure {
53    # don't step into the manual dir, we don't have all the tools to build it
54    reinplace "/manual/d" ${worksrcpath}/qtiplot.pro
55
56    # create the configuration, see build.conf.example which comes with the package
57    set confFD [open ${worksrcpath}/build.conf "w"]
58    puts $confFD "SYS_INCLUDEPATH = ${prefix}/include"
59    # snow leopard seems to need zlib explicitly, see #23272
60    puts $confFD "SYS_LIBS = -L${prefix}/lib -lz"
61    puts $confFD "MUPARSER_LIBS = -lmuparser"
62    puts $confFD "GSL_LIBS = -lgsl -lgslcblas"
63    puts $confFD "BOOST_LIBS = -lboost_date_time-mt -lboost_thread-mt"
64    # till upstream catches up, we use a local copy of qwt
65    puts $confFD "QWT_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/qwt/src"
66    puts $confFD "QWT_LIBS = \$\$QTI_ROOT/3rdparty/qwt/lib/libqwt.a"
67    puts $confFD "QWT3D_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/qwtplot3d/include"
68    puts $confFD "QWT3D_LIBS = \$\$QTI_ROOT/3rdparty/qwtplot3d/lib/libqwtplot3d.a"
69    puts $confFD "LIBPNG_LIBS = -lpng"
70    # Forcing TamuAnova to nothing
71    puts $confFD "TAMUANOVA_LIBS = " 
72    if {[variant_isset qtexengine]} {
73      puts $confFD "TEX_ENGINE_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/QTeXEngine/src"
74      puts $confFD "TEX_ENGINE_LIBS = \$\$QTI_ROOT/3rdparty/QTeXEngine/libQTeXEngine.a"
75    }
76
77   if {[variant_isset python25]} {
78       puts $confFD "PYTHON = ${prefix}/bin/python2.5"
79   }
80   if {[variant_isset python26]} {
81       puts $confFD "PYTHON = ${prefix}/bin/python2.6"
82   }
83   if {[variant_isset python27]} {
84       puts $confFD "PYTHON = ${prefix}/bin/python2.7"
85   }
86
87    # target specific configuration
88    puts $confFD "contains( TARGET, qtiplot ) \{"
89    puts $confFD "SCRIPTING_LANGS += muParser"; # currently you can't build without
90    if {[variant_isset python25] || [variant_isset python26] || [variant_isset python27]} {
91        puts $confFD "SCRIPTING_LANGS += Python"
92    }
93    puts $confFD "DEFINES += SCRIPTING_CONSOLE"
94    puts $confFD "DEFINES += SCRIPTING_DIALOG"
95    puts $confFD "CONFIG += release"
96    puts $confFD "\}"
97    close $confFD   
98
99    # fix a bug in the python init script
100    # append the current path *before* import __main__, else __file__ points to math.so after the import if this module
101    reinplace "/import __main__/ i\\
102    import sys, os.path\\
103    sys.path.append(os.path.dirname(__file__))
104    " ${worksrcpath}/qtiplot/qtiplotrc.py
105
106    if {[variant_isset qtexengine]} {
107      # prepare qtexengine
108      copy ${workpath}/QTeXEngine ${worksrcpath}/3rdparty/QTeXEngine
109
110      # add 3rdparty to compilation
111      reinplace "s|3rdparty/qwtplot3d \|3rdparty/qwtplot3d 3rdparty/QTeXEngine \|g" \
112      ${worksrcpath}/qtiplot.pro
113
114      # suppress examples which do not compile
115      reinplace "/example/d" ${worksrcpath}/3rdparty/QTeXEngine/QTeXEngine.pro
116    }
117
118    # use system-wide libraries
119    reinplace "s|#unix|unix|g" ${worksrcpath}/qtiplot/qtiplot.pro
120}
121
122configure.pre_args  "PREFIX=${prefix}"
123configure.cmd   "LOCALSOFT=${prefix} ${qt_qmake_cmd}"
124destroot.destdir INSTALL_ROOT=${destroot}
125
126destroot {
127    # install the application bundle and create a symlink for cli invocation
128    xinstall -d ${destroot}${applications_dir}
129    copy "${worksrcpath}/qtiplot/qtiplot.app" ${destroot}${applications_dir}
130    # in this dir python tries to store .pyc files, so it has to be writable
131    file attributes ${destroot}${applications_dir}/qtiplot.app/Contents/MacOS -permissions ugo+w
132    ln -s ${applications_dir}/qtiplot.app/Contents/MacOS/qtiplot ${destroot}${prefix}/bin/qtiplot
133    # install some resources
134    xinstall -W ${worksrcpath}/qtiplot/ \
135        qti_wordlist.txt \
136        qtiUtil.py \
137        qtiplotrc.py \
138        ${destroot}${applications_dir}/qtiplot.app/Contents/MacOS/
139    # install the fitting plugins
140    set plugin_dir ${destroot}${applications_dir}/qtiplot.app/Contents/fitPlugins/
141    file mkdir ${plugin_dir}
142    xinstall -W ${worksrcpath}/fitPlugins/ \
143        libexp_saturation.dylib \
144        libexplin.dylib \
145        libfitRational0.dylib \
146        libfitRational1.dylib \
147        libplanck_wavelength.dylib \
148        ${plugin_dir}
149}
150
151variant qtexengine description "add support for tex exportation" {
152    distfiles-append  QTeXEngine-0.3-opensource.zip
153    checksums-append  QTeXEngine-0.3-opensource.zip \
154                      rmd160  6f75f8e6355515cf5eb8a7b90b9acca8aa889129 \
155                      sha256  fc60c18bd0af5947d2d7dbc3d1b5b16ed251d9f317cc548228347f081a0b67d5
156}
157
158variant python25 conflicts python26 python27 description "add support for python26 scripting" {
159    depends_lib-append port:python25 \
160                       port:py25-sip \
161                       port:py25-pyqt4
162}
163
164variant python26 conflicts python25 python27 description "add support for python26 scripting" {
165    depends_lib-append port:python26 \
166                       port:py26-sip \
167                       port:py26-pyqt4
168}
169
170variant python27 conflicts python25 python26 description "add support for python26 scripting" {
171    depends_lib-append port:python27 \
172                       port:py27-sip \
173                       port:py27-pyqt4
174}
Note: See TracBrowser for help on using the repository browser.