Ticket #15925: Portfile

File Portfile, 3.5 KB (added by davidh@…, 16 years ago)

revised Portfile that makes gcc42/gfortran the default compiler

Line 
1# $Id: Portfile,v 1.7 2008/07/03 22:01:14 davidh Exp $
2
3PortSystem                      1.0
4name                            pgplot
5version                         5.2.2
6revision                        3
7categories                      graphics devel
8maintainers                     nomaintainer
9description                     C/Fortran graphics library
10long_description \
11        The PGPLOT Graphics Subroutine Library is a Fortran- or C-callable, \
12        device-independent graphics package for making simple scientific \
13        graphs.  It is intended for making graphical images of publication \
14        quality with minimum effort on the part of the user. For most \
15        applications, the program can be device-independent, and the output can \
16        be directed to the appropriate device at run time.
17
18platforms                       darwin
19
20homepage                        http://www.astro.caltech.edu/~tjp/pgplot/
21master_sites            ftp://ftp.astro.caltech.edu/pub/pgplot/:pgplot
22
23distfiles                       ${name}5.2.tar.gz:pgplot
24
25distname                        ${name}5.2:pgplot
26
27worksrcdir                      ${name}/build:pgplot
28
29checksums                       ${name}5.2.tar.gz md5 e8a6e8d0d5ef9d1709dfb567724525ae
30
31depends_lib                     lib:libpng:libpng lib:libz:zlib
32
33patchfiles                      patch-makemake patch-src_grgfil.f patch-drivers.list \
34                                        patch-pgdispd_proccom.c patch-sys_darwin_aaaread.me
35
36post-extract {
37        file mkdir ${worksrcpath}
38}
39
40pre-patch {
41        file copy ${worksrcpath}/../drivers.list ${worksrcpath}/drivers.list
42}
43
44post-patch {
45        reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/../src/grgfil.f
46}
47
48configure {
49        cd ${worksrcpath}
50        system "../makemake .. ${ppMakeMakeTarget} ${ppCompilerSpec}"
51}
52
53build.target            all
54
55post-build {
56        cd ${worksrcpath}
57        system "make cpg"
58}
59
60destroot {
61        xinstall -m 755 -d ${destroot}${prefix}/share/${name} \
62                ${destroot}${prefix}/share/doc/${name}
63        xinstall -m 644 -W ${worksrcpath} grfont.dat rgb.txt \
64                ${destroot}${prefix}/share/${name}
65        xinstall -m 644 -W ${worksrcpath} libpgplot.a libcpgplot.a \
66                ${destroot}${prefix}/lib
67        system "ranlib ${destroot}${prefix}/lib/libpgplot.a \
68                ${destroot}${prefix}/lib/libcpgplot.a"
69        xinstall -m 644 -W ${worksrcpath} cpgplot.h ${destroot}${prefix}/include
70        xinstall -m 644 -W ${worksrcpath} pgplot.doc ../copyright.notice \
71                ${destroot}${prefix}/share/doc/${name}
72}
73
74set ppMakeMakeTarget    darwin
75set ppCompilerSpec              nocompiler     
76
77variant g77 description {compiles with g77 compiler} conflicts  gcc42   {
78        depends_lib-append          bin:g77-dp-3.4:gcc34
79        set ppCompilerSpec              g77_gcc
80        patchfiles-append               patch-sys_darwin_g77_gcc.conf
81}
82
83variant gcc42 description {compiles with gcc42 compiler}  conflicts  g77  {
84        depends_lib-append      port:gcc42
85        set ppCompilerSpec      gfortran_gcc_42
86        patchfiles-append       patch-sys_darwin_gfortran_gcc_42.conf
87}
88
89post-patch {
90                reinplace "s|@@PREFIX@@|${prefix}|g" \
91                        ${worksrcpath}/../sys_darwin/${ppCompilerSpec}.conf
92                reinplace "s|@@X11PREFIX@@|${x11prefix}|g" \
93                        ${worksrcpath}/../sys_darwin/${ppCompilerSpec}.conf
94}
95
96variant x11 {
97        depends_lib-append      lib:libX11:XFree86
98
99        patchfiles-append       patch-drivers_x11.list
100
101        post-destroot {
102                xinstall -m 755 -W ${worksrcpath} pgdisp pgxwin_server \
103                        ${destroot}${prefix}/bin
104        }
105}
106
107variant aqt {
108# Variant that adds aquaterm driver support
109        depends_lib-append      port:aquaterm
110        patchfiles-append       patch-drivers.list_aqt \
111                                                patch-sys_darwin_${ppCompilerSpec}.conf_aqt \
112                                                patch-makemake_aqt
113       
114        pre-patch {
115                file copy ${prefix}/share/aquaterm/pgplot/aqdriv.m ${workpath}/pgplot/drivers/
116        }
117
118        post-destroot {
119                xinstall -m 755 -W ${worksrcpath} libpgplot.dylib \
120                        ${destroot}${prefix}/lib
121        }
122}
123
124# Variant to install demo programs
125variant demos {
126        post-destroot {
127                foreach f [glob {pgdemo[1-9]} {pgdemo1[0-7]}] {
128                        xinstall -m 755 -W ${worksrcpath} $f ${destroot}${prefix}/bin
129                }
130        }
131}
132
133default_variants +x11 +aqt +gcc42