Ticket #41203: Portfile-gmt5.diff

File Portfile-gmt5.diff, 7.6 KB (added by florian@…, 10 years ago)

Portfile patch for gmt5 (apply last)

  • Portfile

    old new  
    22# $Id: Portfile 92837 2012-05-09 00:51:48Z ryandesign@macports.org $
    33
    44PortSystem          1.0
     5PortGroup           cmake 1.0
    56
    67name                gmt5
    7 version             5.0.0b
    8 revision            2
     8version             5.1.0
    99categories          science
    1010platforms           darwin
    11 maintainers         eprofs.de:florian takeshi
    12 license             LGPL-3
    13 description         the generic mapping tools
    14 long_description GMT is an open source collection of ~65 tools  \
     11maintainers         eprofs.de:florian \
     12                    takeshi
     13license             GPL-3
     14description         The Generic Mapping Tools
     15long_description GMT is an open source collection of ~120 tools \
    1516    for manipulating geographic and Cartesian data sets and     \
    16     producing Encapsulated PostScript File (EPS) illustrations  \
    17     ranging from simple x-y plots via contour maps to           \
    18     artificially illuminated surfaces and 3-D perspective views.
     17    producing PostScript illustrations ranging from simple x-y  \
     18    plots via contour maps to artificially illuminated surfaces \
     19    and 3D perspective views.
     20
    1921conflicts           gmt
    20 homepage            http://www.soest.hawaii.edu/gmt5
    21 master_sites        ftp://ftp.soest.hawaii.edu/gmt5          \
    22                     ftp://ibis.grdl.noaa.gov/pub/gmt5        \
    23                     ftp://ftp.iris.washington.edu/pub/gmt5   \
    24                     ftp://ftp.iag.usp.br/pub/gmt5            \
    25                     ftp://ftp.geologi.uio.no/pub/gmt5        \
    26                     ftp://gd.tuwien.ac.at/pub/gmt5           \
    27                     ftp://ftp.scc.u-tokai.ac.jp/pub/gmt5     \
    28                     ftp://mirror.geosci.usyd.edu.au/pub/gmt5 \
    29                     ftp://gmt.mirror.ac.za/pub/gmt5
     22homepage            http://gmt.soest.hawaii.edu/
     23master_sites        ftp://ftp.soest.hawaii.edu/gmt          \
     24                    ftp://ibis.grdl.noaa.gov/pub/gmt        \
     25                    ftp://ftp.iris.washington.edu/pub/gmt   \
     26                    ftp://ftp.iag.usp.br/pub/gmt            \
     27                    ftp://ftp.geologi.uio.no/pub/gmt        \
     28                    ftp://gd.tuwien.ac.at/pub/gmt           \
     29                    ftp://ftp.scc.u-tokai.ac.jp/pub/gmt     \
     30                    ftp://gmt.mirror.ac.za/pub/gmt
    3031use_bzip2           yes
    31 set gshhsversion    2.2.0
    32 set gmtsrc          gmt-${version}.tar.bz2
    33 set gshhs           gshhs-${gshhsversion}.tar.bz2
    34 distfiles           ${gmtsrc} ${gshhs}
    35 checksums           ${gmtsrc} \
    36                     md5     c5b78de5edab4c42a8a08e7fcfa976b4 \
    37                     sha1    73b16b25e59fa1cd74bfc01bdeb8170924cbda0c \
    38                     rmd160  175a752b6a4027454a1163f638f2deb0abf62082 \
    39                     ${gshhs} \
    40                     md5     db98bff37adc0d51fdf0ffa3834d45ad \
    41                     sha1    786d58b9a335d3bacb37f40f21ee3bfbb424cd10 \
    42                     rmd160  aa744b2fdcdf849cc5c4abce97f1d29f4cdc20a4
     32distname            gmt-${version}
     33distfiles           ${distname}-src${extract.suffix}
     34checksums           md5     da741319c883a3dbaf27ec7eaf66c166 \
     35                    sha1    3a68ac1ea273070822cc7f993a57983ec3da9b7f \
     36                    rmd160  8c00d9eda5e0f9f2723caad0887df0b9e88a1f26
     37
     38depends_lib         port:dcw-gmt \
     39                    port:gshhg-gmt-nc4 \
     40                    port:netcdf \
    4341
    44 worksrcdir          GMT${version}
     42default_variants    +gdal +pcre +nonfree
    4543
    46 depends_lib         port:netcdf \
    47                     port:pcre
     44# CMake out-of-source build:
     45worksrcdir          build
    4846post-extract {
    49     # move GSHHS coastlines to worksrcpath
    50     system "mv ${workpath}/share/coast ${worksrcpath}/share && rmdir ${workpath}/share"
    51     system "mv ${workpath}/{LICENSE.TXT,README.TXT} ${worksrcpath}/share/coast"
    52 }
    53 
    54 configure.pre_args          --prefix=${prefix}/lib/${name}
    55 configure.args              --datarootdir=${prefix}/share/${name} \
    56                             --docdir=${prefix}/share/doc/${name} \
    57                             --mandir=${prefix}/share/doc/${name}/man \
    58                             --includedir=${prefix}/share/${name}/include \
    59                             --enable-shared \
    60                             --enable-flock \
    61                             --disable-xgrid \
    62                             --disable-mex
    63 configure.optflags-delete   -O2
    64 
    65 use_parallel_build          no
    66 universal_variant           no
    67 destroot.target             install-all
    68 configure.ldflags-delete    -L${prefix}/lib
    69 
    70 post-destroot {
    71     ln -s ../doc/${name} ${destroot}${prefix}/share/${name}/doc
    72     ln -s ../../share/doc/${name}/man ${destroot}${prefix}/lib/${name}/man
    73     ln -s ../../share/${name}/include ${destroot}${prefix}/lib/${name}/include
    74     ln -s ../../share/${name} ${destroot}${prefix}/lib/${name}/share
    75 }
    76 
    77 variant octave description {compiles Octave interface} {
    78     depends_lib-append      path:bin/octave:octave
    79     configure.args-append   --enable-octave
     47    file mkdir ${worksrcpath}
     48}
     49
     50configure.optflags-delete   -O2 \
     51                            -Os
     52configure.universal_cflags
     53configure.universal_ldflags
     54
     55configure.args-append       -DCMAKE_C_FLAGS_RELEASE="-O3 -DNDEBUG -fstrict-aliasing" \
     56                            -DCMAKE_C_COMPILER=${configure.cc} \
     57                            -DDCW_ROOT=${prefix} \
     58                            -DGSHHG_ROOT=${prefix} \
     59                            -DNETCDF_ROOT=${prefix} \
     60                            -DFFTW3_ROOT=off \
     61                            -DGDAL_ROOT=off \
     62                            -DPCRE_ROOT=off \
     63                            -DFLOCK=on \
     64                            -DGMT_INSTALL_MODULE_LINKS=off \
     65                            -DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=off \
     66                            -DLICENSE_RESTRICTED=GPL
     67
     68# Location of sources relative to ${worksrcpath}:
     69configure.post_args         ../${distname}
     70
     71variant fftw3 description {Use FFTW-3 library} {
     72    depends_lib-append      port:fftw-3-single
     73    configure.args-delete   -DFFTW3_ROOT=off
     74    configure.args-append   -DFFTW3_ROOT=${prefix}
    8075}
    8176
    82 variant gdal description {Experimental GDAL import support} {
     77variant gdal description {GDAL import support} {
    8378    depends_lib-append      port:gdal
    84     configure.args-append   --enable-gdal
     79    configure.args-delete   -DGDAL_ROOT=off
     80    configure.args-append   -DGDAL_ROOT=${prefix}
    8581}
    8682
    87 variant triangle description {use J. Shewchuk's fast, non-GPL triangulation routine} {
    88     configure.args-append   --enable-triangle
     83variant pcre description {PCRE regular expression support} {
     84    depends_lib-append      port:pcre
     85    configure.args-delete   -DPCRE_ROOT=off
     86    configure.args-append   -DPCRE_ROOT=${prefix}
    8987}
    9088
    91 livecheck.type      regex
    92 livecheck.url       http://www.soest.hawaii.edu/gmt5/gmt/gmt_home.html
    93 livecheck.regex     {Current version is [^0-9 ]*([0-9]+\.[0-9]+\.[0-9a-z]+)}
     89variant lgpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
     90    license-delete          GPL-3
     91    license-append          LGPL-3
     92    configure.args-delete   -DLICENSE_RESTRICTED=GPL
     93    configure.args-append   -DLICENSE_RESTRICTED=LGPL
     94}
     95
     96variant nonfree conflicts lgpl description {enable nonfree code, libraries and binaries \
     97    will not be redistributable} {
     98    license-delete          GPL-3
     99    license-append          Restrictive
     100    configure.args-delete   -DLICENSE_RESTRICTED=GPL
     101    configure.args-append   -DLICENSE_RESTRICTED=no
     102}
    94103
     104livecheck.type      regex
     105livecheck.url       ${homepage}
     106livecheck.regex     {(?i)gmt-(5\.[0-9]+\.[0-9a-z]+)<\/a>}