[121032] trunk/dports/science/wgrib2

takeshi at macports.org takeshi at macports.org
Sat Jun 14 20:21:33 PDT 2014


Revision: 121032
          https://trac.macports.org/changeset/121032
Author:   takeshi at macports.org
Date:     2014-06-14 20:21:33 -0700 (Sat, 14 Jun 2014)
Log Message:
-----------
wgrib2: updated for 2.0.0. use PortGroup compilers. use canonical names for patches. link against a new separate port gctpc

Modified Paths:
--------------
    trunk/dports/science/wgrib2/Portfile
    trunk/dports/science/wgrib2/files/patch-makefile.diff

Added Paths:
-----------
    trunk/dports/science/wgrib2/files/patch-g2clib-makefile.diff
    trunk/dports/science/wgrib2/files/patch-iplib-makefile.diff

Removed Paths:
-------------
    trunk/dports/science/wgrib2/files/ranlib.patch

Modified: trunk/dports/science/wgrib2/Portfile
===================================================================
--- trunk/dports/science/wgrib2/Portfile	2014-06-15 03:15:05 UTC (rev 121031)
+++ trunk/dports/science/wgrib2/Portfile	2014-06-15 03:21:33 UTC (rev 121032)
@@ -1,11 +1,14 @@
 # -*- 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
 # $Id$
 
-PortSystem 1.0
+PortSystem          1.0
+PortGroup compilers 1.0
 
+compilers.choose    fc f77 f90
+compilers.setup
+
 name                wgrib2
-version             1.9.9
-revision            3
+version             2.0.0
 platforms           darwin
 maintainers         takeshi
 license             public-domain
@@ -17,9 +20,9 @@
 extract.suffix     
 set version_iplib   2012
 set version_g2clib  1.4.0
-checksums           md5     0b2a6acfcf4e2abf55b72bbdcc06c575 \
-                    sha1    4dafc4aa7369d69c9d4039a0c6bdb6d56f381b90 \
-                    rmd160  da3351788c3b9ca6b77a3039396435c77079213c
+checksums           md5     47fcc30c1b4d4f883952fdd0cb683a97 \
+                    sha1    eee050b720ba4bc4891d41e7f5c81ad2033c091c \
+                    rmd160  f915db25714fb2af88c706988c0ac421e83321fc
 homepage            http://www.cpc.ncep.noaa.gov/products/wesley/wgrib2/
 long_description   \
     wgrib2 is a swiss army knife for grib2 files. \
@@ -33,65 +36,19 @@
 
 worksrcdir          grib2
 
-patchfiles          patch-makefile.diff ranlib.patch
-
-configure           {}
+patchfiles          patch-makefile.diff  \
+                    patch-g2clib-makefile.diff \
+                    patch-iplib-makefile.diff
+use_configure       no
 use_parallel_build  no
 
 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 ""
+set lgctpc -lgctpc
 
-set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
-set g95_conflicts {}
-
-foreach ver ${gcc_versions} {
-    set ver_no_dot [join [split ${ver} "."] ""]
-
-    set variant_line {variant gcc${ver_no_dot} description "build iplib with gfortran from gcc${ver_no_dot}" conflicts g95}
-
-    foreach over ${gcc_versions} {
-        if {${ver} == ${over}} {
-            continue
-        }
-
-        set over_no_dot [join [split ${over} "."] ""]
-        append variant_line " conflicts gcc${over_no_dot}"
-    }
-    append variant_line { {}}
-
-    eval $variant_line
-
-    append g95_conflicts " conflicts gcc${ver_no_dot}"
-}
-
-eval [concat {variant g95 description {build iplib with g95}} $g95_conflicts {{}}]
-
-foreach ver ${gcc_versions} {
-    set ver_no_dot [join [split ${ver} "."] ""]
-
-    if {[variant_isset gcc${ver_no_dot}]} {
-        depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
-        depends_build-append port:gcc${ver_no_dot}
-
-        configure.fc  ${prefix}/bin/gfortran-mp-${ver}
-        set fsymbol -DGFORTRAN
-        set my_ver_no_dot ${ver_no_dot}
-    }
-}
-
-if {[variant_isset g95]} {
-    depends_lib-append path:lib/libgcc/libgcc_s.1.dylib:libgcc
-    depends_build-append port:g95
-
-    configure.fc ${prefix}/bin/g95
-    set fsymbol -DG95
-}
-
+configure.cppflags-append   -I${prefix}/include/gctpc
 if {[variant_isset universal]} {
     set cflags "${configure.cflags} ${configure.universal_cflags}"
     set ldflags "${configure.ldflags} ${configure.universal_ldflags}"
@@ -99,35 +56,42 @@
     set cflags "${configure.cflags} ${configure.cc_archflags}"
     set ldflags "${configure.ldflags} ${configure.cc_archflags}"
 }
