[116076] trunk/dports/gis/grass/Portfile

mojca at macports.org mojca at macports.org
Fri Jan 17 08:00:42 PST 2014


Revision: 116076
          https://trac.macports.org/changeset/116076
Author:   mojca at macports.org
Date:     2014-01-17 08:00:42 -0800 (Fri, 17 Jan 2014)
Log 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

Modified Paths:
--------------
    trunk/dports/gis/grass/Portfile

Modified: trunk/dports/gis/grass/Portfile
===================================================================
--- trunk/dports/gis/grass/Portfile	2014-01-17 14:47:21 UTC (rev 116075)
+++ trunk/dports/gis/grass/Portfile	2014-01-17 16:00:42 UTC (rev 116076)
@@ -6,7 +6,7 @@
 name              grass
 epoch             1
 version           6.4.3
-revision          2
+revision          3
 maintainers       nomaintainer
 categories        gis
 license           GPL-2+
@@ -22,13 +22,6 @@
 checksums         rmd160  bdbd671972730701aa8213c2041abe31a68eea4c \
                   sha256  5d29d322a262330894aa046845e6790258cd6e3f95b28c350ed7839810672ed6
 
-wxWidgets.use     wxPython-3.0
-
-# TODO
-# this port doesn't work with the python portgroup because the group changes too much
-# but it would make sense to fix this properly
-set python_bin    ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
-
 depends_build     port:pkgconfig
 depends_lib       port:fftw-3 \
                   port:freetype \
@@ -56,10 +49,9 @@
     patch-Makefile.diff \
     patch-ffmpeg.diff
 
-# List of all python scripts. Used later to ensure usage of python27 (and not
-# the currently active python)
+# List of all python scripts. Used later to ensure usage of python26/python27
+# (insteaf of the currently active python)
 # Work around bug http://trac.osgeo.org/grass/ticket/1758
-depends_build-append    port:python27
 set python_scripts [ list \
     doc/python/m.distance.py \
     doc/python/raster_example_ctypes.py \
@@ -207,14 +199,6 @@
     lib/python/task.py \
     lib/python/vector.py ]
 
-post-patch {
-   reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" ${worksrcpath}/configure
-   reinplace "s|@@PYTHON@@|${python_bin}|" ${worksrcpath}/lib/init/grass.src
-   foreach f $python_scripts {
-       reinplace "s|/usr/bin/env python|${python_bin}|" $f
-   }
-}
-
 configure.ldflags-append -framework OpenGL -framework Accelerate
 configure.args \
     --with-fftw-includes=${prefix}/include \
@@ -238,8 +222,6 @@
     --with-cxx \
     --with-x \
     --without-postgres \
-    --disable-python \
-    --disable-wxwidgets \
     --enable-largefile \
     --with-cairo \
     --with-cairo-includes=${prefix}/include/cairo \
@@ -252,16 +234,14 @@
     --with-regex-includes=/usr/include \
     --with-regex-lib=/usr/lib
 
-build.target    default
+build.target        default
 
-build.args-append PYTHON=${python_bin}
-
 variant mysql5 description {Add MySQL 5 support} {
     depends_lib-append    path:bin/mysql_config5:mysql5
     configure.args-append --with-mysql
     configure.args-append --with-mysql-includes=${prefix}/include/mysql5/mysql
     configure.args-append --with-mysql-libs=${prefix}/lib/mysql5/mysql
-    configure.env-append MYSQLD_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
+    configure.env-append  MYSQLD_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
 }
 
 variant postgresql83 conflicts postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 description {Add PostgreSQL 8.3 support} {
@@ -328,22 +308,87 @@
                           --with-ffmpeglibs=${prefix}/lib
 }
 
