[macports-ports] branch master updated: replace grib_api by eCcodes

Ryan Schmidt ryandesign at macports.org
Tue Nov 28 08:36:58 UTC 2017


On Nov 28, 2017, at 00:58, Takeshi Enomoto wrote:

> Takeshi Enomoto (tenomoto) pushed a commit to branch master
> in repository macports-ports.
> 
> 
> https://github.com/macports/macports-ports/commit/92b1bd3039c85f0df525339b0ce41c3ac603b541
> 
> The following commit(s) were added to refs/heads/master by this push:
> 
>      new 92b1bd3  replace grib_api by eCcodes
> 
> 92b1bd3 is described below
> 
> 
> commit 92b1bd3039c85f0df525339b0ce41c3ac603b541
> 
> Author: Takeshi Enomoto
> AuthorDate: Tue Nov 28 15:52:11 2017 +0900
> 
> 
>     replace grib_api by eCcodes
> 
>     
> 
>     ecCodes: add to MacPorts
> 
>     gnudatalanguage: update to 0.9.7. use gsshg-bin-*.zip
> 
>     py-pygrib: add support for python-3.6
> 
>     cdo: make +eccodes default
> 
>     libemos: update to 4.5.1. add patch to avoid conflict of bufr_filter with ecCodes
> 
>     magicspp: update to 2.34.3. use perl 5.26. add patch to stop adding -Wl,-framework to CAIRO_LIBRARIES
> 
>     metview: update to 4.9.1
> 
>     Closes: https://trac.macports.org/ticket/52233
> 
>     See: https://trac.macports.org/ticket/55138
> 
>     See: https://trac.macports.org/ticket/55208



> --- a/science/cdo/Portfile
> +++ b/science/cdo/Portfile

> +default_variants    +eccodes

Since +eccodes is an unconditional default variant...

> -if {[variant_isset magicspp]} {
> -    default_variants    +grib_api
> +variant grib2 description {obsoleted by grib_api variant} {
> +    default_variants    +eccodes
>  }
>  
> -variant grib2 description {obsoleted by grib_api variant} {
> -    default_variants +grib_api
> +variant grib_api description {obsoleted by eccodes variant} {
> +    default_variants    +eccodes
>  }

...there is no point to keeping the grib2 and grib_api variants.


> --- a/science/grib_api/Portfile
> +++ b/science/ecCodes/Portfile
> @@ -4,24 +4,24 @@ PortSystem          1.0
>  PortGroup cmake     1.0
>  PortGroup compilers 1.0
>  
> -name                grib_api
> -version             1.19.0
> -revision            2
> +name                ecCodes
> +version             2.5.0
>  platforms           darwin
>  maintainers         takeshi
>  license             Apache-2
>  categories          science
> -description         GRIB decoder
> -homepage            https://software.ecmwf.int/wiki/display/GRIB/Home
> -master_sites        https://software.ecmwf.int/wiki/download/attachments/3473437
> +description         API and tools for decoding and encoding GRIB, BUFR and GTS formats
> +homepage            https://software.ecmwf.int/wiki/display/ECC
> +master_sites        https://software.ecmwf.int/wiki/download/attachments/45757960
>  distname            ${name}-${version}-Source

ecCodes fails to build:

CMake Error: The source directory "/opt/local/var/macports/build/_opt_bblocal_var_buildworker_ports_build_ports_science_ecCodes/ecCodes/work/ecCodes-2.5.0-Source" does not exist.

The server apparently lets you request the file case insensitively, but when you extract it, the directory name has a particular case. I fixed this:

https://github.com/macports/macports-ports/commit/bf6556d4d056300280f1f1e04d141b9993408518


>  long_description \

> +    ecCodes is a package developed by ECMWF which provides an application programming interface and \
> +    a set of tools for decoding and encoding messages in the following formats: \
> +        * WMO FM-92 GRIB edition 1 and edition 2 \
> +        * WMO FM-94 BUFR edition 3 and edition 4 \
> +        * WMO GTS abbreviated header (only decoding).

If you want that to actually appear as a bulleted list when the user runs "port info", instead of all run together as a single paragraph, insert newline characters (\n) where needed. See the mongo-tools port for an example.


> +# Delete the following line. See #52233
> +# include( "/opt/local/bin/python2.7-config" OPTIONAL )
> +post-configure {
> +    if {[variant_isset python27]} {
> +        reinplace {2d} ${workpath}/build/eccodes-config.cmake.tpls
> +    }
> +}

This is very fragile. If the upstream source changes and line 2 of that file is now something different, you inadvertently delete the wrong line from the file. Please use a patchfile, or, if the file was generated by the configure process, then consider using an ed script instead; there are many examples of ed scripts in other ports.


>  post-destroot {
>      xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
>      xinstall -m 644 {*}[glob ${worksrcpath}/html/*.html] \
>          ${destroot}${prefix}/share/doc/${name}
> 
> +    if {[variant_isset python27]} {
> +        set sp ${destroot}${frameworks_dir}/Python.framework/Versions/2.7/lib/python2.7/site-packages
> +        xinstall -m 755 -d ${sp}
> +        foreach p {gribapi eccodes} {
> +            xinstall -m 755 -d ${sp}/${p}
> +            xinstall -m 644 {*}[glob ${workpath}/build/python/${p}/*.py] ${sp}/${p}
> +        }
> +        xinstall -m 755 {*}[glob ${workpath}/build/python/gribapi/*.so] ${sp}/gribapi
> +    }

Instead of assuming the build directory is "${workpath}/build" (it's set that way by the cmake portgroup but you don't know if or when that will change), you should use "${build.dir}".


> --- a/science/grib_api/Portfile
> +++ b/science/grib_api/Portfile

> +# This port can be removed on 24 November, 2018.
> +replaced_by         ecCodes
> +PortGroup           obsolete 1.0
>  
>  name                grib_api
>  version             1.19.0
>  revision            2

For grib_api to actually be replaced_by ecCodes, you must increase the revision of grib_api.


> --- a/science/magicspp/Portfile
> +++ b/science/magicspp/Portfile

> +    file delete -force ${worksrcpath}/src/boost

Instead of "file delete -force", you can more simply write just "delete" which does exactly the same thing.





More information about the macports-dev mailing list