[148018] trunk/dports/science/ncarg
takeshi at macports.org
takeshi at macports.org
Sun Apr 24 13:56:33 PDT 2016
Revision: 148018
https://trac.macports.org/changeset/148018
Author: takeshi at macports.org
Date: 2016-04-24 13:56:32 -0700 (Sun, 24 Apr 2016)
Log Message:
-----------
ncarg: add patches to remove reinplace's. depends on hdf5-18 at build, closing #50782
Modified Paths:
--------------
trunk/dports/science/ncarg/Portfile
Added Paths:
-----------
trunk/dports/science/ncarg/files/patch-Configure.diff
trunk/dports/science/ncarg/files/patch-config-Project-accelerate.diff
trunk/dports/science/ncarg/files/patch-config-Project.diff
trunk/dports/science/ncarg/files/patch-external-yMakefile.diff
trunk/dports/science/ncarg/files/patch-ncarg2d-src-libncarg-Iftran-yMakefile.diff
trunk/dports/science/ncarg/files/patch-ncarview-src-bin-ictrans-yMakefile.diff
Modified: trunk/dports/science/ncarg/Portfile
===================================================================
--- trunk/dports/science/ncarg/Portfile 2016-04-24 20:47:46 UTC (rev 148017)
+++ trunk/dports/science/ncarg/Portfile 2016-04-24 20:56:32 UTC (rev 148018)
@@ -3,15 +3,14 @@
PortSystem 1.0
PortGroup active_variants 1.1
-PortGroup mpi 1.0
+PortGroup compilers 1.0
-compilers.choose fc f77 f90 cc
+compilers.choose fc f77 f90
compilers.setup -clang -dragonegg -gfortran -llvm
-mpi.setup
name ncarg
version 6.3.0
-revision 5
+revision 6
categories science
platforms darwin
maintainers takeshi openmaintainer
@@ -53,7 +52,6 @@
port:gdal \
port:udunits2 \
port:vis5d \
- port:hdf5 \
port:hdfeos \
port:hdfeos5 \
port:wgrib2 \
@@ -61,7 +59,8 @@
port:libpng \
port:libxml2 \
port:xorg-libXaw
-depends_build port:triangle \
+depends_build port:hdf5-18 \
+ port:triangle \
port:flex
depends_run bin:ESMF_RegridWeightGen:esmf \
port:rangs-gshhs-ncarg
@@ -69,34 +68,49 @@
use_parallel_build no
universal_variant no
-mpi.enforce_variant hdf5
-
set usedap y
+patchfiles patch-Configure.diff \
+ patch-ncarg2d-src-libncarg-Iftran-yMakefile.diff \
+ patch-ncarview-src-bin-ictrans-yMakefile.diff
if {$build_arch eq "x86_64"} {
- patchfiles-append patch-config-ymake.diff
+ patchfiles-append patch-config-ymake.diff
}
+if {[variant_isset accelerate]} {
+ patchfiles-append patch-config-Project-accelerate.diff \
+ patch-external-yMakefile.diff
+} else {
+ patchfiles-append patch-config-Project.diff
+}
-configure.cflags-append -DH5_USE_18_API
-
-post-patch {
- reinplace "s|hdf/||" ${worksrcpath}/ni/src/ncl/FileSupport.c
- reinplace "s| -lsz||g" ${worksrcpath}/Configure
- reinplace "s| -lsz||g" ${worksrcpath}/config/Project
- reinplace "s|g\\\\+\\\\+|${configure.cc}|" ${worksrcpath}/ni/src/ncl/yMakefile
+pre-configure {
+ if {[file exists ${prefix}/bin/h5pcc-18]} {
+ configure.cc ${prefix}/bin/h5pcc-18
+ } else {
+ configure.cc ${prefix}/bin/h5cc-18
+ }
+ # build modified g2clib
reinplace "s|CC=cc|CC=${configure.cc}|" ${workpath}/${g2clib_worksrcdir}/makefile
reinplace "s|INC=-I/usr/local/include|INC=${configure.cppflags} ${configure.cflags}|" ${workpath}/${g2clib_worksrcdir}/makefile
reinplace "s|CC=gcc -fPIC|CC=${configure.cc}|" ${workpath}/${g2clib_worksrcdir}/makefile
if {$build_arch eq "x86_64" || $build_arch eq "ppc64"} {
reinplace "s|-DUSE_PNG$|-DUSE_PNG -D__64BIT__|" ${workpath}/${g2clib_worksrcdir}/makefile
}
+ system -W ${workpath}/${g2clib_worksrcdir} "make all"
+ file copy ${workpath}/${g2clib_worksrcdir}/libgrib2c.a ${worksrcpath}
+
+ # edit configurations
+ reinplace "s|g\\\\+\\\\+|${configure.cc}|" ${worksrcpath}/ni/src/ncl/yMakefile
foreach f {Darwin Darwin_Intel} {
- if {[variant_isset g95]} {
- reinplace "s|-lgfortran|-lf95|" ${worksrcpath}/config/${f}
+ if {[regexp clang ${configure.compiler}]} {
reinplace "s|-fopenmp||" ${worksrcpath}/config/${f}
reinplace "s| -lquadmath||" ${worksrcpath}/config/${f}
+ }
+ set fvar [fortran_variant_name]
+ if {[variant_isset g95]} {
+ reinplace "s|-lgfortran|-L${prefix}/lib/${fvar} -lf95|" ${worksrcpath}/config/${f}
} else {
- reinplace "s|-lgfortran|-lgfortran -lgomp|" ${worksrcpath}/config/${f}
+ reinplace "s|-lgfortran|-L${prefix}/lib/${fvar} -lgfortran -lgomp|" ${worksrcpath}/config/${f}
}
reinplace "s| gfortran$| ${configure.fc}|" ${worksrcpath}/config/${f}
reinplace "s|gcc$|${configure.cc}|" ${worksrcpath}/config/${f}
@@ -112,7 +126,7 @@
#define FOptimizeFlag ${configure.fflags}\\
#define ManRoot ${destroot}${prefix}/share/man\\
#define NetCDFlib -lnetcdf\\
-#define HDFEOS5lib -lhe5_hdfeos -lGctp -lhdf5|" ${worksrcpath}/config/${f}
+#define HDFEOS5lib -lhe5_hdfeos -lGctp|" ${worksrcpath}/config/${f}
# A workaround for XQuartz 2.7.3 on Mountain Lion known as ncl.xq.fix
if {${os.version}>=12} {
reinplace "s|-D__UNIXOS2__|-D__UNIXOS2__ -D__JIRA1530__|" ${worksrcpath}/config/${f}
@@ -121,45 +135,20 @@
if {[variant_isset g95]} {
reinplace "s|-fno-range-check||" ${worksrcpath}/config/Darwin_Intel
}
- foreach f {ni/src/ncl/NclHDF.c \
- ni/src/ncl/NclHDFEOS.c \
- ni/src/ncl/NclHDFEOS5.c \
- ncarview/src/lib/libncarg_ras/hdf.c} {
- reinplace "s|hdf\/||" ${worksrcpath}/${f}
- }
- reinplace "s|\$\(NCARGGKSCAIROLIB\) \$\(NCARGCLIB\)|\$(NCARGGKSCAIROLIB) \$(NCARGGKSLIB) \$(NCARGCLIB)|" ${worksrcpath}/config/Project
- foreach exlib {sphere3.1_dp fftpack5_dp} {
- reinplace "s|-l${exlib}|\$(EXTERNALSRC)/${exlib}/lib${exlib}.a|g" ${worksrcpath}/config/Project
- }
- if {[variant_isset accelerate]} {
- reinplace "s|-llapack_ncl|-framework Accelerate|g" ${worksrcpath}/config/Project
- reinplace "s|-lblas_ncl|-lvecLibFort|g" ${worksrcpath}/config/Project
- foreach f {Darwin Darwin_Intel} {
- reinplace "/LAPACKLIB/d" ${worksrcpath}/config/${f}
- reinplace "/BLASLIB/d" ${worksrcpath}/config/${f}
- }
- reinplace "s|-L\$(LAPACKSRC)||" ${worksrcpath}/config/Project
- reinplace "s|-L\$(BLASSRC)||" ${worksrcpath}/config/Project
- reinplace "s|blas lapack ||" ${worksrcpath}/external/yMakefile
- } else {
- foreach exlib {lapack blas} {
- reinplace "s|-l${exlib}_ncl|\$(EXTERNALSRC)/${exlib}/lib${exlib}_ncl.a|g" ${worksrcpath}/config/Project
- }
- }
-}
-pre-configure {
- system -W ${workpath}/${g2clib_worksrcdir} "make all"
- file copy ${workpath}/${g2clib_worksrcdir}/libgrib2c.a ${worksrcpath}
+ # run ymake
system -W ${worksrcpath}/config \
"CC=${configure.cc} \
CFLAGS=${configure.cflags} \
make -f Makefile.ini; \
./ymake -config `pwd`"
+
+ # copy triangle.[ch]
foreach ext "c h" {
file copy ${prefix}/share/triangle/triangle.${ext} ${worksrcpath}/ni/src/lib/hlu
}
}
+
configure {
system -W ${worksrcpath} "./Configure -v << EOF
@@ -181,15 +170,13 @@
y
y
y
-${worksrcpath} ${prefix}/lib ${prefix}/lib/hdfeos5/lib ${prefix}/lib
+${worksrcpath} ${prefix}/lib/hdfeos5/lib ${prefix}/lib
${prefix}/include/freetype2 ${prefix}/include/udunits2 ${prefix}/lib/hdfeos5/include ${prefix}/include
EOF"
}
post-configure {
-# reinplace "s| -lsz||g" ${worksrcpath}/makefile
-# reinplace "s| -lsz||g" ${worksrcpath}/config/Site.local
system -W ${worksrcpath} "make Info"
system "cat ${worksrcpath}/config/Site.local"
}
Added: trunk/dports/science/ncarg/files/patch-Configure.diff
===================================================================
--- trunk/dports/science/ncarg/files/patch-Configure.diff (rev 0)
+++ trunk/dports/science/ncarg/files/patch-Configure.diff 2016-04-24 20:56:32 UTC (rev 148018)
@@ -0,0 +1,11 @@
+--- Configure.orig 2015-03-17 06:22:17.000000000 +0900
++++ Configure 2016-04-18 04:58:36.000000000 +0900
+@@ -550,7 +550,7 @@
+ if ("$answer" == "q") goto cleanup
+ if (("$answer" != "") && ("$answer" != "$hdfwithszip")) then
+ set hdfwithszip = "$answer"
+- set hdflib = "-lmfhdf -ldf -ljpeg -lz -lsz"
++ set hdflib = "-lmfhdf -ldf"
+ endif
+ endif
+
Added: trunk/dports/science/ncarg/files/patch-config-Project-accelerate.diff
===================================================================
--- trunk/dports/science/ncarg/files/patch-config-Project-accelerate.diff (rev 0)
+++ trunk/dports/science/ncarg/files/patch-config-Project-accelerate.diff 2016-04-24 20:56:32 UTC (rev 148018)
@@ -0,0 +1,60 @@
+--- config/Project.orig 2015-03-17 06:21:42.000000000 +0900
++++ config/Project 2016-04-18 23:07:57.000000000 +0900
+@@ -272,7 +272,7 @@
+
+ #ifdef BuildHDF5
+ #ifndef HDF5lib
+-#define HDF5lib -lhdf5_hl -lhdf5 -lsz -lz
++#define HDF5lib -lhdf5_hl
+ #endif /* HDF5lib */
+ #else
+ #define HDF5lib
+@@ -305,7 +305,7 @@
+ #endif /* NetCDFlib */
+
+ #ifndef NetCDF4lib
+-#define NetCDF4lib -lhdf5_hl -lhdf5 -lsz
++#define NetCDF4lib -lhdf5_hl
+ #endif /* NetCDF4lib */
+
+ #ifndef UdUnitslib
+@@ -522,8 +522,6 @@
+ ICTRANSLIBSRC = $(NVIEWLIBSRC)/libictrans
+ NCARGRASLIBSRC = $(NVIEWLIBSRC)/libncarg_ras
+ HLULIBSRC = $(NILIBSRC)/hlu
+-BLASSRC = $(EXTERNALSRC)/blas
+-LAPACKSRC = $(EXTERNALSRC)/lapack
+ SPHERESRC = $(EXTERNALSRC)/sphere3.1_dp
+ FFTPACK5SRC = $(EXTERNALSRC)/fftpack5_dp
+ NGOLIBSRC = $(NILIBSRC)/ngo
+@@ -549,10 +547,11 @@
+ NIOLIB = -lnio
+ NCLLIB =
+ NCLAPILIB = -lNGncl
+-BLASLIB = -lblas_ncl
+-LAPACKLIB = -llapack_ncl
+-SPHERELIB = -lsphere3.1_dp
+-FFTPACK5LIB = -lfftpack5_dp
++BLASLIB = -lvecLibFort
++LAPACKLIB = -lvecLibFort
++SPHERELIB = $(SPHERESRC)/libsphere3.1_dp.a
++FFTPACK5LIB = $(FFTPACK5SRC)/libfftpack5_dp.a
++
+
+ CTRANSLIB = -lNGctrans
+ ICTRANS_LIB = -lNGictrans
+@@ -594,10 +593,10 @@
+ XCBLIB = _UseLib(-L$(XCBLIBSRC),-lXcb)
+ NCLLIB = _UseLib(-L$(NCLLIBSRC),-lncl)
+ NCLAPILIB = _UseLib(-L$(NCLLIBSRC),-lnclapi)
+-BLASLIB = _UseLib(-L$(BLASSRC),-lblas_ncl)
+-LAPACKLIB = _UseLib(-L$(LAPACKSRC),-llapack_ncl)
+-SPHERELIB = _UseLib(-L$(SPHERESRC),-lsphere3.1_dp)
+-FFTPACK5LIB = _UseLib(-L$(FFTPACK5SRC),-lfftpack5_dp)
++BLASLIB = -lvecLibFort
++LAPACKLIB = -lvecLibFort
++SPHERELIB = $(SPHERESRC)/libsphere3.1_dp.a
++FFTPACK5LIB = $(FFTPACK5SRC)/libfftpack5_dp.a
+
+ CTRANSLIB = _DepLib($(CTRANSLIBSRC),$(ROBJROOT),libctrans.o)
+ ICTRANS_LIB = _DepLib($(ICTRANSLIBSRC),$(ROBJROOT),libictrans_.o)
Added: trunk/dports/science/ncarg/files/patch-config-Project.diff
===================================================================
--- trunk/dports/science/ncarg/files/patch-config-Project.diff (rev 0)
+++ trunk/dports/science/ncarg/files/patch-config-Project.diff 2016-04-24 20:56:32 UTC (rev 148018)
@@ -0,0 +1,51 @@
+--- config/Project.orig 2015-03-17 06:21:42.000000000 +0900
++++ config/Project 2016-04-18 23:07:17.000000000 +0900
+@@ -272,7 +272,7 @@
+
+ #ifdef BuildHDF5
+ #ifndef HDF5lib
+-#define HDF5lib -lhdf5_hl -lhdf5 -lsz -lz
++#define HDF5lib -lhdf5_hl
+ #endif /* HDF5lib */
+ #else
+ #define HDF5lib
+@@ -305,7 +305,7 @@
+ #endif /* NetCDFlib */
+
+ #ifndef NetCDF4lib
+-#define NetCDF4lib -lhdf5_hl -lhdf5 -lsz
++#define NetCDF4lib -lhdf5_hl
+ #endif /* NetCDF4lib */
+
+ #ifndef UdUnitslib
+@@ -549,10 +549,11 @@
+ NIOLIB = -lnio
+ NCLLIB =
+ NCLAPILIB = -lNGncl
+-BLASLIB = -lblas_ncl
+-LAPACKLIB = -llapack_ncl
+-SPHERELIB = -lsphere3.1_dp
+-FFTPACK5LIB = -lfftpack5_dp
++BLASLIB = $(BLASSRC)/libblas_ncl.a
++LAPACKLIB = $(LAPACKSRC)/liblapack_ncl.a
++SPHERELIB = $(SPHERESRC)/libsphere3.1_dp.a
++FFTPACK5LIB = $(FFTPACK5SRC)/libfftpack5_dp.a
++
+
+ CTRANSLIB = -lNGctrans
+ ICTRANS_LIB = -lNGictrans
+@@ -594,10 +595,10 @@
+ XCBLIB = _UseLib(-L$(XCBLIBSRC),-lXcb)
+ NCLLIB = _UseLib(-L$(NCLLIBSRC),-lncl)
+ NCLAPILIB = _UseLib(-L$(NCLLIBSRC),-lnclapi)
+-BLASLIB = _UseLib(-L$(BLASSRC),-lblas_ncl)
+-LAPACKLIB = _UseLib(-L$(LAPACKSRC),-llapack_ncl)
+-SPHERELIB = _UseLib(-L$(SPHERESRC),-lsphere3.1_dp)
+-FFTPACK5LIB = _UseLib(-L$(FFTPACK5SRC),-lfftpack5_dp)
++BLASLIB = $(BLASSRC)/libblas_ncl.a
++LAPACKLIB = $(LAPACKSRC)/liblapack_ncl.a
++SPHERELIB = $(SPHERESRC)/libsphere3.1_dp.a
++FFTPACK5LIB = $(FFTPACK5SRC)/libfftpack5_dp.a
+
+ CTRANSLIB = _DepLib($(CTRANSLIBSRC),$(ROBJROOT),libctrans.o)
+ ICTRANS_LIB = _DepLib($(ICTRANSLIBSRC),$(ROBJROOT),libictrans_.o)
Added: trunk/dports/science/ncarg/files/patch-external-yMakefile.diff
===================================================================
--- trunk/dports/science/ncarg/files/patch-external-yMakefile.diff (rev 0)
+++ trunk/dports/science/ncarg/files/patch-external-yMakefile.diff 2016-04-24 20:56:32 UTC (rev 148018)
@@ -0,0 +1,11 @@
+--- external/yMakefile.orig 2015-03-17 06:21:34.000000000 +0900
++++ external/yMakefile 2016-04-18 04:49:37.000000000 +0900
+@@ -18,7 +18,7 @@
+ # Date: Fri Jan 16 21:11:00 MST 2004
+ #
+ # Description: yMakefile for external libraries and software
+-SUBDIRS = blas lapack sphere3.1_dp fftpack5_dp
++SUBDIRS = sphere3.1_dp fftpack5_dp
+ #define IHaveSubdirs
+
+
Added: trunk/dports/science/ncarg/files/patch-ncarg2d-src-libncarg-Iftran-yMakefile.diff
===================================================================
--- trunk/dports/science/ncarg/files/patch-ncarg2d-src-libncarg-Iftran-yMakefile.diff (rev 0)
+++ trunk/dports/science/ncarg/files/patch-ncarg2d-src-libncarg-Iftran-yMakefile.diff 2016-04-24 20:56:32 UTC (rev 148018)
@@ -0,0 +1,21 @@
+--- ncarg2d/src/libncarg/Iftran/yMakefile.orig 2015-03-17 06:20:38.000000000 +0900
++++ ncarg2d/src/libncarg/Iftran/yMakefile 2016-04-16 21:51:11.000000000 +0900
+@@ -4,18 +4,10 @@
+
+ MYNAME = Iftran
+
+-#if defined(Darwin)
+-PROG_LIBS = $(NCARGCLIB) $(CTOFLIBS)
+-#else
+ PROG_LIBS = $(NCARGCLIB)
+-#endif
+
+ DEPLIBS = $(DEPNCARGCLIB)
+
+-#if defined(Darwin)
+-PROG_LIBS = $(NCARGCLIB) $(CTOFLIBS)
+-#endif
+-
+ all-local:: Iftran
+ all-local:: Fsplit
+
Added: trunk/dports/science/ncarg/files/patch-ncarview-src-bin-ictrans-yMakefile.diff
===================================================================
--- trunk/dports/science/ncarg/files/patch-ncarview-src-bin-ictrans-yMakefile.diff (rev 0)
+++ trunk/dports/science/ncarg/files/patch-ncarview-src-bin-ictrans-yMakefile.diff 2016-04-24 20:56:32 UTC (rev 148018)
@@ -0,0 +1,11 @@
+--- ncarview/src/bin/ictrans/yMakefile.orig 2015-03-17 06:22:17.000000000 +0900
++++ ncarview/src/bin/ictrans/yMakefile 2016-04-17 17:47:43.000000000 +0900
+@@ -31,7 +31,7 @@
+ MORE_LIBS = -lmalloc
+ #endif
+
+-EXTRA_LIBS = $(X11LIBS) $(SUNLIBS) $(NETCDFLIB) $(HDFLIB) $(CTOFLIBS)
++EXTRA_LIBS = $(X11LIBS) $(SUNLIBS) $(NETCDFLIB) $(HDFLIB)
+ SYS_LIBS = $(MORE_LIBS)
+
+ SRCS = main.c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160424/04f1c0f6/attachment.html>
More information about the macports-changes
mailing list