+build.args         "-f makefile \
+                    zlib=\"\" plib=\"\" jlib=\"\" h5lib=\"\" n4lib=\"\" "
 
-if {${fsymbol} != ""} {
+set gcc_versions {4.3 4.4 4.5 4.6 4.7 4.8 4.9}
+set fsymbol ""
+if {[fortran_variant_isset]} {
     set iip "-I${ip}"
-    set libs "${lg2c} ${lgeo} ${lipolate}"
+    set libs "${lg2c} ${lgctpc} ${lipolate}"
+    build.args-append   USE_IPOLATES=1
+    if {[variant_isset g95]} {
+        set fsymbol -DG95
+        configure.fc    ${prefix}/bin/g95
+        set libs "${libs} -lf95"
+    } else {
+        set fsymbol -DGFORTRAN
+        build.args-append   USE_OPENMP=1
+        foreach ver ${gcc_versions} {
+            set ver_no_dot [join [split ${ver} "."] ""]
+            if {[variant_isset gcc${ver_no_dot}]} {
+                configure.fc    ${prefix}/bin/gfortran-mp-${ver}
+                set libs "${libs} -L${prefix}/lib/gcc${ver_no_dot} -lgfortran"
+            }
+        }
+    }
+    build.env           FC=\"${configure.fc}\" \
+                        F90=\"${configure.fc}\" \
+                        FFLAGS=\"${configure.fflags}\"
 } else {
     set iip ""
-    set libs "${lg2c} ${lgeo}"
+    set libs "${lg2c} ${lgctpc}"
 }
-if {${fsymbol} == "-DGFORTRAN"} {
-    set libs "${libs} -L${prefix}/lib/gcc${my_ver_no_dot} -lgfortran"
-} elseif {${fsymbol} == "-DG95"} {
-    set libs "${libs} -lf95"
-}
-build.env           LDFLAGS=\"${libs} ${configure.ldflags} -lpng -ljasper -lnetcdf\" \
+build.env-append    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 {${fsymbol} != ""} {
-    build.args-append   USE_IPOLATES=1
-    build.env-append    FC=\"${configure.fc}\" \
-                        F90=\"${configure.fc}\" \
-                        FFLAGS=\"${configure.fflags}\"
-}
-if {${fsymbol} != "-DGFORTRAN"} {
-    build.args-append   USE_OPENMP=1
-}
+build.args-append   iip=\"${iip}\"
 
 destroot {
     xinstall -m 644 ${g2c}/grib2.h ${destroot}${prefix}/include

Added: trunk/dports/science/wgrib2/files/patch-g2clib-makefile.diff
===================================================================
--- trunk/dports/science/wgrib2/files/patch-g2clib-makefile.diff	                        (rev 0)
+++ trunk/dports/science/wgrib2/files/patch-g2clib-makefile.diff	2014-06-15 03:21:33 UTC (rev 121032)
@@ -0,0 +1,10 @@
+--- g2clib-1.4.0/makefile.orig	2012-09-04 21:27:30.000000000 +0900
++++ g2clib-1.4.0/makefile	2014-06-15 08:29:35.000000000 +0900
+@@ -86,6 +86,7 @@
+ #	$(LIB)(getgb2.o) \
+ #	$(LIB)(putgb2.o) \
+ #	$(LIB)(params.o)
++	ranlib ${LIB}
+ 
+ .c.a:
+ 	$(CC) -c $(CPPFLAGS) $(CFLAGS) ${DEFS} $<

Added: trunk/dports/science/wgrib2/files/patch-iplib-makefile.diff
===================================================================
--- trunk/dports/science/wgrib2/files/patch-iplib-makefile.diff	                        (rev 0)
+++ trunk/dports/science/wgrib2/files/patch-iplib-makefile.diff	2014-06-15 03:21:33 UTC (rev 121032)
@@ -0,0 +1,10 @@
+--- iplib.2012/makefile.orig	2012-02-25 04:57:49.000000000 +0900
++++ iplib.2012/makefile	2014-06-15 08:31:21.000000000 +0900
+@@ -32,6 +32,7 @@
+ 
+ $(LIB):	$(objs)
+ 	ar $(ARFLAGS) ${LIB} $(objs)
++	ranlib ${LIB}
+ 
+ .f.o:
+ 	$(FC) ${FFLAGS} -c $<

Modified: trunk/dports/science/wgrib2/files/patch-makefile.diff
===================================================================
--- trunk/dports/science/wgrib2/files/patch-makefile.diff	2014-06-15 03:15:05 UTC (rev 121031)
+++ trunk/dports/science/wgrib2/files/patch-makefile.diff	2014-06-15 03:21:33 UTC (rev 121032)
@@ -1,6 +1,6 @@
---- makefile.orig	2013-09-19 00:09:17.000000000 +0900
-+++ makefile	2013-11-17 12:32:27.000000000 +0900
-@@ -91,8 +91,8 @@
+--- makefile.orig	2014-06-07 03:37:11.000000000 +0900
++++ makefile	2014-06-15 11:28:40.000000000 +0900
+@@ -92,8 +92,8 @@
  #
  
  # Warning do not set both USE_NETCDF3 and USE_NETCDF4 to one
@@ -11,7 +11,7 @@
  USE_REGEX=1
  USE_TIGGE=1
  USE_MYSQL=0
-@@ -127,11 +127,11 @@
+@@ -132,11 +132,11 @@
    endif
  endif
  
@@ -28,7 +28,20 @@
  
  ifeq ($(USE_IPOLATES),1)
    ifeq ($(FC),)
-@@ -430,11 +430,11 @@
+@@ -226,9 +226,9 @@
+ # gctpc library
+ gctpc:=${cwd}/gctpc
+ gctpcsrc:=gctpc20a.tgz
+-gctpclib:=${lib}/libgeo.a
+-wLDFLAGS+=-lgeo
+-# wCPPFLAGS+=-I${gctpc}/source
++gctpclib:=${lib}/libgctpc.a
++wLDFLAGS+=-lgctpc
++wCPPFLAGS+=-I${prefix}/include/gctpc
+ 
+ # proj4 library
+ ifeq ($(USE_PROJ4),1)
+@@ -446,11 +446,11 @@
  w=wgrib2
  prog=$w/wgrib2
  
@@ -38,12 +51,12 @@
  
 -${prog}:        $w/*.c $w/*.h ${jlib} ${nlib} ${zlib} ${plib} ${h5lib} ${glib} ${n4lib} ${iplib} ${gctpclib} ${proj4lib}
 -	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}"
++${prog}:        $w/*.c $w/*.h ${glib} ${iplib}
++	cd "$w" && ${MAKE} CPPFLAGS="-I${g} ${iip} ${CPPFLAGS}"
  
  fast:        $w/*.c $w/*.h ${jlib} ${nlib} ${zlib} ${plib} ${h5lib} ${glib} ${n4lib} ${iplib} ${gctpclib} ${proj4lib}
  	cd "$w" && export LDFLAGS="${wLDFLAGS}" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} fast
-@@ -465,19 +465,21 @@
+@@ -481,10 +481,11 @@
  	cd "$z" && export CFLAGS="${wCPPFLAGS}" && ./configure --prefix=${cwd} && ${MAKE} check install
  
  
@@ -55,24 +68,21 @@
 +	ranlib ${glib}
  
  ${gctpclib}:
- 	cp ${gctpcsrc} tmpgctpc.tar.Z
- 	gunzip -n -f tmpgctpc.tar.Z
+ 	cp ${gctpcsrc} tmpgctpc.tar.gz
+@@ -492,7 +493,7 @@
  	tar -xvf tmpgctpc.tar
  	rm tmpgctpc.tar
--	cp makefile.gctpc proj.h cproj.c ${gctpc}/source/
+ 	cp makefile.gctpc proj.h ${gctpc}/source/
 -	cd "${gctpc}/source" && export CPPFLAGS="${wCPPFLAGS}" && ${MAKE} -f makefile.gctpc
-+	cp makefile.gctpc proj.h ${gctpc}/source/
 +	cd "${gctpc}/source" &&  ${MAKE} -f makefile.gctpc CPPFLAGS="-I${gctpc}/source ${CPPFLAGS}"
  	cp ${gctpc}/source/libgeo.a ${lib}
-+	ranlib ${gctpclib}
  	cp ${gctpc}/source/proj.h ${cwd}/include
  
- ${proj4lib}:
-@@ -516,7 +518,7 @@
+@@ -532,7 +533,7 @@
  	$(error ERROR, get hdf5 source by "wget http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8.11/src/hdf5-1.8.11.tar.gz" )
  
  ${iplib}:
--	cd "${ip}" && export FFLAGS="${wFFLAGS}" && ${MAKE} && cp libipolate.a ${lib}
+-	cd "${ip}" && export FFLAGS="${wFFLAGS}" && ${MAKE} && cp libipolate.a ${iplib}
 +	cd "${ip}" && ${MAKE} && cp libipolate.a ${lib}
  
  aux_progs/gmerge:	aux_progs/gmerge.c		

Deleted: trunk/dports/science/wgrib2/files/ranlib.patch
===================================================================
--- trunk/dports/science/wgrib2/files/ranlib.patch	2014-06-15 03:15:05 UTC (rev 121031)
+++ trunk/dports/science/wgrib2/files/ranlib.patch	2014-06-15 03:21:33 UTC (rev 121032)
@@ -1,33 +0,0 @@
-diff -Naurp grib2.orig/g2clib-1.4.0/makefile grib2/g2clib-1.4.0/makefile
---- g2clib-1.4.0/makefile	2012-09-04 05:27:30.000000000 -0700
-+++ g2clib-1.4.0/makefile	2013-11-17 22:57:54.000000000 -0800
-@@ -86,6 +86,7 @@ $(LIB):	$(LIB)(gridtemplates.o) \
- #	$(LIB)(getgb2.o) \
- #	$(LIB)(putgb2.o) \
- #	$(LIB)(params.o)
-+	ranlib ${LIB}
- 
- .c.a:
- 	$(CC) -c $(CPPFLAGS) $(CFLAGS) ${DEFS} $<
-diff -Naurp grib2.orig/iplib.2012/makefile grib2/iplib.2012/makefile
---- iplib.2012/makefile	2012-02-24 11:57:49.000000000 -0800
-+++ iplib.2012/makefile	2013-11-17 22:58:32.000000000 -0800
-@@ -32,6 +32,7 @@ gdswizcd.o  gdswzdcd.o
- 
- $(LIB):	$(objs)
- 	ar $(ARFLAGS) ${LIB} $(objs)
-+	ranlib ${LIB}
- 
- .f.o:
- 	$(FC) ${FFLAGS} -c $<
-diff -Naurp grib2.orig/makefile.gctpc grib2/makefile.gctpc
---- makefile.gctpc	2012-04-20 10:52:55.000000000 -0700
-+++ makefile.gctpc	2013-11-17 22:57:28.000000000 -0800
-@@ -23,6 +23,7 @@ objs=gctp.o alberfor.o alberinv.o alconf
- 
- $(LIB): $(objs)
- 	ar $(ARFLAGS) ${LIB} $(objs)
-+	ranlib ${LIB}
- 
- clean:
- 	touch junk.o
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140614/6c115eeb/attachment.html>


More information about the macports-changes mailing list