Ticket #41203: Portfile-gmt5-v2.diff

File Portfile-gmt5-v2.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:ghostscript \
     40                    port:gshhg-gmt-nc4 \
     41                    port:netcdf \
    4342
    44 worksrcdir          GMT${version}
     43default_variants    +gdal +pcre +nonfree
    4544
    46 depends_lib         port:netcdf \
    47                     port:pcre
     45# CMake out-of-source build:
     46worksrcdir          build
    4847post-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
     48    file mkdir ${worksrcpath}
     49}
     50
     51# Mimic CMake's default FLAGS:
     52if {[variant_isset debug]} {
     53    configure.optflags      -O0
     54} else {
     55    configure.optflags      -O3
     56}
     57
     58configure.cflags-append     -fstrict-aliasing
     59configure.args-append       -DDCW_ROOT=${prefix} \
     60                            -DGSHHG_ROOT=${prefix} \
     61                            -DNETCDF_ROOT=${prefix} \
     62                            -DFFTW3_ROOT=off \
     63                            -DGDAL_ROOT=off \
     64                            -DPCRE_ROOT=off \
     65                            -DFLOCK=on \
     66                            -DGMT_INSTALL_MODULE_LINKS=off \
     67                            -DGMT_INSTALL_TRADITIONAL_FOLDERNAMES=off \
     68                            -DLICENSE_RESTRICTED=GPL
     69
     70# Location of sources relative to ${worksrcpath}:
     71configure.post_args         ../${distname}
     72
     73variant fftw3 description {Use FFTW-3 library} {
     74    depends_lib-append      port:fftw-3-single
     75    configure.args-delete   -DFFTW3_ROOT=off
     76    configure.args-append   -DFFTW3_ROOT=${prefix}
    8077}
    8178
    82 variant gdal description {Experimental GDAL import support} {
     79variant gdal description {GDAL import support} {
    8380    depends_lib-append      port:gdal
    84     configure.args-append   --enable-gdal
     81    configure.args-delete   -DGDAL_ROOT=off
     82    configure.args-append   -DGDAL_ROOT=${prefix}
    8583}
    8684
    87 variant triangle description {use J. Shewchuk's fast, non-GPL triangulation routine} {
    88     configure.args-append   --enable-triangle
     85variant pcre description {PCRE regular expression support} {
     86    depends_lib-append      port:pcre
     87    configure.args-delete   -DPCRE_ROOT=off
     88    configure.args-append   -DPCRE_ROOT=${prefix}
    8989}
    9090
    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]+)}
     91variant lgpl conflicts nonfree description {disallow use of GPL code, license will be LGPL} {
     92    license-delete          GPL-3
     93    license-append          LGPL-3
     94    configure.args-delete   -DLICENSE_RESTRICTED=GPL
     95    configure.args-append   -DLICENSE_RESTRICTED=LGPL
     96}
    9497
     98variant nonfree conflicts lgpl description {enable nonfree code, libraries and binaries \
     99    will not be redistributable} {
     100    license-delete          GPL-3
     101    license-append          Restrictive
     102    configure.args-delete   -DLICENSE_RESTRICTED=GPL
     103    configure.args-append   -DLICENSE_RESTRICTED=no
     104}
     105
     106livecheck.type      regex
     107livecheck.url       ${homepage}
     108livecheck.regex     {(?i)gmt-(5\.[0-9]+\.[0-9a-z]+)<\/a>}