# -*- 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 PortGroup active_variants 1.1 PortGroup compilers 1.0 compilers.choose fc f77 f90 compilers.setup -clang -dragonegg -gfortran -llvm name ncarg version 6.3.0 revision 7 categories science platforms darwin maintainers takeshi openmaintainer license {UCAR-Unidata public-domain BSD LGPL-3 GPL-3} description language for scientific data processing and visualization long_description \ The NCAR Command Language (NCL), a product of \ the Computational & Information Systems Laboratory \ at the National Center for Atmospheric Research (NCAR) \ and sponsored by the National Science Foundation, \ is a free interpreted language designed specifically \ for scientific data processing and visualization. homepage http://www.ncl.ucar.edu/ distname ncl_${name}-${version} master_sites http://www.ncl.ucar.edu/Download/files/:g2clib \ "https://www.earthsystemgrid.org/download/fileDownload.htm?logicalFileId=bec58cb3-cd9b-11e4-bb80-00c0f03d5b7c&dummy=:ncl" set ncl_src ${distname}${extract.suffix} set g2clib_version 1.5.0 set g2clib_src g2clib-${g2clib_version}-patch${extract.suffix} set g2clib_worksrcdir g2clib-${g2clib_version}-patch distfiles ${ncl_src}:ncl \ ${g2clib_src}:g2clib checksums ${ncl_src} \ rmd160 99753e6319ef418ca60d6980fefc183c65a52e58 \ sha256 79a01d1c51537426a1a657bb78c8f32453d071c774ec21495800d90d3688b2f3\ ${g2clib_src} \ rmd160 221b308be9258ed3ec9ebe126d872aa451f879cf \ sha256 1852aa7404426e4d2fecbf75dee47bb1ffeb2ef06c63644c068bad9b9433bfff depends_lib path:lib/pkgconfig/cairo.pc:cairo \ port:proj \ port:gdal \ port:udunits2 \ port:vis5d \ port:hdfeos \ port:hdfeos5 \ port:wgrib2 \ port:curl \ port:libpng \ port:libxml2 \ port:xorg-libXaw depends_build port:hdf5-18 \ port:triangle \ port:flex depends_run bin:ESMF_RegridWeightGen:esmf \ port:rangs-gshhs-ncarg use_parallel_build no universal_variant no 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 } if {[variant_isset accelerate]} { patchfiles-append patch-config-Project-accelerate.diff \ patch-external-yMakefile.diff } else { patchfiles-append patch-config-Project.diff } pre-configure { if {[file exists ${prefix}/lib/hdf5-18/bin/h5pcc]} { configure.cc ${prefix}/lib/hdf5-18/bin/h5pcc } else { configure.cc ${prefix}/lib/hdf5-18/bin/h5cc } # 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 {[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|-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} reinplace "s|g++$|${configure.cxx}|" ${worksrcpath}/config/${f} reinplace "/CcOptions/d" ${worksrcpath}/config/${f} reinplace "/ArchRecLibSearch/d" ${worksrcpath}/config/${f} reinplace "/ArchRecIncSearch/d" ${worksrcpath}/config/${f} reinplace "s|-lXext$|-lXext\\ #define ArchRecLibSearch ${configure.ldflags} \\ #define ArchRecIncSearch ${configure.cppflags} \\ #define CcOptions -fPIC -D_DARWIN_C_SOURCE \\ #define COptimizeFlag ${configure.cflags}\\ #define FOptimizeFlag ${configure.fflags}\\ #define ManRoot ${destroot}${prefix}/share/man\\ #define NetCDFlib -lnetcdf\\ #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} } } if {[variant_isset g95]} { reinplace "s|-fno-range-check||" ${worksrcpath}/config/Darwin_Intel } # 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 y ${destroot}${prefix} y y y y y y y y y y y y y y ${worksrcpath} ${prefix}/lib/hdfeos5/lib ${prefix}/lib ${prefix}/include/freetype2 ${prefix}/include/udunits2 ${prefix}/lib/hdfeos5/include ${prefix}/include EOF" } post-configure { system -W ${worksrcpath} "make Info" system "cat ${worksrcpath}/config/Site.local" } build.target Build if {${os.major}<10} { if {[variant_isset g95]} { build.args-append EXTRA_CCOPTIONS=\"${configure.cc_archflags}\" } else { if {[string match *64* $build_arch]} { build.args-append EXTRA_CCOPTIONS=-m64 } else { build.args-append EXTRA_CCOPTIONS=-m32 } } } # The build script ignores the build errors. # Check if ncl is built here. post-build { if {![file exists ${worksrcpath}/ni/src/ncl/ncl]} { return -code error "ncl did not get built" } } if {![fortran_variant_isset]} { default_variants-append +gcc5 } if {[variant_isset g95]} { configure.fflags-append -fno-second-underscore } variant accelerate description {use Accelerate.framework} { depends_lib-append port:vecLibFort } livecheck.type regex livecheck.url ${homepage} livecheck.regex {Current Version:.* .*([0-9]+\.[0-9]+\.[0-9]+)}