Changeset 116076 for trunk/dports/gis


Ignore:
Timestamp:
Jan 17, 2014, 4:00:42 PM (6 years ago)
Author:
mojca@…
Message:

grass: change variant names, support Python 2.6 & 2.7, wxWidgets 2.8 & 3.0 (#36904), fix livecheck

  • add variants python26, python27`
  • add variants wxgtk28, wxwidgets30` (experimental, not functional yet)
  • remove variants wxwidgets and wxPython: support both by default
  • fix livecheck
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/gis/grass/Portfile

    r115279 r116076  
    77epoch             1
    88version           6.4.3
    9 revision          2
     9revision          3
    1010maintainers       nomaintainer
    1111categories        gis
     
    2222checksums         rmd160  bdbd671972730701aa8213c2041abe31a68eea4c \
    2323                  sha256  5d29d322a262330894aa046845e6790258cd6e3f95b28c350ed7839810672ed6
    24 
    25 wxWidgets.use     wxPython-3.0
    26 
    27 # TODO
    28 # this port doesn't work with the python portgroup because the group changes too much
    29 # but it would make sense to fix this properly
    30 set python_bin    ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
    3124
    3225depends_build     port:pkgconfig
     
    5750    patch-ffmpeg.diff
    5851
    59 # List of all python scripts. Used later to ensure usage of python27 (and not
    60 # the currently active python)
     52# List of all python scripts. Used later to ensure usage of python26/python27
     53# (insteaf of the currently active python)
    6154# Work around bug http://trac.osgeo.org/grass/ticket/1758
    62 depends_build-append    port:python27
    6355set python_scripts [ list \
    6456    doc/python/m.distance.py \
     
    208200    lib/python/vector.py ]
    209201
    210 post-patch {
    211    reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" ${worksrcpath}/configure
    212    reinplace "s|@@PYTHON@@|${python_bin}|" ${worksrcpath}/lib/init/grass.src
    213    foreach f $python_scripts {
    214        reinplace "s|/usr/bin/env python|${python_bin}|" $f
    215    }
    216 }
    217 
    218202configure.ldflags-append -framework OpenGL -framework Accelerate
    219203configure.args \
     
    239223    --with-x \
    240224    --without-postgres \
    241     --disable-python \
    242     --disable-wxwidgets \
    243225    --enable-largefile \
    244226    --with-cairo \
     
    253235    --with-regex-lib=/usr/lib
    254236
    255 build.target    default
    256 
    257 build.args-append PYTHON=${python_bin}
     237build.target        default
    258238
    259239variant mysql5 description {Add MySQL 5 support} {
     
    262242    configure.args-append --with-mysql-includes=${prefix}/include/mysql5/mysql
    263243    configure.args-append --with-mysql-libs=${prefix}/lib/mysql5/mysql
    264     configure.env-append MYSQLD_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
     244    configure.env-append  MYSQLD_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
    265245}
    266246
     
    329309}
    330310
    331 # FIXME:
    332 # grass 4.6.3 is not compatible with wxPython 2.9 yet
    333 # the option names should be changed to allow building against wxPython 2.8 (either carbon or gtk variant)
    334 # it also needs to be guaranteed that the right architecture is chosen
    335 variant wxwidgets description {Add WXWidgets support} {
     311# python26 variant is only present to allow 'grass +wxgtk28' to coexist with py27-wxpython-3.0
     312# once support for wxWidgets 3.0 is complete, support for Python 2.6 may be removed
     313variant python26 conflicts python27 description {} {
     314    depends_lib-append    port:python26
     315    set python_bin        ${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6
     316    #                     Enable support for wxGUI Python extensions
     317    #                     (by removing this we wouldn't need to depend on py-wxpython-x.y)
     318    configure.args-append --with-python=${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6-config
     319    build.args-append     PYTHON=${python_bin}
     320    # TODO: this port doesn't work with the python portgroup because the group changes too much
     321    # but it would make sense to fix this in such a way that python_bin could be determined automatically
     322
     323    post-patch {
     324        # for some reason it fails if python_bin is not defined inside post-patch (figure out why)
     325        set python_bin ${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6
     326        reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" ${worksrcpath}/configure
     327        reinplace "s|@@PYTHON@@|${python_bin}|" ${worksrcpath}/lib/init/grass.src
     328        foreach f $python_scripts {
     329            reinplace "s|/usr/bin/env python|${python_bin}|" $f
     330        }
     331    }
     332}
     333
     334variant python27 conflicts python26 description {} {
     335    depends_lib-append    port:python27
     336    set python_bin        ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
     337    configure.args-append --with-python=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7-config
     338    build.args-append     PYTHON=${python_bin}
     339
     340    post-patch {
     341        set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
     342        reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" ${worksrcpath}/configure
     343        reinplace "s|@@PYTHON@@|${python_bin}|" ${worksrcpath}/lib/init/grass.src
     344        foreach f $python_scripts {
     345            reinplace "s|/usr/bin/env python|${python_bin}|" $f
     346        }
     347    }
     348}
     349
     350# TODO: in principle wxWidgets is optional and could be disable with
     351#       --disable-wxwidgets if there is demand for that
     352#       grass 4.6.3 is not compatible with wxWidgets 3.0 yet
     353variant wxwidgets30 conflicts wxgtk28 description {Use Cocoa-based wxWidgets 3.0 (experimental)} {
     354    wxWidgets.use         wxPython-3.0
    336355    depends_lib-append    port:${wxWidgets.port}
    337     configure.args-delete --disable-wxwidgets
    338356    configure.args-append --with-wxwidgets=${wxWidgets.wxconfig}
    339357}
    340 
    341 variant wxPython requires wxwidgets description {Enable support for wxGUI Python extensions} {
    342     depends_lib           port:py27-wxpython-3.0
    343     configure.args-delete --disable-python
    344     configure.args-append --with-python=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7-config
     358variant wxgtk28 conflicts wxwidgets30 description {Use GTK-based wxWidgets 2.8} {
     359    wxWidgets.use         wxGTK-2.8
     360    depends_lib-append    port:${wxWidgets.port}
     361    configure.args-append --with-wxwidgets=${wxWidgets.wxconfig}
     362}
     363
     364if {![variant_isset wxwidgets30] && ![variant_isset wxgtk28]} {
     365    default_variants-append +wxgtk28
     366}
     367if {![variant_isset python26] && ![variant_isset python27]} {
     368    if {[variant_isset wxgtk28]} {
     369        default_variants-append +python26
     370    } else {
     371        default_variants-append +python27
     372    }
     373}
     374
     375# TODO: if py27-wxpython-3.0 is installed, grass +wxgtk28 cannot be installed with +python27
     376#       we could remove this by disabling wxpython support altogether
     377#       (in case there is demand for it)
     378if {[variant_isset wxgtk28]} {
     379    if {[variant_isset python26]} {
     380        depends_lib-append port:py26-wxpython-2.8
     381    } elseif {[variant_isset python27]} {
     382        depends_lib-append port:py27-wxpython-2.8
     383    }
     384} elseif {[variant_isset wxwidgets30]} {
     385    if {[variant_isset python26]} {
     386        depends_lib-append port:py26-wxpython-3.0
     387    } elseif {[variant_isset python27]} {
     388        depends_lib-append port:py27-wxpython-3.0
     389    }
    345390}
    346391
    347392livecheck.type      regex
    348 livecheck.url       http://grass.osgeo.org/devel/svntags.php
    349 livecheck.regex     {GRASS ([0-9.]+):}
     393livecheck.url       http://grass.osgeo.org/download/software/sources/
     394livecheck.regex     grass-(\[0-9.\]+)${extract.suffix}
Note: See TracChangeset for help on using the changeset viewer.