source: trunk/dports/aqua/qtiplot/Portfile

Last change on this file was 145572, checked in by devans@…, 18 months ago

qtiplot: remove +python25 +python26 legacy compatibility variants, obsolete since 2014/12/21.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.5 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 145572 2016-02-09 20:13:15Z ryandesign@macports.org $
3
4PortSystem  1.0
5PortGroup           qmake 1.0
6
7name                qtiplot
8version             0.9.8.9
9revision            12
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://www.qtiplot.com/
24master_sites        sourceforge:${name}.berlios
25use_zip             yes
26
27depends_lib-append  port:muparser \
28                    port:boost \
29                    port:gsl \
30                    port:libpng \
31                    port:zlib
32
33checksums           ${name}-${version}.zip \
34                    rmd160  d0ae793b4fbf6eab723f049493d6d954ee8b747e \
35                    sha256  3d2cc2503c8f3d4e72af904fd6c8a528f3c38dcfe5eeca5dae64324db9f12d38
36
37# gsl patch from https://packages.debian.org/sid/math/qtiplot
38patchfiles          patch-ApplicationWindow.diff \
39                    patch-qti.sip.diff \
40                    patch-scripting.pri.diff \
41                    patch-qwt3d_openglhelper.diff \
42                    patch-gsl2.diff \
43                    patch-sip-4.15.diff
44
45pre-configure {
46    # don't step into the manual dir, we don't have all the tools to build it
47    reinplace "/manual/d" ${worksrcpath}/qtiplot.pro
48
49    # create the configuration, see build.conf.example which comes with the package
50    set confFD [open ${worksrcpath}/build.conf "w"]
51    puts $confFD "SYS_INCLUDEPATH = ${prefix}/include"
52    # snow leopard seems to need zlib explicitly, see #23272
53    puts $confFD "SYS_LIBS = -L${prefix}/lib -lz"
54    puts $confFD "MUPARSER_LIBS = -lmuparser"
55    puts $confFD "GSL_LIBS = -lgsl -lgslcblas"
56    puts $confFD "BOOST_LIBS = -lboost_date_time-mt -lboost_thread-mt"
57    # till upstream catches up, we use a local copy of qwt
58    puts $confFD "QWT_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/qwt/src"
59    puts $confFD "QWT_LIBS = \$\$QTI_ROOT/3rdparty/qwt/lib/libqwt.a"
60    puts $confFD "QWT3D_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/qwtplot3d/include"
61    puts $confFD "QWT3D_LIBS = \$\$QTI_ROOT/3rdparty/qwtplot3d/lib/libqwtplot3d.a"
62    puts $confFD "LIBPNG_LIBS = -lpng"
63    # Forcing TamuAnova to nothing
64    puts $confFD "TAMUANOVA_LIBS = "
65    if {[variant_isset qtexengine]} {
66      puts $confFD "TEX_ENGINE_INCLUDEPATH = \$\$QTI_ROOT/3rdparty/QTeXEngine/src"
67      puts $confFD "TEX_ENGINE_LIBS = \$\$QTI_ROOT/3rdparty/QTeXEngine/libQTeXEngine.a"
68    }
69
70   if {[variant_isset python27]} {
71       puts $confFD "PYTHON = ${prefix}/bin/python2.7"
72   }
73
74    # target specific configuration
75    puts $confFD "contains( TARGET, qtiplot ) \{"
76    puts $confFD "SCRIPTING_LANGS += muParser"; # currently you can't build without
77    if {[variant_isset python27]} {
78        puts $confFD "SCRIPTING_LANGS += Python"
79    }
80    puts $confFD "DEFINES += SCRIPTING_CONSOLE"
81    puts $confFD "DEFINES += SCRIPTING_DIALOG"
82    puts $confFD "CONFIG += release"
83    puts $confFD "\}"
84    close $confFD
85
86    # fix a bug in the python init script
87    # append the current path *before* import __main__, else __file__ points to math.so after the import if this module
88    reinplace "/import __main__/ i\\
89    import sys, os.path\\
90    sys.path.append(os.path.dirname(__file__))
91    " ${worksrcpath}/qtiplot/qtiplotrc.py
92
93    if {[variant_isset qtexengine]} {
94      # prepare qtexengine
95      copy ${workpath}/QTeXEngine ${worksrcpath}/3rdparty/QTeXEngine
96
97      # add 3rdparty to compilation
98      reinplace "s|3rdparty/qwtplot3d \|3rdparty/qwtplot3d 3rdparty/QTeXEngine \|g" \
99      ${worksrcpath}/qtiplot.pro
100
101      # suppress examples which do not compile
102      reinplace "/example/d" ${worksrcpath}/3rdparty/QTeXEngine/QTeXEngine.pro
103      reinplace "/test/d" ${worksrcpath}/3rdparty/QTeXEngine/QTeXEngine.pro
104    }
105
106    # use system-wide libraries
107    reinplace "s|#unix|unix|g" ${worksrcpath}/qtiplot/qtiplot.pro
108
109    # force use of zlib in qwtplot3d
110    reinplace "s|GL2PS_HAVE_LIBPNG|GL2PS_HAVE_ZLIB GL2PS_HAVE_LIBPNG|g" \
111    ${worksrcpath}/3rdparty/qwtplot3d/qwtplot3d.pro
112}
113
114destroot.destdir INSTALL_ROOT=${destroot}
115
116destroot {
117    # install the application bundle and create a symlink for cli invocation
118    xinstall -d ${destroot}${applications_dir}
119    copy "${worksrcpath}/qtiplot/qtiplot.app" ${destroot}${applications_dir}/QtiPlot.app
120    ln -s ${applications_dir}/QtiPlot.app/Contents/MacOS/qtiplot ${destroot}${prefix}/bin/qtiplot
121    # install some resources
122    xinstall -W ${worksrcpath}/qtiplot/ \
123        qti_wordlist.txt \
124        qtiUtil.py \
125        qtiplotrc.py \
126        ${destroot}${applications_dir}/QtiPlot.app/Contents/MacOS/
127    # install the fitting plugins
128    set plugin_dir ${destroot}${applications_dir}/QtiPlot.app/Contents/fitPlugins/
129    file mkdir ${plugin_dir}
130    xinstall -W ${worksrcpath}/fitPlugins/ \
131        libexp_saturation.dylib \
132        libexplin.dylib \
133        libfitRational0.dylib \
134        libfitRational1.dylib \
135        libplanck_wavelength.dylib \
136        ${plugin_dir}
137}
138
139variant qtexengine description "add support for tex exportation" {
140    distfiles-append  QTeXEngine-0.3-opensource.zip
141    checksums-append  QTeXEngine-0.3-opensource.zip \
142                      rmd160  6f75f8e6355515cf5eb8a7b90b9acca8aa889129 \
143                      sha256  fc60c18bd0af5947d2d7dbc3d1b5b16ed251d9f317cc548228347f081a0b67d5
144}
145
146variant python27 description "add support for python27 scripting" {
147
148    post-destroot {
149        system "${prefix}/bin/python2.7 -m compileall ${destroot}${applications_dir}/QtiPlot.app/Contents/MacOS"
150    }
151    # prior to r143477 (2015-12-13), pyc files were generated after installation
152    pre-activate {
153        foreach pyc [glob -directory ${applications_dir}/QtiPlot.app/Contents/MacOS -nocomplain *.pyc] {
154            delete ${pyc}
155        }
156    }
157
158    # Can use either py*-pyqt4 or py*-pyqt4-devel.
159    depends_lib-append port:python27 \
160                       port:py27-sip \
161                       path:share/py27-sip/PyQt4:py27-pyqt4
162}
Note: See TracBrowser for help on using the repository browser.