source: trunk/dports/math/gnuplot/Portfile @ 140264

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

gnuplot: fixes to make it compatible with lua 5.3 (#48826)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.4 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 140264 2015-09-15 17:02:13Z mojca@macports.org $
3
4PortSystem          1.0
5PortGroup           texlive         1.0
6PortGroup           xcodeversion    1.0
7PortGroup           wxWidgets       1.0
8
9name                gnuplot
10version             5.0.1
11revision            2
12categories          math science
13# the license has some inconvenient requirements that we're not meeting
14# to be allowed to distribute binaries
15license             Restrictive
16# luckily nothing has to link against this
17installs_libs       no
18platforms           darwin
19maintainers         mojca openmaintainer
20
21description         A command-driven interactive function plotting program
22
23long_description    Gnuplot is a command-driven interactive function \
24                    plotting program. Plots any number of functions, \
25                    built up of C operators, C library functions, and \
26                    some things C does not have like **, sgn(), etc. \
27                    Also support for plotting data files, to compare \
28                    actual data to theoretical curves.
29
30homepage            http://gnuplot.sourceforge.net/
31master_sites        sourceforge:project/gnuplot/gnuplot/${version}
32dist_subdir         ${name}/${version}
33
34checksums           rmd160  cf2b952af27b0c4ce88ce5d796b07e1c6af4b620 \
35                    sha256  7cbc557e71df581ea520123fb439dea5f073adcc9010a2885dc80d4ed28b3c47
36
37depends_build       path:bin/pkg-config:pkgconfig
38
39depends_lib         port:expat \
40                    port:fontconfig \
41                    port:gd2 \
42                    port:jpeg \
43                    port:libcaca \
44                    port:libcerf \
45                    port:libiconv \
46                    port:libpng \
47                    port:ncurses \
48                    port:readline \
49                    port:zlib
50
51minimum_xcodeversions \
52                    {9 3.1}
53
54patchfiles          patch-configure.diff \
55                    patch-term-lua.trm.diff
56
57configure.args      --with-caca=${prefix} \
58                    --with-gd=${prefix} \
59                    --with-readline=${prefix} \
60                    --without-aquaterm \
61                    --without-x \
62                    --infodir='\${prefix}/share/info' \
63                    --mandir='\${prefix}/share/man' \
64                    --disable-wxwidgets \
65                    --without-bitmap-terminals \
66                    --without-cairo \
67                    --without-latex \
68                    --without-lua \
69                    --without-pdf \
70                    --without-qt \
71                    --without-tutorial \
72                    --with-cwdrc
73
74variant aquaterm description "Enable AquaTerm terminal" {
75    depends_lib-append          port:aquaterm
76    configure.args-replace      --without-aquaterm --with-aquaterm
77    configure.cflags-append     "-F${frameworks_dir}"
78    configure.ldflags-append    "-F${frameworks_dir}"
79}
80
81variant x11 {
82    configure.args-replace      --without-x --with-x
83    depends_lib-append          port:xpm
84}
85
86variant luaterm description "Enable lua-based terminals" {
87    depends_lib-append          port:lua
88    configure.args-replace      --without-lua --with-lua
89}
90
91variant pangocairo description "Enable cairo-based terminals" {
92    configure.args-delete       --without-cairo
93}
94
95variant pdflib description "Enable pdflib-based pdf terminal" {
96    depends_lib-append          port:pdflib
97    configure.args-replace      --without-pdf --with-pdf=${prefix}
98}
99
100variant wxwidgets description "Enable wxt terminal" {
101    wxWidgets.use               wxWidgets-3.0
102    depends_lib-append          port:${wxWidgets.port}
103    configure.args-replace      --disable-wxwidgets --with-wx=${wxWidgets.wxdir}
104}
105
106variant qt conflicts qt5 description "Enable qt terminal with Qt 4" {
107    depends_lib-append          port:qt4-mac
108    configure.args-replace      --without-qt --with-qt=qt4
109}
110
111variant qt5 conflicts qt description "Enable qt terminal with Qt 5" {
112    depends_lib-append          port:qt5-mac
113    configure.env-append        "PKG_CONFIG_PATH=${prefix}/libexec/qt5-mac/lib/pkgconfig"
114
115    configure.args-replace      --without-qt --with-qt=qt5
116}
117
118
119# Ideally one would enable just PMB by default, but '--with-bitmap-terminals'
120# enables lots of other obsolete terminals which clutter the output of 'set term'.
121variant old_bitmap_terminals description "Enable PBM (Portable Bit Map) and other older bitmap terminals" {
122    configure.args-replace      --without-bitmap-terminals --with-bitmap-terminals
123}
124
125default_variants                +aquaterm +luaterm +pangocairo +wxwidgets +x11
126
127if {[variant_isset pangocairo] || [variant_isset wxwidgets]} {
128    depends_lib-append          path:lib/pkgconfig/pango.pc:pango
129}
130
131# Building and installing TeX macro files for TikZ could/should be done by gnuplot's Makefile,
132# but without a patch that would require a dependency on texlive.
133# Apart from that the files would fly to the wrong place in TDS,
134# so that plain TeX and ConTeXt could not find them (an upstream bug).
135# So we 'manually' generate and copy the necessary files.
136post-build {
137    if {[variant_isset luaterm]} {
138        system -W ${worksrcpath}/share/LaTeX "${prefix}/bin/lua ../../term/lua/gnuplot-tikz.lua style"
139    }
140}
141
142post-destroot {
143    if {[variant_isset luaterm]} {
144        set texmf ${destroot}${texlive_texmfports}
145        set luadir ${worksrcpath}/share/LaTeX
146        xinstall -d -m 0755 ${texmf}/tex/context/third/gnuplot-lua-tikz
147        xinstall -d -m 0755 ${texmf}/tex/generic/gnuplot-lua-tikz
148        xinstall -d -m 0755 ${texmf}/tex/latex/gnuplot-lua-tikz
149        xinstall -d -m 0755 ${texmf}/tex/plain/gnuplot-lua-tikz
150
151        xinstall -m 0644 ${luadir}/t-gnuplot-lua-tikz.tex      ${texmf}/tex/context/third/gnuplot-lua-tikz
152        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz-common.tex ${texmf}/tex/generic/gnuplot-lua-tikz
153        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz.sty        ${texmf}/tex/latex/gnuplot-lua-tikz
154        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz.tex        ${texmf}/tex/plain/gnuplot-lua-tikz
155    }
156
157    set destdocdir ${destroot}${prefix}/share/doc/${name}
158    xinstall -d -m 0755 ${destdocdir}
159    xinstall -m 0644 ${worksrcpath}/docs/${name}.pdf ${destdocdir}
160
161    # copy demo files
162    file copy ${worksrcpath}/demo ${destdocdir}
163    foreach {makefile} {Makefile Makefile.in Makefile.am Makefile.am.in} {
164        delete ${destdocdir}/demo/${makefile}
165    }
166}
Note: See TracBrowser for help on using the repository browser.