Ticket #11479: patch-pgplot

File patch-pgplot, 13.2 KB (added by davidm@…, 18 years ago)
Line 
1Index: dports/graphics/pgplot/files/patch-aqdriv.m_aqt
2===================================================================
3--- dports/graphics/pgplot/files/patch-aqdriv.m_aqt     (revision 22587)
4+++ dports/graphics/pgplot/files/patch-aqdriv.m_aqt     (working copy)
5@@ -1,9 +0,0 @@
6---- ../drivers/aqdriv.m.org    2006-04-19 13:54:12.000000000 -0500
7-+++ ../drivers/aqdriv.m        2006-04-19 13:52:30.000000000 -0500
8-@@ -1,5 +1,5 @@
9- #import <Foundation/Foundation.h>
10--#import "aquaterm/AQTAdapter.h"
11-+#import <AQTAdapter.h>
12-
13- /* Debugging extras */
14- static inline void NOOP_(id x, ...) {;}
15Index: dports/graphics/pgplot/files/patch-sys_darwin_gfortran_gcc_42.conf
16===================================================================
17--- dports/graphics/pgplot/files/patch-sys_darwin_gfortran_gcc_42.conf  (revision 0)
18+++ dports/graphics/pgplot/files/patch-sys_darwin_gfortran_gcc_42.conf  (revision 0)
19@@ -0,0 +1,147 @@
20+--- ../sys_darwin/gfortran_gcc_42.conf.orig    Wed Dec 31 17:00:00 1969
21++++ ../sys_darwin/gfortran_gcc_42.conf Mon May 17 17:25:36 2004
22+@@ -0,0 +1,144 @@
23++# The MacPorts build of version 4.2 of the GNU gfortran compiler
24++# and GNU gcc C compiler on Darwin.
25++#-----------------------------------------------------------------------
26++
27++# Optional: Needed by XWDRIV (/xwindow and /xserve) and
28++#           X2DRIV (/xdisp and /figdisp).
29++# The arguments needed by the C compiler to locate X-window include files.
30++
31++   XINCL="-I@@X11PREFIX@@/include"
32++
33++# Optional: Needed by XMDRIV (/xmotif).
34++# The arguments needed by the C compiler to locate Motif, Xt and
35++# X-window include files.
36++
37++   MOTIF_INCL=""
38++
39++# Optional: Needed by XADRIV (/xathena).
40++# The arguments needed by the C compiler to locate Xaw, Xt and
41++# X-window include files.
42++
43++   ATHENA_INCL=""
44++
45++# Optional: Needed by TKDRIV (/xtk).
46++# The arguments needed by the C compiler to locate Tcl, Tk and
47++# X-window include files.
48++
49++   TK_INCL=""
50++
51++# Optional: Needed by RVDRIV (/xrv).
52++# The arguments needed by the C compiler to locate Rivet, Tcl, Tk and
53++# X-window include files.
54++
55++   RV_INCL=""
56++
57++# Mandatory.
58++# The FORTRAN compiler to use.
59++
60++   FCOMPL="gfortran-dp-4.2"
61++
62++# Mandatory.
63++# The FORTRAN compiler flags to use when compiling the pgplot library.
64++# (NB. makemake prepends -c to $FFLAGC where needed)
65++
66++   FFLAGC="-Wall -O -I@@PREFIX@@/include"
67++
68++# Mandatory.
69++# The FORTRAN compiler flags to use when compiling fortran demo programs.
70++# This may need to include a flag to tell the compiler not to treat
71++# backslash characters as C-style escape sequences
72++
73++   FFLAGD="-fno-backslash $FFLAGC"
74++
75++# Mandatory.
76++# The C compiler to use.
77++
78++   CCOMPL="gcc-dp-4.2"
79++
80++# Mandatory.
81++# The C compiler flags to use when compiling the pgplot library.
82++
83++   CFLAGC="-Wall -DPG_PPU -O3 -I@@PREFIX@@/include"
84++
85++# Mandatory.
86++# The C compiler flags to use when compiling C demo programs.
87++
88++   CFLAGD="$CFLAGC"
89++
90++# Optional: Only needed if the cpgplot library is to be compiled.
91++# The flags to use when running pgbind to create the C pgplot wrapper
92++# library. (See pgplot/cpg/pgbind.usage)
93++
94++   PGBIND_FLAGS="bsd"
95++
96++# Mandatory.
97++# The library-specification flags to use when linking normal pgplot
98++# demo programs.
99++
100++   LIBS="-L@@PREFIX@@/lib -L@@X11PREFIX@@/lib -lX11"
101++
102++# Optional: Needed by XMDRIV (/xmotif).
103++# The library-specification flags to use when linking motif
104++# demo programs.
105++
106++   MOTIF_LIBS=""
107++
108++# Optional: Needed by XADRIV (/xathena).
109++# The library-specification flags to use when linking athena
110++# demo programs.
111++
112++   ATHENA_LIBS=""
113++
114++# Optional: Needed by TKDRIV (/xtk).
115++# The library-specification flags to use when linking Tk demo programs.
116++# Note that you may need to append version numbers to -ltk and -ltcl.
117++
118++   TK_LIBS=""
119++
120++# Mandatory.
121++# On systems that have a ranlib utility, put "ranlib" here. On other
122++# systems put ":" here (Colon is the Bourne-shell do-nothing command).
123++
124++   RANLIB="ranlib"
125++
126++# Optional: Needed on systems that support shared libraries.
127++# The name to give the shared pgplot library.
128++
129++   SHARED_LIB=""
130++
131++# Optional: Needed if SHARED_LIB is set.
132++# How to create a shared library from a trailing list of object files.
133++
134++   SHARED_LD=""
135++
136++# Optional:
137++# On systems such as Solaris 2.x, that allow specification of the
138++# libraries that a shared library needs to be linked with when a
139++# program that uses it is run, this variable should contain the
140++# library-specification flags used to specify these libraries to
141++# $SHARED_LD
142++
143++   SHARED_LIB_LIBS=""
144++
145++# Optional:
146++# Compiler name used on Next systems to compile objective-C files.
147++
148++   MCOMPL=""
149++
150++# Optional:
151++# Compiler flags used with MCOMPL when compiling objective-C files.
152++
153++   MFLAGC=""
154++
155++# Optional: (Actually mandatory, but already defined by makemake).
156++# Where to look for any system-specific versions of the files in
157++# pgplot/sys. Before evaluating this script, makemake sets SYSDIR to
158++# /wherever/pgplot/sys_$OS, where $OS is the operating-system name
159++# given by the second command-line argument of makemake. If the
160++# present configuration is one of many for this OS, and it needs
161++# different modifications to files in pgplot/sys than the other
162++# configurations, then you should create a subdirectory of SYSDIR,
163++# place the modified files in it and change the following line to
164++# $SYSDIR="$SYSDIR/subdirectory_name".
165++
166++   SYSDIR="$SYSDIR"
167Index: dports/graphics/pgplot/files/patch-sys_darwin_g77_gcc.conf_aqt
168===================================================================
169--- dports/graphics/pgplot/files/patch-sys_darwin_g77_gcc.conf_aqt      (revision 22587)
170+++ dports/graphics/pgplot/files/patch-sys_darwin_g77_gcc.conf_aqt      (working copy)
171@@ -47,7 +47,7 @@
172  # $SHARED_LD
173   
174 -   SHARED_LIB_LIBS=""
175-+   SHARED_LIB_LIBS="$LIBS -L@@PREFIX@@/lib/gcc-3.4 -lg2c -lSystem -lpng"
176++   SHARED_LIB_LIBS="$LIBS -L@@PREFIX@@/lib/gcc-3.4 -lg2c -lSystem -laquaterm -lpng"
177 
178  # Optional:
179  # Compiler name used on Next systems to compile objective-C files.
180Index: dports/graphics/pgplot/files/patch-drivers.list_aqt
181===================================================================
182--- dports/graphics/pgplot/files/patch-drivers.list_aqt (revision 22587)
183+++ dports/graphics/pgplot/files/patch-drivers.list_aqt (working copy)
184@@ -1,10 +1,10 @@
185---- ../drivers.list.org        2006-04-19 12:18:30.000000000 -0500
186-+++ ../drivers.list    2006-04-19 12:19:47.000000000 -0500
187+--- drivers.list.org   2006-04-19 12:18:30.000000000 -0500
188++++ drivers.list       2006-04-19 12:19:47.000000000 -0500
189 @@ -5,6 +5,7 @@
190  ! available on selected operating systems only.
191  !------------------------------------------------------------------------------
192  ! File       Code       Description                                Restrictions
193-+AQDRIV 0 /AQT         AquaTerm.app under Mac OS X                                             C
194++AQDRIV 0 /AQT       AquaTerm.app under Mac OS X                       C
195  ! BCDRIV 0 /BCANON    Canon Laser printer (bitmap version), landscape
196  ! CADRIV 0 /CANON     Canon Laser printer, LBP-8/A2, landscape
197  ! CCDRIV 0 /CCP       DEC LJ250 Color Companion printer
198Index: dports/graphics/pgplot/files/patch-sys_darwin_gfortran_gcc_42.conf_aqt
199===================================================================
200--- dports/graphics/pgplot/files/patch-sys_darwin_gfortran_gcc_42.conf_aqt      (revision 0)
201+++ dports/graphics/pgplot/files/patch-sys_darwin_gfortran_gcc_42.conf_aqt      (revision 0)
202@@ -0,0 +1,65 @@
203+--- ../sys_darwin/gfortran_gcc_42.conf.org     2006-04-19 12:15:45.000000000 -0500
204++++ ../sys_darwin/gfortran_gcc_42.conf 2006-04-19 12:16:16.000000000 -0500
205+@@ -41,7 +41,7 @@
206+ # The FORTRAN compiler flags to use when compiling the pgplot library.
207+ # (NB. makemake prepends -c to $FFLAGC where needed)
208
209+-   FFLAGC="-Wall -O -I@@PREFIX@@/include"
210++   FFLAGC="-Wall -O -I@@PREFIX@@/include -I@@PREFIX@@/include/aquaterm"
211+
212+ # Mandatory.
213+ # The FORTRAN compiler flags to use when compiling fortran demo programs.
214+@@ -58,7 +58,7 @@
215+ # Mandatory.
216+ # The C compiler flags to use when compiling the pgplot library.
217
218+-   CFLAGC="-Wall -DPG_PPU -O3 -I@@PREFIX@@/include"
219++   CFLAGC="-Wall -DPG_PPU -O3 -I@@PREFIX@@/include -I@@PREFIX@@/include/aquaterm"
220+
221+ # Mandatory.
222+ # The C compiler flags to use when compiling C demo programs.
223+@@ -75,7 +75,7 @@
224+ # The library-specification flags to use when linking normal pgplot
225+ # demo programs.
226
227+-   LIBS="-L@@PREFIX@@/lib -L@@X11PREFIX@@/lib -lX11"
228++   LIBS="-L@@PREFIX@@/lib -L@@X11PREFIX@@/lib -lX11 -Wl,-framework -Wl,Foundation"
229+
230+ # Optional: Needed by XMDRIV (/xmotif).
231+ # The library-specification flags to use when linking motif
232+@@ -104,12 +104,12 @@
233+ # Optional: Needed on systems that support shared libraries.
234+ # The name to give the shared pgplot library.
235
236+-   SHARED_LIB=""
237++   SHARED_LIB="libpgplot.dylib"
238+
239+ # Optional: Needed if SHARED_LIB is set.
240+ # How to create a shared library from a trailing list of object files.
241
242+-   SHARED_LD=""
243++   SHARED_LD="gcc-dp-4.2 -dynamiclib -single_module -o $SHARED_LIB -install_name @@PREFIX@@/lib/$SHARED_LIB"
244+
245+ # Optional:
246+ # On systems such as Solaris 2.x, that allow specification of the
247+@@ -118,17 +118,17 @@
248+ # library-specification flags used to specify these libraries to
249+ # $SHARED_LD
250
251+-   SHARED_LIB_LIBS=""
252++   SHARED_LIB_LIBS="$LIBS -lgfortran -lSystem -laquaterm -lpng"
253+
254+ # Optional:
255+ # Compiler name used on Next systems to compile objective-C files.
256
257+-   MCOMPL=""
258++   MCOMPL="gcc-dp-4.2"
259+
260+ # Optional:
261+ # Compiler flags used with MCOMPL when compiling objective-C files.
262
263+-   MFLAGC=""
264++   MFLAGC="-no-cpp-precomp -DPG_PPU -O2 -I. -I@@PREFIX@@/include/aquaterm"
265+
266+ # Optional: (Actually mandatory, but already defined by makemake).
267+ # Where to look for any system-specific versions of the files in
268Index: dports/graphics/pgplot/Portfile
269===================================================================
270--- dports/graphics/pgplot/Portfile     (revision 22587)
271+++ dports/graphics/pgplot/Portfile     (working copy)
272@@ -18,21 +18,15 @@
273 platforms                      darwin
274 
275 homepage                       http://www.astro.caltech.edu/~tjp/pgplot/
276-master_sites            ftp://ftp.astro.caltech.edu/pub/pgplot/:pgplot \
277-                        sourceforge:aquaterm:aqt
278+master_sites            ftp://ftp.astro.caltech.edu/pub/pgplot/:pgplot
279 
280-set aqtversion         1.0.0
281-
282 distfiles                      ${name}5.2.tar.gz:pgplot
283 
284-distname                       ${name}5.2:pgplot \
285-                               aquaterm_src.${aqtversion}:aqt
286+distname                       ${name}5.2:pgplot
287 
288 worksrcdir                     ${name}/build:pgplot
289-                               
290 
291-checksums                      ${name}5.2.tar.gz md5 e8a6e8d0d5ef9d1709dfb567724525ae \
292-                               aquaterm_src.${aqtversion}.tar.gz md5 937461dfefb62178bee960bfe88e0991
293+checksums                      ${name}5.2.tar.gz md5 e8a6e8d0d5ef9d1709dfb567724525ae
294 
295 depends_lib                    lib:libpng:libpng lib:libz:zlib bin:g77-dp-3.4:gcc34
296 
297@@ -53,7 +47,7 @@
298 
299 configure {
300        cd ${worksrcpath}
301-       system "../makemake .. ${ppMakeMakeTarget}"
302+       system "../makemake .. ${ppMakeMakeTarget} ${ppCompilerSpec}"
303 }
304 
305 build.target           all
306@@ -75,40 +69,67 @@
307        xinstall -m 644 -W ${worksrcpath} cpgplot.h ${destroot}/${prefix}/include
308        xinstall -m 644 -W ${worksrcpath} pgplot.doc ../copyright.notice \
309                ${destroot}/${prefix}/share/doc/${name}
310-       if {[variant_isset x11]} {
311-               xinstall -m 755 -W ${worksrcpath} pgdisp pgxwin_server \
312-                       ${destroot}/${prefix}/bin
313-       }
314 }
315 
316-variant x11 {
317-       depends_lib-append      lib:libX11:XFree86
318-
319-       patchfiles-append       patch-drivers_x11.list
320-}
321-
322-variant darwin {
323-       global ppMakeMakeTarget
324+platform darwin {
325+       global ppMakeMakeTarget ppCompilerSpec
326        set ppMakeMakeTarget    darwin
327+       set ppCompilerSpec              g77_gcc
328        patchfiles-append               patch-sys_darwin_aaaread.me \
329                                                        patch-sys_darwin_g77_gcc.conf
330        post-patch {
331                reinplace "s|@@PREFIX@@|${prefix}|g" \
332-                       ${worksrcpath}/../sys_darwin/g77_gcc.conf
333+                       ${worksrcpath}/../sys_darwin/${ppCompilerSpec}.conf
334                reinplace "s|@@X11PREFIX@@|${x11prefix}|g" \
335-                       ${worksrcpath}/../sys_darwin/g77_gcc.conf
336+                       ${worksrcpath}/../sys_darwin/${ppCompilerSpec}.conf
337        }
338 }
339 
340+platform darwin 8 i386 {
341+       depends_lib-delete      bin:g77-dp-3.4:gcc34
342+       depends_lib-append      port:gcc42
343+
344+       set ppCompilerSpec      gfortran_gcc_42
345+
346+       patchfiles-delete       patch-sys_darwin_g77_gcc.conf
347+       patchfiles-append       patch-sys_darwin_gfortran_gcc_42.conf
348+}
349+
350+default_variants +x11 +aqt
351+
352+variant x11 {
353+       depends_lib-append      lib:libX11:XFree86
354+
355+       patchfiles-append       patch-drivers_x11.list
356+
357+       post-destroot {
358+               xinstall -m 755 -W ${worksrcpath} pgdisp pgxwin_server \
359+                       ${destroot}/${prefix}/bin
360+       }
361+}
362+
363 variant aqt {
364 # Variant that adds aquaterm driver support
365-       distfiles-append        aquaterm_src.${aqtversion}.tar.gz:aqt
366+       depends_lib-append      port:aquaterm
367        patchfiles-append       patch-drivers.list_aqt \
368-                                               patch-sys_darwin_g77_gcc.conf_aqt \
369-                                               patch-makemake_aqt \
370-                                               patch-aqdriv.m_aqt
371+                                               patch-sys_darwin_${ppCompilerSpec}.conf_aqt \
372+                                               patch-makemake_aqt
373       
374        pre-patch {
375-               file copy ${workpath}/adapters/pgplot/aqdriv.m ${workpath}/pgplot/drivers/
376+               file copy ${prefix}/share/aquaterm/pgplot/aqdriv.m ${workpath}/pgplot/drivers/
377        }
378+
379+       post-destroot {
380+               xinstall -m 755 -W ${worksrcpath} libpgplot.dylib \
381+                       ${destroot}/${prefix}/lib
382+       }
383 }
384+
385+# Variant to install demo programs
386+variant demos {
387+       post-destroot {
388+               foreach f [glob {pgdemo[1-9]} {pgdemo1[0-7]}] {
389+                       xinstall -m 755 -W ${worksrcpath} $f ${destroot}/${prefix}/bin
390+               }
391+       }
392+}