source: trunk/dports/graphics/pgplot/Portfile @ 75159

Last change on this file since 75159 was 75159, checked in by rmstonecipher@…, 7 years ago

graphics/libpng upgraded version from 1.2.44 to 1.4.5 per ticket #23125, increased revision on all ports directly dependent upon libpng12.dylib

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 9.3 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 75159 2011-01-17 02:00:53Z rmstonecipher@macports.org $
3
4PortSystem                      1.0
5
6name                            pgplot
7version                         5.2.2
8revision                        6
9categories                      graphics devel
10maintainers                     mcalhoun openmaintainer
11description                     C/Fortran graphics library
12long_description \
13        The PGPLOT Graphics Subroutine Library is a Fortran- or C-callable, \
14        device-independent graphics package for making simple scientific \
15        graphs.  It is intended for making graphical images of publication \
16        quality with minimum effort on the part of the user. For most \
17        applications, the program can be device-independent, and the output can \
18        be directed to the appropriate device at run time.
19
20platforms                       darwin
21
22homepage                        http://www.astro.caltech.edu/~tjp/pgplot/
23master_sites            ftp://ftp.astro.caltech.edu/pub/pgplot/
24
25distname                        ${name}[join [split ${version} .] ""]
26
27worksrcdir                      build
28set srcdir          ${workpath}/${name}
29
30checksums \
31    md5 e8a6e8d0d5ef9d1709dfb567724525ae \
32    sha1 1f1c9aa17eeec9a2fb23fd15a0e4a91dcc49ddc1 \
33    rmd160 4c21cad6613772f4104c65ac3d8d9a42e3c4afe1
34
35patchfiles     patch-makemake.diff patch-drivers.list.patch patch-proccom.c.diff
36depends_lib    port:libpng port:zlib port:xorg-libX11
37depends_build  bin:perl:perl5 port:pkgconfig
38
39# Tell the compiler not to treat backslash characters as C-style escape sequences.
40configure.fcflags-append  -fno-backslash
41
42set compat_version  [join [lrange [split ${version} .] 0 0] .]
43
44pre-patch {
45    file mkdir ${worksrcpath}
46}
47
48post-patch {
49    # Ensure MacPorts libraries are being used.
50    reinplace "s|\\(-L\\\\`pwd\\\\`\\)|\\1 -L${prefix}/lib|" ${srcdir}/makemake
51
52    # Look in the correct place for run-time data files.
53    reinplace "s|/usr/local/pgplot/|${prefix}/share/${name}/|" ${srcdir}/src/grgfil.f
54
55    # /usr/local/bin/perl may not exist.
56    reinplace "s|#!/usr/local/bin/perl|#!/usr/bin/env perl|" ${srcdir}/makehtml ${srcdir}/maketex
57
58    copy ${srcdir}/drivers.list ${worksrcpath}
59
60    set drivers  "GIF VGIF LATEX PNG TPNG PS VPS CPS VCPS"
61
62    if {![variant_isset no_x11]} {
63        # XDISP does not work because the program figdisp can not be found.
64        lappend drivers XWINDOW XSERVE
65    }
66
67    if {[variant_isset aquaterm]} {
68        lappend drivers AQT
69    }
70
71    foreach driver ${drivers} {
72        reinplace "s|!\\(.*/${driver} .*\\)| \\1|" ${worksrcpath}/drivers.list
73    }
74}
75
76pre-configure {
77    set shlib_opts \
78        "-dynamiclib -single_module -current_version ${version} -compatibility_version ${compat_version}"
79
80    if {![variant_isset no_x11]} {
81        # XQuartz or MacPorts X11 (pkg-config gives precedence to MacPorts X11)
82        eval configure.ldflags-append   [exec pkg-config x11 --libs-only-L]
83        set x11Libs                     [exec pkg-config x11 --libs-only-l]
84        eval configure.cppflags-append  [exec pkg-config x11 --cflags]
85    } else {
86        set x11Libs  ""
87    }
88
89    if {[variant_isset aquaterm]} {
90        set aqtLibs  "-laquaterm -Wl,-framework -Wl,Foundation"
91    } else {
92        set aqtLibs  ""
93    }
94
95    # Create configuration file.
96    #    For a description of options, see ${srcdir}/sys_linux/g77_gcc.conf
97    lappend options  XINCL            "${configure.cppflags}"
98    lappend options  MOTIF_INCL       ""
99    lappend options  ATHENA_INCL      ""
100    lappend options  TK_INCL          ""
101    lappend options  RV_INCL          ""
102    lappend options  FCOMPL           "${configure.fc}"
103    lappend options  FFLAGC           "${configure.fcflags}"
104    lappend options  FFLAGD           ""
105    lappend options  CCOMPL           "${configure.cc}"
106    lappend options  CFLAGC           "${configure.cppflags} ${configure.cflags}"
107    lappend options  CFLAGD           ""
108    lappend options  PGBIND_FLAGS     "bsd"
109    lappend options  LIBS             "${configure.ldflags} ${x11Libs} ${aqtLibs}"
110    lappend options  MOTIF_LIBS       ""
111    lappend options  ATHENA_LIBS      ""
112    lappend options  TK_LIBS          ""
113    lappend options  RANLIB           "/usr/bin/ranlib"
114    lappend options  SHARED_LIB       "libpgplot${version}.dylib"
115    lappend options  SHARED_LD        "${configure.fc} ${shlib_opts} ${configure.ldflags} ${x11Libs} -install_name ${prefix}/lib/libpgplot${compat_version}.dylib"
116    lappend options  SHARED_LIB_LIBS  "${configure.ldflags} -lpng ${aqtLibs}"
117    lappend options  MCOMPL           "${configure.objc}"
118    lappend options  MFLAGC           "${configure.objcflags}"
119    lappend options  SYSDIR           "\\\$SYSDIR"
120
121    # The following variables are not part of the unpatched pgplot.
122    #     They have been added to facilitate building a shared C library.
123    lappend options  CSHARED_LIB      "libcpgplot${version}.dylib"
124    lappend options  CSHARED_LD       "${configure.fc} ${shlib_opts} ${configure.ldflags} ${x11Libs} -install_name ${prefix}/lib/libcpgplot${compat_version}.dylib"
125
126    file mkdir ${srcdir}/sys_darwin
127    foreach {var val} ${options} {
128        system "/bin/echo \"   ${var}=\\\"${val}\\\"\" >> ${srcdir}/sys_darwin/marcports.conf"
129    }
130
131    # Create optional routine which makemake will find and compile.
132    system "/bin/echo \"int iand_ (int *a, int *b) { return *a & *b;}\" >> ${srcdir}/sys_darwin/iand.c"
133}
134
135configure.cmd       ${srcdir}/makemake
136configure.pre_args
137configure.args      ${srcdir} ${os.platform}
138
139# When linking against fortran code, PG_PPU gets number of underscores correct.
140configure.cppflags-append  -DPG_PPU
141
142# Build the C PGPLOT wrapper library, HTML documentation, and TeX files.
143build.target-append cpg pgplot.html pgplot-routines.tex
144
145destroot {
146    # pgxwin_server is only built if the X11 drivers are requested.
147    # pgdisp is only built if the XDISP driver is requested.
148    foreach fl [glob -directory ${worksrcpath} -nocomplain pgxwin_server pgdisp] {
149        xinstall -m 755 ${fl} ${destroot}${prefix}/bin
150    }
151
152    foreach fl [glob -directory ${worksrcpath} -nocomplain *.dylib] {
153        xinstall -m 755 ${fl} ${destroot}${prefix}/lib
154    }
155
156    foreach fl [glob -directory ${worksrcpath} -nocomplain *.a] {
157        xinstall -m 644 ${fl} ${destroot}${prefix}/lib
158    }
159
160    foreach fl [glob -directory ${worksrcpath} -nocomplain *.h] {
161        xinstall -m 644 ${fl} ${destroot}${prefix}/include
162    }
163
164    # Install run-time data files.
165    xinstall -d -m 755 ${destroot}${prefix}/share/${name}
166    foreach fl [glob -directory ${worksrcpath} -nocomplain *.dat *.txt] {
167        xinstall -m 644 ${fl} ${destroot}${prefix}/share/${name}
168    }
169
170    # Install docs.
171    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
172    xinstall -m 644 ${srcdir}/copyright.notice ${destroot}${prefix}/share/doc/${name}
173    foreach fl [glob -directory ${worksrcpath} -nocomplain *.doc *.html *.pdf] {
174        xinstall -m 644 ${fl} ${destroot}${prefix}/share/doc/${name}
175    }
176
177    # Install examples.
178    xinstall -d -m 755 ${destroot}${prefix}/share/${name}/examples
179    foreach fl [glob -directory ${srcdir} examples/pgdemo*.f cpg/cpgdemo*.c drivers/*/pg*demo.*] {
180        xinstall -m 644 ${fl} ${destroot}${prefix}/share/${name}/examples
181    }
182    foreach fl [glob -directory ${worksrcpath} *demo*] {
183        xinstall -m 755 ${fl} ${destroot}${prefix}/share/${name}/examples
184    }
185
186    # Create more library names.
187    ln -s libcpgplot${version}.dylib ${destroot}${prefix}/lib/libcpgplot.dylib
188    ln -s libcpgplot${version}.dylib ${destroot}${prefix}/lib/libcpgplot[join [lrange [split ${version} .] 0 0] .].dylib
189    ln -s libcpgplot${version}.dylib ${destroot}${prefix}/lib/libcpgplot[join [lrange [split ${version} .] 0 1] .].dylib
190
191    ln -s libpgplot${version}.dylib  ${destroot}${prefix}/lib/libpgplot.dylib
192    ln -s libpgplot${version}.dylib  ${destroot}${prefix}/lib/libpgplot[join [lrange [split ${version} .] 0 0] .].dylib
193    ln -s libpgplot${version}.dylib  ${destroot}${prefix}/lib/libpgplot[join [lrange [split ${version} .] 0 1] .].dylib
194}
195
196use_parallel_build  no
197
198universal_variant no
199
200variant no_x11 {
201    depends_lib-delete    port:xorg-libX11
202    depends_build-delete  port:pkgconfig
203}
204
205variant aquaterm description {install driver for aquaterm} {
206    depends_lib-append port:aquaterm
207
208    post-extract {
209        copy ${prefix}/share/aquaterm/adapters/pgplot/aqdriv.m ${srcdir}/drivers
210    }
211}
212
213variant gcc42 description {build with gfortran from gcc42} conflicts gcc43 gcc44 gcc45 g95 {
214    depends_lib-append  port:gcc42
215    configure.fc  ${prefix}/bin/gfortran-mp-4.2
216}
217
218variant gcc43 description {build with gfortran from gcc43} conflicts gcc42 gcc44 gcc45 g95 {
219    depends_lib-append  port:gcc43
220    configure.fc  ${prefix}/bin/gfortran-mp-4.3
221}
222
223variant gcc44 description {build with gfortran from gcc44} conflicts gcc42 gcc43 gcc45 g95 {
224    depends_lib-append  port:gcc44
225    configure.fc  ${prefix}/bin/gfortran-mp-4.4
226}
227
228variant gcc45 description {build with gfortran from gcc45} conflicts gcc42 gcc43 gcc44 g95 {
229    depends_lib-append  port:gcc45
230    configure.fc  ${prefix}/bin/gfortran-mp-4.5
231}
232variant g95 description {build with g95} conflicts gcc42 gcc43 gcc44 gcc45 {
233    depends_lib-append  port:g95
234    configure.fc  ${prefix}/bin/g95
235}
236
237if {![variant_isset g95] && ![variant_isset gcc42] && ![variant_isset gcc43] && ![variant_isset gcc45]} {
238    default_variants +gcc44
239}
240
241variant docs description {Create and install docs} {
242    depends_build-append bin:pdflatex:texlive
243
244    post-build {
245        system "cd ${worksrcpath} && pdflatex pgplot-routines.tex && pdflatex pgplot-routines.tex"
246    }
247}
Note: See TracBrowser for help on using the repository browser.