Ticket #15827: Portfile.diff
File Portfile.diff, 8.4 KB (added by numaryu, 16 years ago) |
---|
-
Portfile
old new 1 1 # $Id: Portfile 33172 2008-01-20 17:34:57Z ryandesign@macports.org $ 2 2 3 PortSystem 4 name 5 version 6 revision 37 categories 8 maintainers 9 description 3 PortSystem 1.0 4 name pgplot 5 version 5.2.2 6 revision 4 7 categories graphics devel 8 maintainers nomaintainer 9 description C/Fortran graphics library 10 10 long_description \ 11 11 The PGPLOT Graphics Subroutine Library is a Fortran- or C-callable, \ 12 12 device-independent graphics package for making simple scientific \ … … 15 15 applications, the program can be device-independent, and the output can \ 16 16 be directed to the appropriate device at run time. 17 17 18 platforms 18 platforms darwin 19 19 20 homepage 21 master_sites 20 homepage http://www.astro.caltech.edu/~tjp/pgplot/ 21 master_sites ftp://ftp.astro.caltech.edu/pub/pgplot/:pgplot 22 22 23 distfiles 23 distfiles ${name}5.2.tar.gz:pgplot 24 24 25 distname 25 distname ${name}5.2:pgplot 26 26 27 worksrcdir 27 worksrcdir ${name}/build:pgplot 28 28 29 checksums 29 checksums ${name}5.2.tar.gz md5 e8a6e8d0d5ef9d1709dfb567724525ae 30 30 31 depends_lib lib:libpng:libpng lib:libz:zlib bin:g77-dp-3.4:gcc3431 depends_lib lib:libpng:libpng lib:libz:zlib 32 32 33 patchfiles patch-makemake patch-src_grgfil.f patch-drivers.list \ 34 patch-pgdispd_proccom.c 33 patchfiles patch-makemake patch-src_grgfil.f \ 34 patch-drivers.list patch-pgdispd_proccom.c \ 35 patch-local.conf 35 36 36 37 post-extract { 37 38 file mkdir ${worksrcpath} … … 43 44 44 45 post-patch { 45 46 reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/../src/grgfil.f 47 reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/local.conf 48 reinplace "s|@@X11PREFIX@@|${x11prefix}|g" ${worksrcpath}/local.conf 49 reinplace "s|@@FCOMPL@@|${fcompl}|g" ${worksrcpath}/local.conf 50 reinplace "s|@@FC_OPT@@|${fc_opt}|g" ${worksrcpath}/local.conf 51 reinplace "s|@@FD_OPT@@|${fd_opt}|g" ${worksrcpath}/local.conf 52 reinplace "s|@@CCOMPL@@|${ccompl}|g" ${worksrcpath}/local.conf 53 reinplace "s|@@CC_OPT@@|${cc_opt}|g" ${worksrcpath}/local.conf 54 reinplace "s|@@CD_OPT@@|${cd_opt}|g" ${worksrcpath}/local.conf 55 reinplace "s|@@MCOMPL@@|${mcompl}|g" ${worksrcpath}/local.conf 56 reinplace "s|@@MC_OPT@@|${mc_opt}|g" ${worksrcpath}/local.conf 57 reinplace "s|@@XLIB@@|${xlib}|g" ${worksrcpath}/local.conf 58 reinplace "s|@@AQTINC@@|${aqtinc}|g" ${worksrcpath}/local.conf 59 reinplace "s|@@AQTLIB@@|${aqtlib}|g" ${worksrcpath}/local.conf 60 reinplace "s|@@SHARED_LIB@@|${shared_lib}|g" ${worksrcpath}/local.conf 61 reinplace "s|@@SHARED_LD@@|${shared_ld}|g" ${worksrcpath}/local.conf 62 reinplace "s|@@SHARED_LIB_LIBS@@|${shared_lib_libs}|g" ${worksrcpath}/local.conf 46 63 } 47 64 48 65 configure { 49 66 cd ${worksrcpath} 50 system "../makemake .. ${ppMakeMakeTarget} ${ppCompilerSpec}"67 system "../makemake .. darwin" 51 68 } 52 69 53 build.target all 54 55 post-build { 56 cd ${worksrcpath} 57 system "make cpg" 58 } 70 #build.target all 71 build.target lib grfont.dat libcpgplot.a cpgplot.h 59 72 60 73 destroot { 61 74 xinstall -m 755 -d ${destroot}${prefix}/share/${name} \ … … 67 80 system "ranlib ${destroot}${prefix}/lib/libpgplot.a \ 68 81 ${destroot}${prefix}/lib/libcpgplot.a" 69 82 xinstall -m 644 -W ${worksrcpath} cpgplot.h ${destroot}${prefix}/include 70 xinstall -m 644 -W ${worksrcpath} pgplot.doc../copyright.notice \83 xinstall -m 644 -W ${worksrcpath} ../copyright.notice \ 71 84 ${destroot}${prefix}/share/doc/${name} 72 85 } 73 86 87 default_variants +x11 +aqt +shared +doc 88 74 89 platform darwin { 75 global ppMakeMakeTarget ppCompilerSpec 76 set ppMakeMakeTarget darwin 77 set ppCompilerSpec g77_gcc 78 patchfiles-append patch-sys_darwin_aaaread.me \ 79 patch-sys_darwin_g77_gcc.conf 80 post-patch { 81 reinplace "s|@@PREFIX@@|${prefix}|g" \ 82 ${worksrcpath}/../sys_darwin/${ppCompilerSpec}.conf 83 reinplace "s|@@X11PREFIX@@|${x11prefix}|g" \ 84 ${worksrcpath}/../sys_darwin/${ppCompilerSpec}.conf 85 } 90 patchfiles-append patch-sys_darwin_aaaread.me 86 91 } 87 92 88 platform darwin i386 { 89 depends_lib-delete bin:g77-dp-3.4:gcc34 90 depends_lib-append port:gcc42 91 92 set ppCompilerSpec gfortran_gcc_42 93 94 patchfiles-delete patch-sys_darwin_g77_gcc.conf 95 patchfiles-append patch-sys_darwin_gfortran_gcc_42.conf 93 # default compiler is gcc43 94 set default_compiler_port port:gcc43 95 depends_lib-append ${default_compiler_port} 96 global fcompl ccompl 97 global fc_opt fd_opt cc_opt cd_opt 98 set fcompl gfortran-mp-4.3 99 #set fc_opt "-Wall -O" 100 set fc_opt ${configure.fflags} 101 set fd_opt "-fno-backslash \$FFLAGC" 102 set ccompl gcc-mp-4.3 103 #set cc_opt "-Wall -DPG_PPU -O3" 104 set cc_opt "${configure.cflags} -DPG_PPU" 105 set cd_opt "\$CFLAGC" 106 set shared_opt "-dynamiclib -single_module" 107 set shared_lib_libs_f "-lgfortran" 108 109 variant gcc34 description {use g77 Fortran compiler from gcc34} conflicts gcc42 gcc43 g95 { 110 depened_lib-delete ${default_compiler_port} 111 # depends_lib-append port:gcc34 112 depends_lib-append bin:g77-dp-3.4:gcc34 113 set fcompl g77-dp-4.2 114 set ccompl gcc 115 set shared_opt "-dynamiclib -single_module" 116 set shared_lib_libs_f "-L${prefix}/lib/gcc-3.4 -lg2c" 96 117 } 97 118 98 default_variants +x11 +aqt 99 100 variant x11 { 101 depends_lib-append lib:libX11:XFree86 119 variant gcc42 description {use gcc42 compiler suite} conflicts gcc34 gcc43 g95 { 120 depends_lib-delete ${default_compiler_port} 121 depends_lib-append port:gcc42 122 set fcompl gfortran-mp-4.2 123 set ccompl gcc-mp-4.2 124 set shared_opt "-dynamiclib -single_module" 125 set shared_lib_libs_f "-lgfortran" 126 } 127 128 #variant gcc43 description {use gcc43 compiler suite} conflicts gcc34 gcc42 g95 { 129 # depends_lib-delete ${default_compiler_port} 130 # depends_lib-append port:gcc43 131 # set fcompl gfortran-mp-4.3 132 # set ccompl gcc-mp-4.3 133 # set shared_opt "-dynamiclib -single_module" 134 # set shared_lib_libs_f "-lgfortran" 135 #} 136 137 variant g95 description {use g95 Fortran compiler} conflicts gcc34 gcc42 gcc43 { 138 depends_lib-delete ${default_compiler_port} 139 depends_lib-append port:g95 140 set fcompl g95 141 set ccompl gcc 142 set shared_opt "-dynamiclib -single_module" 143 set shared_lib_libs_f "-lf95" 144 } 145 146 global shared_lib shared_ld shared_lib_libs 147 set shared_lib "" 148 set shared_ld "" 149 set shared_lib_libs "" 150 variant shared description {create shared library} { 151 set shared_lib libpgplot.dylib 152 set shared_ld "${ccompl} -o \$SHARED_LIB ${shared_opt} -install_name ${prefix}/lib/\$SHARED_LIB" 153 set shared_lib_libs "\$LIBS ${shared_lib_libs_f} -lSystem -lpng ${aqtlib}" 154 post-destroot { 155 xinstall -m 755 -W ${worksrcpath} libpgplot.dylib \ 156 ${destroot}${prefix}/lib 157 } 158 159 } 102 160 103 patchfiles-append patch-drivers_x11.list 161 global xlib 162 set xlib "" 163 variant x11 description {invoke X11 graphics devices} { 164 build.target-append pgdisp pgxwin_server 165 depends_lib-append lib:libX11:xorg 166 patchfiles-append patch-drivers.list_x11 167 set xlib "-L${x11prefix}/lib -lX11" 104 168 105 169 post-destroot { 106 170 xinstall -m 755 -W ${worksrcpath} pgdisp pgxwin_server \ … … 108 172 } 109 173 } 110 174 111 variant aqt { 175 global aqtinc aqtlib mcompl 176 set aqtinc "" 177 set aqtlib "" 178 set mcompl "" 179 set mc_opt "" 180 variant aqt description {invoke Aquaterm graphics device} { 112 181 # Variant that adds aquaterm driver support 113 182 depends_lib-append port:aquaterm 114 183 patchfiles-append patch-drivers.list_aqt \ 115 patch-sys_darwin_${ppCompilerSpec}.conf_aqt \ 116 patch-makemake_aqt 184 patch-makemake_aqt 185 set aqtinc -I${prefix}/include/aquaterm 186 set aqtlib "-Wl,-framework -Wl,Foundation -laquaterm" 187 set mcompl ${ccompl} 188 set mc_opt "-DPG_PPU -O2 -I. ${aqtinc}" 117 189 118 190 pre-patch { 119 191 file copy ${prefix}/share/aquaterm/pgplot/aqdriv.m ${workpath}/pgplot/drivers/ 120 192 } 121 193 122 post-destroot {123 xinstall -m 755 -W ${worksrcpath} libpgplot.dylib \124 ${destroot}${prefix}/lib125 }126 194 } 127 195 128 196 # Variant to install demo programs 129 variant demos { 197 variant demos description {install demo programs} { 198 build.target-append prog cpgdemo 130 199 post-destroot { 131 200 foreach f [glob {pgdemo[1-9]} {pgdemo1[0-7]}] { 132 201 xinstall -m 755 -W ${worksrcpath} $f ${destroot}${prefix}/bin 133 202 } 203 xinstall -m 755 -W ${worksrcpath} cpgdemo ${destroot}${prefix}/bin 204 } 205 } 206 207 variant doc description {install documents} { 208 build.target-append pgplot.doc 209 post-destroot { 210 xinstall -m 644 -W ${worksrcpath} pgplot.doc \ 211 ${destroot}${prefix}/share/doc/${name} 134 212 } 135 213 }