[99655] trunk/dports/science
takeshi at macports.org
takeshi at macports.org
Tue Nov 13 06:03:47 PST 2012
Revision: 99655
https://trac.macports.org/changeset/99655
Author: takeshi at macports.org
Date: 2012-11-13 06:03:47 -0800 (Tue, 13 Nov 2012)
Log Message:
-----------
wgrib2: revised build procedure. install libipolate.a, closing #36913. revisions are incremated for grads and ncarg
Modified Paths:
--------------
trunk/dports/science/grads/Portfile
trunk/dports/science/ncarg/Portfile
trunk/dports/science/wgrib2/Portfile
trunk/dports/science/wgrib2/files/patch-dec_png.c.diff
trunk/dports/science/wgrib2/files/patch-enc_png.c.diff
Added Paths:
-----------
trunk/dports/science/wgrib2/files/patch-makefile.diff
Modified: trunk/dports/science/grads/Portfile
===================================================================
--- trunk/dports/science/grads/Portfile 2012-11-13 11:37:12 UTC (rev 99654)
+++ trunk/dports/science/grads/Portfile 2012-11-13 14:03:47 UTC (rev 99655)
@@ -6,7 +6,7 @@
name grads
version 2.0.1
set branch [join [lrange [split ${version} .] 0 1] .]
-revision 1
+revision 2
platforms darwin
maintainers takeshi
license GPL-2
Modified: trunk/dports/science/ncarg/Portfile
===================================================================
--- trunk/dports/science/ncarg/Portfile 2012-11-13 11:37:12 UTC (rev 99654)
+++ trunk/dports/science/ncarg/Portfile 2012-11-13 14:03:47 UTC (rev 99655)
@@ -5,6 +5,7 @@
name ncarg
version 6.1.0
+revision 1
categories science
maintainers takeshi
license {UCAR-Unidata public-domain BSD LGPL-3 GPL-3}
Modified: trunk/dports/science/wgrib2/Portfile
===================================================================
--- trunk/dports/science/wgrib2/Portfile 2012-11-13 11:37:12 UTC (rev 99654)
+++ trunk/dports/science/wgrib2/Portfile 2012-11-13 14:03:47 UTC (rev 99655)
@@ -5,18 +5,18 @@
name wgrib2
version 1.9.6a
-revision 3
+revision 4
platforms darwin
maintainers takeshi
+license public-domain
categories science
description program to read atmospheric data files in GRIB2
master_sites ftp://ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/ \
http://www.ftp.cpc.ncep.noaa.gov/wd51we/wgrib2/
distname ${name}_nolib.tgz.v${version}
extract.suffix
+set version_iplib 2012
set version_g2clib 1.2.1
-set iplib iplib.2012
-worksrcdir grib2/g2clib-${version_g2clib}
checksums md5 c9d383552210070c5df3115a806c0f66 \
sha1 7ce6f34677b73d32f1504f86fac31184c6c611e9 \
rmd160 e7627292152c74251e684d2529adbe382a8c138e
@@ -31,27 +31,15 @@
port:netcdf \
port:hdf5-18
+worksrcdir grib2
+
patchfiles patch-dec_png.c.diff \
- patch-enc_png.c.diff
+ patch-enc_png.c.diff \
+ patch-makefile.diff
-post-patch {
- set f ${workpath}/grib2/${name}/config.h
- reinplace "s|#define USE_NETCDF3|//#define USE_NETCDF3|" ${f}
- reinplace "s|//#define USE_NETCDF4|#define USE_NETCDF4|" ${f}
- if {![variant_isset g95] && ![variant_isset gcc44] && ![variant_isset gcc45]} {
- reinplace "s|#define USE_IPOLATES|//#define USE_IPOLATES|" ${f}
- }
-}
-
use_configure no
use_parallel_build no
-set cppflags ${configure.cppflags}
-if {[variant_isset g95]} {
- set cppflags "-DG95 ${cppflags}"
-} elseif {[variant_isset gcc44]||[variant_isset gcc45]} {
- set cppflags "-DGFORTRAN ${cppflags}"
-}
if {[variant_isset universal]} {
set cflags "${configure.cflags} ${configure.universal_cflags}"
set ldflags "${configure.ldflags} ${configure.universal_ldflags}"
@@ -59,70 +47,73 @@
set cflags "${configure.cflags} ${configure.cc_archflags}"
set ldflags "${configure.ldflags} ${configure.cc_archflags}"
}
-build.args "-f makefile CC=\"${configure.cc}\" CPPFLAGS=\"${cppflags}\" CFLAGS=\"${cflags}\""
+set ip ${worksrcpath}/iplib.${version_iplib}
+set lipolate ${ip}/libipolate.a
+set g2c ${worksrcpath}/g2clib-${version_g2clib}
+set lg2c ${g2c}/libgrib2c.a
+set gctpc ${worksrcpath}/gctpc
+set lgeo ${gctpc}/source/libgeo.a
+set fsymbol ""
+if {[variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47]} {
+ set fsymbol -DGFORTRAN
+} elseif {[variant_isset g95]} {
+ set fsymbol -DG95
+}
+if {[variant_isset g95] || [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47]} {
+ set iip "-I${ip}"
+ set libs "${lg2c} ${lgeo} ${lipolate}"
+} else {
+ set iip ""
+ set libs "${lg2c} ${lgeo}"
+}
+if {[variant_isset g95]} {
+ set libs "${libs} -lf95"
+ configure.fc ${prefix}/bin/g95
+} elseif {[variant_isset gcc44]} {
+ set libs "${libs} -L${prefix}/lib/gcc44 -lgfortran"
+ configure.fc ${prefix}/bin/gcc-mp-4.4
+} elseif {[variant_isset gcc45]} {
+ set libs "${libs} -L${prefix}/lib/gcc45 -lgfortran"
+ configure.fc ${prefix}/bin/gcc-mp-4.5
+} elseif {[variant_isset gcc46]} {
+ set libs "${libs} -L${prefix}/lib/gcc46 -lgfortran"
+ configure.fc ${prefix}/bin/gcc-mp-4.6
+} elseif {[variant_isset gcc47]} {
+ set libs "${libs} -L${prefix}/lib/gcc47 -lgfortran"
+ configure.fc ${prefix}/bin/gcc-mp-4.7
+}
-post-build {
- system "ranlib ${worksrcpath}/libgrib2c.a"
- if {[variant_isset g95]} {
- system "cd ${workpath}/grib2/${iplib}; \
- make \
- FC=${prefix}/bin/g95 \
- FFLAGS=${configure.fflags}"
- set fsymbol DEFS=-DG95
- set flibs "-L../${iplib} -lipolate -lf95"
- } elseif {[variant_isset gcc44]} {
- system "cd ${workpath}/grib2/${iplib}; \
- make \
- FC=${prefix}/bin/gfortran-mp-4.4 \
- FFLAGS=${configure.fflags}"
- set fsymbol DEFS=-DGFORTRAN
- set flibs "-L../${iplib} -lipolate -L${prefix}/lib/gcc44 -lgfortran"
- } elseif {[variant_isset gcc45]} {
- system "cd ${workpath}/grib2/${iplib}; \
- make \
- FC=${prefix}/bin/gfortran-mp-4.5 \
- FFLAGS=${configure.fflags}"
- set fsymbol DEFS=-DGFORTRAN
- set flibs "-L../${iplib} -lipolate -L${prefix}/lib/gcc45 -lgfortran"
- } elseif {[variant_isset gcc46]} {
- system "cd ${workpath}/grib2/${iplib}; \
- make \
- FC=${prefix}/bin/gfortran-mp-4.6 \
- FFLAGS=${configure.fflags}"
- set fsymbol DEFS=-DGFORTRAN
- set flibs "-L../${iplib} -lipolate -L${prefix}/lib/gcc46 -lgfortran"
- } elseif {[variant_isset gcc47]} {
- system "cd ${workpath}/grib2/${iplib}; \
- make \
- FC=${prefix}/bin/gfortran-mp-4.7 \
- FFLAGS=${configure.fflags}"
- set fsymbol DEFS=-DGFORTRAN
- set flibs "-L../${iplib} -lipolate -L${prefix}/lib/gcc47 -lgfortran"
- } else {
- set fsymbol ""
- set flibs ""
- }
- system "cd ${workpath}/grib2; \
- tar zxvf gctpc20.tar.Z; \
- cd ${workpath}/grib2/gctpc/source; \
- make -f ${workpath}/grib2/makefile.gctpc \
- CC=\"${configure.cc}\" \
- CPPFLAGS=\"${cppflags}\" \
- CFLAGS=\"${cflags}\" \
- LDFLAGS=\"-L${prefix}/lib ${ldflags}\"; \
- cd ${workpath}/grib2/${name}; \
- make -f makefile ${name} \
- CC=\"${configure.cc}\" \
- ${fsymbol} \
- CFLAGS=\"-I../g2clib-${version_g2clib} -I../gctpc/source ${cppflags} ${cflags}\" \
- LDFLAGS=\"-L../g2clib-${version_g2clib} -L../gctpc/source ${ldflags} \
- -lgeo -lgrib2c -ljasper -lpng -lnetcdf -lhdf5_hl -lhdf5 -lz -lcurl -lidn -lssl -lcrypto ${flibs}\" "
+build.env LDFLAGS=\"${libs} ${configure.ldflags} -lpng -ljasper -lnetcdf\" \
+ CC=\"${configure.cc}\" \
+ CPPFLAGS=\"${fsymbol} ${configure.cppflags}\" \
+ CFLAGS=\"${cflags}\"
+build.args "-f makefile \
+ zlib=\"\" plib=\"\" jlib=\"\" h5lib=\"\" n4lib=\"\" \
+ iip=\"${iip}\" "
+if {[variant_isset g95] || [variant_isset gcc44] || [variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47]} {
+ build.args-append USE_IPOLATES=1
+ build.env-append FC=\"${configure.fc}\" \
+ F90=\"${configure.fc}\" \
+ FFLAGS=\"${configure.fflags}\"
}
+if {[variant_isset gcc45] || [variant_isset gcc46] || [variant_isset gcc47]} {
+ build.args-append USE_OPENMP=1
+}
destroot {
- xinstall -m 644 ${worksrcpath}/grib2.h ${destroot}${prefix}/include
- xinstall -m 755 ${worksrcpath}/libgrib2c.a ${destroot}${prefix}/lib
- xinstall -m 755 ${worksrcpath}/../${name}/${name} ${destroot}${prefix}/bin
+ system "ranlib ${lg2c}"
+ xinstall -m 644 ${g2c}/grib2.h ${destroot}${prefix}/include
+ xinstall -m 644 ${lg2c} ${destroot}${prefix}/lib
+ xinstall -m 755 ${worksrcpath}/${name}/${name} ${destroot}${prefix}/bin
+ foreach b {gmerge smallest_4 smallest_grib2} {
+ xinstall -m 755 ${worksrcpath}/aux_progs/${b} ${destroot}${prefix}/bin
+ }
+ if {[file exist ${lipolate}]} {
+ system "ranlib ${ip}/libipolate.a"
+ xinstall -m 644 ${lipolate} ${destroot}${prefix}/lib
+ xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
+ xinstall -m 644 ${worksrcpath}/README.ipolates ${destroot}${prefix}/share/doc/${name}
+ }
}
variant g95 conflicts gcc44 gcc45 gcc46 gcc47 description {build iplib with g95 (alpha)} {
Modified: trunk/dports/science/wgrib2/files/patch-dec_png.c.diff
===================================================================
--- trunk/dports/science/wgrib2/files/patch-dec_png.c.diff 2012-11-13 11:37:12 UTC (rev 99654)
+++ trunk/dports/science/wgrib2/files/patch-dec_png.c.diff 2012-11-13 14:03:47 UTC (rev 99655)
@@ -1,5 +1,5 @@
---- dec_png.c.orig 2011-07-16 04:38:22.000000000 +0900
-+++ dec_png.c 2012-09-04 15:54:57.000000000 +0900
+--- g2clib-1.2.1/dec_png.c.orig 2011-07-16 04:38:22.000000000 +0900
++++ g2clib-1.2.1/dec_png.c 2012-09-04 15:54:57.000000000 +0900
@@ -88,7 +88,7 @@
/* Set new custom read function */
Modified: trunk/dports/science/wgrib2/files/patch-enc_png.c.diff
===================================================================
--- trunk/dports/science/wgrib2/files/patch-enc_png.c.diff 2012-11-13 11:37:12 UTC (rev 99654)
+++ trunk/dports/science/wgrib2/files/patch-enc_png.c.diff 2012-11-13 14:03:47 UTC (rev 99655)
@@ -1,5 +1,5 @@
---- enc_png.c.orig 2011-07-16 04:38:22.000000000 +0900
-+++ enc_png.c 2012-09-04 15:58:10.000000000 +0900
+--- g2clib-1.2.1/enc_png.c.orig 2011-07-16 04:38:22.000000000 +0900
++++ g2clib-1.2.1/enc_png.c 2012-09-04 15:58:10.000000000 +0900
@@ -88,7 +88,7 @@
/* Set new custom write functions */
Added: trunk/dports/science/wgrib2/files/patch-makefile.diff
===================================================================
--- trunk/dports/science/wgrib2/files/patch-makefile.diff (rev 0)
+++ trunk/dports/science/wgrib2/files/patch-makefile.diff 2012-11-13 14:03:47 UTC (rev 99655)
@@ -0,0 +1,72 @@
+--- makefile.orig 2012-05-15 23:52:15.000000000 +0900
++++ makefile 2012-11-11 22:26:56.000000000 +0900
+@@ -76,8 +76,8 @@
+ #
+
+ # Warning do not set both USE_NETCDF3 and USE_NETCDF4 to one
+-USE_NETCDF3=1
+-USE_NETCDF4=0
++USE_NETCDF3=0
++USE_NETCDF4=1
+ USE_REGEX=1
+ USE_TIGGE=1
+ USE_MYSQL=0
+@@ -94,11 +94,11 @@
+ endif
+ endif
+
+-ifeq ($(USE_NETCDF4),1)
+- ifeq ($(FC),)
+- $(error ERROR, USE_NETCDF4 = 1: must set fortran90 compiler by environement variable FC)
+- endif
+-endif
++#ifeq ($(USE_NETCDF4),1)
++# ifeq ($(FC),)
++# $(error ERROR, USE_NETCDF4 = 1: must set fortran90 compiler by environement variable FC)
++# endif
++#endif
+
+ ifeq ($(USE_IPOLATES),1)
+ ifeq ($(FC),)
+@@ -346,8 +346,8 @@
+ all: ${prog} aux_progs/gmerge aux_progs/smallest_grib2 aux_progs/smallest_4
+
+
+-${prog}: $w/*.c $w/*.h ${jlib} ${nlib} ${zlib} ${plib} ${h5lib} ${glib} ${n4lib} ${iplib} ${gctpclib}
+- cd $w && export LDFLAGS="${wLDFLAGS}" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE}
++${prog}: $w/*.c $w/*.h ${glib} ${iplib} ${gctpclib}
++ cd $w && ${MAKE} CPPFLAGS="-I${g} -I${gctpc}/source ${iip} ${CPPFLAGS}"
+
+ fast: $w/*.c $w/*.h ${jlib} ${nlib} ${zlib} ${plib} ${h5lib} ${glib} ${n4lib} ${iplib} ${gctpclib}
+ cd $w && export LDFLAGS="${wLDFLAGS}" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE}
+@@ -378,10 +378,10 @@
+ cd $z && export CFLAGS="${wCPPFLAGS}" && ./configure && ${MAKE}
+
+
+-${glib}: ${jlib} ${plib} ${zlib}
++${glib}:
+ touch ${glib}
+ rm ${glib}
+- cd $g && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE}
++ cd $g && ${MAKE} CPPFLAGS="-I${g} ${CPPFLAGS}"
+
+ ${gctpclib}:
+ cp gctpc20.tar.Z tmpgctpc.tar.Z
+@@ -389,7 +389,7 @@
+ tar -xvf tmpgctpc.tar
+ rm tmpgctpc.tar
+ cp makefile.gctpc proj.h ${gctpc}/source/
+- cd ${gctpc}/source && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} -f makefile.gctpc
++ cd ${gctpc}/source && ${MAKE} -f makefile.gctpc CPPFLAGS="-I${gctpc}/source ${CPPFLAGS}"
+
+ ${nlib}:
+ cp netcdf.tar.gz tmpn.tar.gz
+@@ -423,7 +423,7 @@
+ cd ${h5} && export CPPFLAGS="${CPPFLAGS}" && ./configure --disable-shared --disable-fortran --with-zlib=$z && ${MAKE} && ${MAKE}
+
+ ${iplib}:
+- cd ${ip} && export F90=${F90} && export FFLAGS="${wFFLAGS}" && ${MAKE}
++ cd ${ip} && ${MAKE}
+
+ aux_progs/gmerge: aux_progs/gmerge.c
+ cd aux_progs && ${MAKE} -f gmerge.make
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121113/1d6c00ee/attachment-0001.html>
More information about the macports-changes
mailing list