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

Last change on this file since 117944 was 117944, checked in by michaelld@…, 5 years ago

qtiplot: rev bump for new SIP API.

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