[112223] trunk/dports/science/cdf/Portfile
ryandesign at macports.org
ryandesign at macports.org
Tue Oct 15 12:26:10 PDT 2013
Revision: 112223
https://trac.macports.org/changeset/112223
Author: ryandesign at macports.org
Date: 2013-10-15 12:26:10 -0700 (Tue, 15 Oct 2013)
Log Message:
-----------
cdf: Update to 3.5.0.1 and remove enormous patch which was laborious to update with each new version of cdf and just served to make the four different Mac envs more similar to one another and to remove Mac-specific flags not needed when compiling with FSF GCC. Instead, now use the generic Mac env ("gnu") which doesn't have most of those flags to begin with, and specify our flags with build.args. Make +gcc48 the default per current MacPorts guidelines. Allow build to work without any gcc variant (but without Fortran support).
Modified Paths:
--------------
trunk/dports/science/cdf/Portfile
Modified: trunk/dports/science/cdf/Portfile
===================================================================
--- trunk/dports/science/cdf/Portfile 2013-10-15 19:13:20 UTC (rev 112222)
+++ trunk/dports/science/cdf/Portfile 2013-10-15 19:26:10 UTC (rev 112223)
@@ -5,8 +5,7 @@
name cdf
epoch 1
-version 3.4.1
-revision 2
+version 3.5.0.1
set my_branch [join [lrange [split ${version} .] 0 1] ""]
set my_version ${my_branch}_[join [lrange [split ${version} .] 2 end] "_"]
set my_short_version ${my_branch}_[lindex [split ${version} .] 2]
@@ -23,56 +22,75 @@
discipline independent fashion.
homepage http://cdf.gsfc.nasa.gov/
-master_sites http://cdaweb.gsfc.nasa.gov/pub/software/cdf/dist/${name}${my_version}/unix/
+master_sites http://cdaweb.gsfc.nasa.gov/pub/software/cdf/dist/${name}${my_short_version}/unix/
-# 3.4.1 was stealth-updated 2012-06-28 (#35017), 2012-07-02 (#35216)
-dist_subdir ${name}/${version}_2
+# The 3.5.0.1 distfile is named to look like 3.5.0; not sure if this is going to be a trend.
+dist_subdir ${name}/${version}_0
fetch.use_epsv no
-distname ${name}${my_version}-dist
-worksrcdir ${name}${my_short_version}-dist
+distname ${name}${my_short_version}-dist
extract.suffix -all${extract.suffix}
-checksums rmd160 abae16c2f60df98754345f1bdda6c8b59aff84d9 \
- sha256 6bbbb63ca7f5a44e890cd01f51ace818a1f956cfe95bbbcc572b138181ac7cee
+checksums rmd160 8722b0aaca47ba82026439ab81ac35f0bf237d58 \
+ sha256 68c871c07fe56405e3ec9720d446b5902f21a1901a288249039c7935b2a12c16
depends_lib port:ncurses
post-patch {
- reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Makefile
- reinplace "s|-lgcc|`${configure.cc} -print-libgcc-file-name`|g" ${worksrcpath}/Makefile
reinplace "s|\\\$(INSTALLDIR)/bin/definitions\\.\\(\[BCK\]\\)|${prefix}/bin/definitions.\\1|" ${worksrcpath}/Makefile
}
use_configure no
-use_parallel_build no
+pre-build {
+ set cdf_os macosx
+ #set cdf_env ${configure.build_arch}
+ set cdf_env gnu
-build.args FORTRAN=yes
+ if {[string match *gcc* ${configure.compiler}]} {
+ set libgcc [exec ${configure.cc} -print-libgcc-file-name]
+ } else {
+ set libgcc ""
+ }
-platform darwin {
- patchfiles-append patch-Makefile
- build.args-append OS=macosx
-}
+ build.args-append ENV=${cdf_env} \
+ OS=${cdf_os} \
+ COPTIONSld_${cdf_os}_${cdf_env}= \
+ CURSESLIB_${cdf_os}_${cdf_env}=${prefix}/lib/libncurses.dylib \
+ LDOPTIONS_${cdf_os}_${cdf_env}="-dynamiclib -install_name ${prefix}/lib/libcdf.dylib" \
+ MACOSxFopt= \
+ MACOSxlink="-lc -lm ${libgcc}" \
+ MACOSxmin=
-if {[info exists build_arch]} {
- build.args-append ENV=${configure.build_arch}
-}
+ if {${os.endian} eq "little"} {
+ set endian_flag i386
+ } else {
+ set endian_flag __ppc__
+ }
-pre-build {
- build.args-append CC=${configure.cc} FC=${configure.fc}
+ # When upgrading, verify COPTIONS still approximately reflects what’s in the Makefile.
+ # Using ${configure.cc_archflags} in LD because ${configure.ld_archflags} doesn’t use -m32 / -m64 flags when they’re needed.
+ build.args-append COPTIONS_${cdf_os}_${cdf_env}="-D${endian_flag} -D__APPLE__ -D__MACH__ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE ${configure.optflags}" \
+ CC="${configure.cc} ${configure.cc_archflags}" \
+ LD="${configure.cc} ${configure.cc_archflags}"
+
+ if {${configure.fc} eq ""} {
+ build.args-append \
+ FORTRAN=no
+ } else {
+ build.args-append \
+ FC="${configure.fc} ${configure.fc_archflags}" \
+ FORTRAN=yes
+ }
}
+use_parallel_build no
+
destroot.destdir INSTALLDIR=${destroot}${prefix}
post-destroot {
- reinplace "s|${destroot}${prefix}|${prefix}|" \
- ${destroot}${prefix}/bin/definitions.B \
- ${destroot}${prefix}/bin/definitions.C \
- ${destroot}${prefix}/bin/definitions.K
+ eval reinplace "s|${destroot}||g" [glob ${destroot}${prefix}/bin/definitions.*]
- system "install_name_tool -id ${prefix}/lib/libcdf.dylib ${destroot}${prefix}/lib/libcdf.dylib"
-
set docdir ${destroot}${prefix}/share/doc/${name}
xinstall -d ${docdir}
xinstall -W ${worksrcpath} CDF_copyright.txt CHANGES.txt \
@@ -101,7 +119,7 @@
}
if {![variant_isset gcc44] && ![variant_isset gcc45] && ![variant_isset gcc46] && ![variant_isset gcc47] && ![variant_isset gcc48]} {
- default_variants +gcc47
+ default_variants +gcc48
}
livecheck.type regex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20131015/66a7391c/attachment.html>
More information about the macports-changes
mailing list