Ticket #43738: gnuplot-5.0-RC1.Portfile

File gnuplot-5.0-RC1.Portfile, 7.2 KB (added by mojca (Mojca Miklavec), 11 years ago)

Gnuplot 5.0-RC1

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 120160 2014-05-17 15:00:01Z mojca@macports.org $
3
4PortSystem                  1.0
5PortGroup                   elisp           1.0
6PortGroup                   texlive         1.0
7PortGroup                   xcodeversion    1.0
8PortGroup                   wxWidgets       1.0
9
10name                        gnuplot
11version                     5.0.rc1
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  2f3b83e27492889ecb888b57382066b423ce1229 \
35                            sha256  0943f29f3a954fd2ee2cacd4f881e7471dccd18742ce117e41b225864219bd8a \
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:libiconv \
45                            port:libpng \
46                            port:ncurses \
47                            port:readline \
48                            port:zlib
49
50minimum_xcodeversions       {9 3.1}
51
52configure.args              --with-readline=${prefix} \
53                            --with-gd=${prefix} \
54                            --with-caca=${prefix} \
55                            --without-aquaterm \
56                            --without-x \
57                            --infodir='\${prefix}/share/info' \
58                            --mandir='\${prefix}/share/man' \
59                            --with-cwdrc \
60                            --disable-wxwidgets \
61                            --without-bitmap-terminals \
62                            --without-cairo \
63                            --without-latex \
64                            --without-lua \
65                            --without-pdf \
66                            --without-qt \
67                            --without-tutorial
68
69#                           --without-lisp-files \
70
71variant aquaterm description "Enable AquaTerm terminal" {
72    depends_lib-append      port:aquaterm
73    configure.args-delete   --without-aquaterm
74    configure.cflags-append "-F${frameworks_dir}"
75    configure.ldflags-append "-F${frameworks_dir}"
76    configure.args-append   --with-aquaterm
77}
78
79variant x11 {
80    configure.args-delete   --without-x
81    configure.args-append   --with-x
82    depends_lib-append      port:xpm
83}
84
85# don't know how to implement that
86# variant emacs description "An emacs mode for working with gnuplot" {
87#     depends_build-append    port:${emacs_binary_provider}
88#     configure.env-append    EMACS=${emacs_binary}
89#     configure.args-delete   --without-lisp-files
90#     configure.args-append   --with-lisp-files --with-lispdir=${emacs_lispdir}
91# }
92
93variant luaterm description "Enable lua-based terminals" {
94    depends_lib-append      port:lua
95    configure.args-delete   --without-lua
96    configure.args-append   --with-lua
97}
98
99variant pangocairo description "Enable cairo-based terminals" {
100    depends_lib-append      path:lib/pkgconfig/pango.pc:pango
101    configure.args-delete   --without-cairo
102}
103
104variant pdflib description "Enable pdflib-based pdf terminal" {
105    depends_lib-append      port:pdflib
106    configure.args-replace  --without-pdf --with-pdf=${prefix}
107}
108
109variant wxwidgets description "Enable wxt terminal" {
110    wxWidgets.use           wxWidgets-3.0
111    depends_lib-append      port:${wxWidgets.port} path:lib/pkgconfig/pango.pc:pango
112    configure.args-delete   --disable-wxwidgets
113    configure.args-append   --with-wx=${wxWidgets.wxdir}
114}
115
116# remove in September 2014
117variant wxwidgets30     description "Legacy compatibility variant" {}
118variant wxwidgets_devel description "Legacy compatibility variant" {}
119
120variant qt description "Enable qt terminal" {
121    depends_lib-append      port:qt4-mac
122    configure.args-replace  --without-qt --with-qt=qt4
123}
124
125# Ideally one would enable just PMB by default, but '--with-bitmap-terminals'
126# enables lots of other obsolete terminals which clutter the output of 'set term'.
127variant old_bitmap_terminals description "Enable PBM (Portable Bit Map) and other older bitmap terminals" {
128    configure.args-delete   --without-bitmap-terminals
129    configure.args-append   --with-bitmap-terminals
130}
131
132default_variants            +aquaterm +luaterm +pangocairo +wxwidgets +x11
133
134if {[variant_isset wxwidgets30] || [variant_isset wxwidgets_devel]} {
135    default_variants-append +wxwidgets
136}
137
138# Building and installing TeX macro files for TikZ could/should be done by gnuplot's Makefile,
139# but without a patch that would require a dependency on texlive.
140# Apart from that the files would fly to the wrong place in TDS,
141# so that plain TeX and ConTeXt could not find them (an upstream bug).
142# So we 'manually' generate and copy the necessary files.
143post-build {
144    if {[variant_isset luaterm]} {
145        system -W ${workpath}/${distname}/share/LaTeX "${prefix}/bin/lua ../../term/lua/gnuplot-tikz.lua style"
146    }
147}
148
149post-destroot {
150    if {[variant_isset luaterm]} {
151        set texmf ${destroot}${texlive_texmfports}
152        set luadir ${workpath}/${distname}/share/LaTeX
153        xinstall -d -m 0755 ${texmf}/tex/context/third/gnuplot-lua-tikz
154        xinstall -d -m 0755 ${texmf}/tex/generic/gnuplot-lua-tikz
155        xinstall -d -m 0755 ${texmf}/tex/latex/gnuplot-lua-tikz
156        xinstall -d -m 0755 ${texmf}/tex/plain/gnuplot-lua-tikz
157
158        xinstall -m 0644 ${luadir}/t-gnuplot-lua-tikz.tex      ${texmf}/tex/context/third/gnuplot-lua-tikz
159        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz-common.tex ${texmf}/tex/generic/gnuplot-lua-tikz
160        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz.sty        ${texmf}/tex/latex/gnuplot-lua-tikz
161        xinstall -m 0644 ${luadir}/gnuplot-lua-tikz.tex        ${texmf}/tex/plain/gnuplot-lua-tikz
162    }
163
164    set destdocdir ${destroot}${prefix}/share/doc/${name}
165    xinstall -d -m 0755 ${destdocdir}
166    xinstall -m 0644 ${workpath}/${distname}/docs/${name}.pdf ${destdocdir}
167
168    # copy demo files
169    file copy ${workpath}/${distname}/demo ${destdocdir}
170    foreach {makefile} {Makefile Makefile.in Makefile.am Makefile.am.in} {
171        delete ${destdocdir}/demo/${makefile}
172    }
173}