<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[116076] trunk/dports/gis/grass/Portfile</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/116076">116076</a></dd>
<dt>Author</dt> <dd>mojca@macports.org</dd>
<dt>Date</dt> <dd>2014-01-17 08:00:42 -0800 (Fri, 17 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>grass: change variant names, support Python 2.6 &amp; 2.7, wxWidgets 2.8 &amp; 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</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkdportsgisgrassPortfile">trunk/dports/gis/grass/Portfile</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkdportsgisgrassPortfile"></a>
<div class="modfile"><h4>Modified: trunk/dports/gis/grass/Portfile (116075 => 116076)</h4>
<pre class="diff"><span>
<span class="info">--- 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)
</span><span class="lines">@@ -6,7 +6,7 @@
</span><span class="cx"> name              grass
</span><span class="cx"> epoch             1
</span><span class="cx"> version           6.4.3
</span><del>-revision          2
</del><ins>+revision          3
</ins><span class="cx"> maintainers       nomaintainer
</span><span class="cx"> categories        gis
</span><span class="cx"> license           GPL-2+
</span><span class="lines">@@ -22,13 +22,6 @@
</span><span class="cx"> checksums         rmd160  bdbd671972730701aa8213c2041abe31a68eea4c \
</span><span class="cx">                   sha256  5d29d322a262330894aa046845e6790258cd6e3f95b28c350ed7839810672ed6
</span><span class="cx"> 
</span><del>-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
-
</del><span class="cx"> depends_build     port:pkgconfig
</span><span class="cx"> depends_lib       port:fftw-3 \
</span><span class="cx">                   port:freetype \
</span><span class="lines">@@ -56,10 +49,9 @@
</span><span class="cx">     patch-Makefile.diff \
</span><span class="cx">     patch-ffmpeg.diff
</span><span class="cx"> 
</span><del>-# List of all python scripts. Used later to ensure usage of python27 (and not
-# the currently active python)
</del><ins>+# List of all python scripts. Used later to ensure usage of python26/python27
+# (insteaf of the currently active python)
</ins><span class="cx"> # Work around bug http://trac.osgeo.org/grass/ticket/1758
</span><del>-depends_build-append    port:python27
</del><span class="cx"> set python_scripts [ list \
</span><span class="cx">     doc/python/m.distance.py \
</span><span class="cx">     doc/python/raster_example_ctypes.py \
</span><span class="lines">@@ -207,14 +199,6 @@
</span><span class="cx">     lib/python/task.py \
</span><span class="cx">     lib/python/vector.py ]
</span><span class="cx"> 
</span><del>-post-patch {
-   reinplace &quot;s|@@APPLICATIONS_DIR@@|${applications_dir}|&quot; ${worksrcpath}/configure
-   reinplace &quot;s|@@PYTHON@@|${python_bin}|&quot; ${worksrcpath}/lib/init/grass.src
-   foreach f $python_scripts {
-       reinplace &quot;s|/usr/bin/env python|${python_bin}|&quot; $f
-   }
-}
-
</del><span class="cx"> configure.ldflags-append -framework OpenGL -framework Accelerate
</span><span class="cx"> configure.args \
</span><span class="cx">     --with-fftw-includes=${prefix}/include \
</span><span class="lines">@@ -238,8 +222,6 @@
</span><span class="cx">     --with-cxx \
</span><span class="cx">     --with-x \
</span><span class="cx">     --without-postgres \
</span><del>-    --disable-python \
-    --disable-wxwidgets \
</del><span class="cx">     --enable-largefile \
</span><span class="cx">     --with-cairo \
</span><span class="cx">     --with-cairo-includes=${prefix}/include/cairo \
</span><span class="lines">@@ -252,16 +234,14 @@
</span><span class="cx">     --with-regex-includes=/usr/include \
</span><span class="cx">     --with-regex-lib=/usr/lib
</span><span class="cx"> 
</span><del>-build.target    default
</del><ins>+build.target        default
</ins><span class="cx"> 
</span><del>-build.args-append PYTHON=${python_bin}
-
</del><span class="cx"> variant mysql5 description {Add MySQL 5 support} {
</span><span class="cx">     depends_lib-append    path:bin/mysql_config5:mysql5
</span><span class="cx">     configure.args-append --with-mysql
</span><span class="cx">     configure.args-append --with-mysql-includes=${prefix}/include/mysql5/mysql
</span><span class="cx">     configure.args-append --with-mysql-libs=${prefix}/lib/mysql5/mysql
</span><del>-    configure.env-append MYSQLD_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
</del><ins>+    configure.env-append  MYSQLD_CONFIG=${prefix}/lib/mysql5/bin/mysql_config
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> variant postgresql83 conflicts postgresql84 postgresql90 postgresql91 postgresql92 postgresql93 description {Add PostgreSQL 8.3 support} {
</span><span class="lines">@@ -328,22 +308,87 @@
</span><span class="cx">                           --with-ffmpeglibs=${prefix}/lib
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-# 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} {
</del><ins>+# 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 &quot;s|@@APPLICATIONS_DIR@@|${applications_dir}|&quot; ${worksrcpath}/configure
+        reinplace &quot;s|@@PYTHON@@|${python_bin}|&quot; ${worksrcpath}/lib/init/grass.src
+        foreach f $python_scripts {
+            reinplace &quot;s|/usr/bin/env python|${python_bin}|&quot; $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 &quot;s|@@APPLICATIONS_DIR@@|${applications_dir}|&quot; ${worksrcpath}/configure
+        reinplace &quot;s|@@PYTHON@@|${python_bin}|&quot; ${worksrcpath}/lib/init/grass.src
+        foreach f $python_scripts {
+            reinplace &quot;s|/usr/bin/env python|${python_bin}|&quot; $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
</ins><span class="cx">     depends_lib-append    port:${wxWidgets.port}
</span><del>-    configure.args-delete --disable-wxwidgets
</del><span class="cx">     configure.args-append --with-wxwidgets=${wxWidgets.wxconfig}
</span><span class="cx"> }
</span><ins>+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}
+}
</ins><span class="cx"> 
</span><del>-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
</del><ins>+if {![variant_isset wxwidgets30] &amp;&amp; ![variant_isset wxgtk28]} {
+    default_variants-append +wxgtk28
</ins><span class="cx"> }
</span><ins>+if {![variant_isset python26] &amp;&amp; ![variant_isset python27]} {
+    if {[variant_isset wxgtk28]} {
+        default_variants-append +python26
+    } else {
+        default_variants-append +python27
+    }
+}
</ins><span class="cx"> 
</span><ins>+# 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
+    }
+}
+
</ins><span class="cx"> livecheck.type      regex
</span><del>-livecheck.url       http://grass.osgeo.org/devel/svntags.php
-livecheck.regex     {GRASS ([0-9.]+):}
</del><ins>+livecheck.url       http://grass.osgeo.org/download/software/sources/
+livecheck.regex     grass-(\[0-9.\]+)${extract.suffix}
</ins></span></pre>
</div>
</div>

</body>
</html>