-# FIXME:
-# grass 4.6.3 is not compatible with wxPython 2.9 yet
-# the option names should be changed to allow building against wxPython 2.8 (either carbon or gtk variant)
-# it also needs to be guaranteed that the right architecture is chosen
-variant wxwidgets description {Add WXWidgets support} {
+# python26 variant is only present to allow 'grass +wxgtk28' to coexist with py27-wxpython-3.0
+# once support for wxWidgets 3.0 is complete, support for Python 2.6 may be removed
+variant python26 conflicts python27 description {} {
+    depends_lib-append    port:python26
+    set python_bin        ${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6
+    #                     Enable support for wxGUI Python extensions
+    #                     (by removing this we wouldn't need to depend on py-wxpython-x.y)
+    configure.args-append --with-python=${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6-config
+    build.args-append     PYTHON=${python_bin}
+    # TODO: this port doesn't work with the python portgroup because the group changes too much
+    # but it would make sense to fix this in such a way that python_bin could be determined automatically
+
+    post-patch {
+        # for some reason it fails if python_bin is not defined inside post-patch (figure out why)
+        set python_bin ${frameworks_dir}/Python.framework/Versions/2.6/bin/python2.6
+        reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" ${worksrcpath}/configure
+        reinplace "s|@@PYTHON@@|${python_bin}|" ${worksrcpath}/lib/init/grass.src
+        foreach f $python_scripts {
+            reinplace "s|/usr/bin/env python|${python_bin}|" $f
+        }
+    }
+}
+
+variant python27 conflicts python26 description {} {
+    depends_lib-append    port:python27
+    set python_bin        ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
+    configure.args-append --with-python=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7-config
+    build.args-append     PYTHON=${python_bin}
+
+    post-patch {
+        set python_bin ${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7
+        reinplace "s|@@APPLICATIONS_DIR@@|${applications_dir}|" ${worksrcpath}/configure
+        reinplace "s|@@PYTHON@@|${python_bin}|" ${worksrcpath}/lib/init/grass.src
+        foreach f $python_scripts {
+            reinplace "s|/usr/bin/env python|${python_bin}|" $f
+        }
+    }
+}
+
+# TODO: in principle wxWidgets is optional and could be disable with
+#       --disable-wxwidgets if there is demand for that
+#       grass 4.6.3 is not compatible with wxWidgets 3.0 yet
+variant wxwidgets30 conflicts wxgtk28 description {Use Cocoa-based wxWidgets 3.0 (experimental)} {
+    wxWidgets.use         wxPython-3.0
     depends_lib-append    port:${wxWidgets.port}
-    configure.args-delete --disable-wxwidgets
     configure.args-append --with-wxwidgets=${wxWidgets.wxconfig}
 }
+variant wxgtk28 conflicts wxwidgets30 description {Use GTK-based wxWidgets 2.8} {
+    wxWidgets.use         wxGTK-2.8
+    depends_lib-append    port:${wxWidgets.port}
+    configure.args-append --with-wxwidgets=${wxWidgets.wxconfig}
+}
 
-variant wxPython requires wxwidgets description {Enable support for wxGUI Python extensions} {
-    depends_lib           port:py27-wxpython-3.0
-    configure.args-delete --disable-python
-    configure.args-append --with-python=${frameworks_dir}/Python.framework/Versions/2.7/bin/python2.7-config
+if {![variant_isset wxwidgets30] && ![variant_isset wxgtk28]} {
+    default_variants-append +wxgtk28
 }
+if {![variant_isset python26] && ![variant_isset python27]} {
+    if {[variant_isset wxgtk28]} {
+        default_variants-append +python26
+    } else {
+        default_variants-append +python27
+    }
+}
 
+# TODO: if py27-wxpython-3.0 is installed, grass +wxgtk28 cannot be installed with +python27
+#       we could remove this by disabling wxpython support altogether
+#       (in case there is demand for it)
+if {[variant_isset wxgtk28]} {
+    if {[variant_isset python26]} {
+        depends_lib-append port:py26-wxpython-2.8
+    } elseif {[variant_isset python27]} {
+        depends_lib-append port:py27-wxpython-2.8
+    }
+} elseif {[variant_isset wxwidgets30]} {
+    if {[variant_isset python26]} {
+        depends_lib-append port:py26-wxpython-3.0
+    } elseif {[variant_isset python27]} {
+        depends_lib-append port:py27-wxpython-3.0
+    }
+}
+
 livecheck.type      regex
-livecheck.url       http://grass.osgeo.org/devel/svntags.php
-livecheck.regex     {GRASS ([0-9.]+):}
+livecheck.url       http://grass.osgeo.org/download/software/sources/
+livecheck.regex     grass-(\[0-9.\]+)${extract.suffix}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140117/d2103b1a/attachment-0001.html>


More information about the macports-changes mailing list