[99910] trunk/dports/science/ompl/Portfile

mmoll at macports.org mmoll at macports.org
Tue Nov 20 19:48:43 PST 2012


Revision: 99910
          https://trac.macports.org/changeset/99910
Author:   mmoll at macports.org
Date:     2012-11-20 19:48:43 -0800 (Tue, 20 Nov 2012)
Log Message:
-----------
science/ompl: version bump, programmatically declare all python variants in the way that the boost port does it, use active_variants portgroup to make sure boost.python is installed

Modified Paths:
--------------
    trunk/dports/science/ompl/Portfile

Modified: trunk/dports/science/ompl/Portfile
===================================================================
--- trunk/dports/science/ompl/Portfile	2012-11-21 03:39:43 UTC (rev 99909)
+++ trunk/dports/science/ompl/Portfile	2012-11-21 03:48:43 UTC (rev 99910)
@@ -2,9 +2,10 @@
 
 PortSystem 1.0
 PortGroup cmake 1.0
+PortGroup active_variants 1.0
 
 name                ompl
-version             0.11.1
+version             0.12.0
 categories          science
 maintainers         mmoll
 description         The Open Motion Planning Library (OMPL)
@@ -14,9 +15,9 @@
 platforms           darwin
 license             BSD
 master_sites        https://bitbucket.org/ompl/ompl/downloads
-checksums           md5     235ca56932ff20da0c01f8201657740a \
-                    sha1    e5b1827477f36d373f9a9a5dd88941bcdc7bae61 \
-                    rmd160  c45de5b40ff870f68cd62915f68ec05caaf3360d
+checksums           md5     c93885bf48ea1d6f134077a10480283f \
+                    sha1    68b21caa9acb8d4116ca426265652445e29bc3f7 \
+                    rmd160  366ec0324ac007589b99059eb2f0e7728a573923
 distname            ${name}-${version}-Source
 depends_lib-append  port:boost port:ode
 
@@ -31,7 +32,7 @@
 }
 
 # The +app variant includes all the content of the regular OMPL version, but
-# adds a simple GUI and an extra library with bindings to the assimp and pqp
+# adds a simple GUI and an extra library with bindings to the assimp and fcl
 # libraries. The cascade of dependencies due to pyqt4 is rather large, so by
 # default the +app variant is not enabled. Also, the additions to OMPL in
 # this variant are distributed under a slightly different license than the
@@ -46,70 +47,75 @@
 http://ompl.kavrakilab.org/license.html#ricelicense"
     }
     depends_build-append port:pkgconfig
-    depends_lib-append  port:assimp port:pqp port:flann port:libccd
-    checksums           md5     c5ed8fb9bb248632d762703239108ea0 \
-                        sha1    5ad5e77b4771b7faadddb19f2fd2c23bd9a77642 \
-                        rmd160  1911cf56b7c369591e18bf1af2766213fd9c8d4e
+    depends_lib-append  port:assimp port:fcl
+    configure.args-append -DOMPLAPP_PQP=OFF
+    checksums           md5     12a258bbe40621229418fb8573b0ba1c \
+                        sha1    baaad8f45f7cba9024441cee13ed114a7b1158ea \
+                        rmd160  c50f2614ac885c2dcdb218c938203694319cc565
 }
 
-variant python26 description {Use python2.6 for python bindings} conflicts python27 {
-    depends_build-append    port:py26-pyplusplus-devel
-    depends_lib-append      port:python26
-    configure.args-append   -DPYTHON_EXEC=${prefix}/bin/python2.6
-    if { [variant_isset app] } {
-        depends_lib-append      port:py26-pyqt4 port:py26-opengl
-        post-destroot {
-            reinplace "s|#!/usr/bin/env python|#!${prefix}/bin/python2.6|g" \
-                ${destroot}${prefix}/bin/ompl_app
-            # not needed and causes problems with rpaths
-            delete \
-                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ompl/util/libompl.dylib \
-                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ompl/app/libompl_app.dylib
+set pythons_suffixes {26 27 31 32 33}
+
+set pythons_ports {}
+foreach s ${pythons_suffixes} {
+    lappend pythons_ports python${s}
+}
+
+proc python_dir {} {
+    global pythons_suffixes
+    foreach s ${pythons_suffixes} {
+        if {[variant_isset python${s}]} {
+            set p python[string index ${s} 0].[string index ${s} 1]
+            return [file normalize [exec ${p} -c "import sys; print(sys.prefix)"]/lib/${p}/site-packages]
         }
-    } else {
-        post-destroot {
-            # not needed and causes problems with rpaths
-            delete  \
-                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ompl/util/libompl.dylib
-        }
     }
+    error "Python support not enabled."
 }
 
-variant python27 description {Use python2.7 for python bindings} conflicts python26 {
-    depends_build-append    port:py27-pyplusplus-devel
-    depends_lib-append      port:python27
-    configure.args-append   -DPYTHON_EXEC=${prefix}/bin/python2.7
-    if { [variant_isset app] } {
-        depends_lib-append  port:py27-pyqt4 port:py27-opengl
-        post-destroot {
-            reinplace "s|#!/usr/bin/env python|#!${prefix}/bin/python2.7|g" \
-                ${destroot}${prefix}/bin/ompl_app
-            # not needed and causes problems with rpaths
-            delete \
-                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ompl/util/libompl.dylib \
-                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ompl/app/libompl_app.dylib
+foreach s ${pythons_suffixes} {
+    set p python${s}
+    set v [string index ${s} 0].[string index ${s} 1]
+    set i [lsearch -exact ${pythons_ports} ${p}]
+    set c [lreplace ${pythons_ports} ${i} ${i}]
+    # python 3k conflicts with app, because py-opengl doesn't exist for python 3k
+    if { ${s} > 30 } { set a "app" } else { set a "" }
+    eval [subst {
+        variant ${p} description "Use Python ${v} for python bindings" conflicts ${c} ${a} debug {
+            depends_build-append    port:py${s}-pyplusplus-devel
+            depends_lib-append      port:${p}
+            configure.args-append   -DPYTHON_EXEC=${prefix}/bin/python${v}
+            # the python bindings rely on Boost.Python, so make sure it is installed.
+            pre-configure {
+                require_active_variants boost ${p}
+            }
+            if { [variant_isset app] } {
+                depends_lib-append      port:py${s}-pyqt4 port:py${s}-opengl
+                post-destroot {
+                    reinplace "s|#!/usr/bin/env python|#!${prefix}/bin/python${v}|g" \
+                        ${destroot}${prefix}/bin/ompl_app
+                    # not needed and causes problems with rpaths
+                    set site_packages \[python_dir\]
+                    delete ${destroot}\${site_packages}/ompl/util/libompl.dylib \
+                           ${destroot}\${site_packages}/ompl/app/libompl_app.dylib
+                }
+            } else {
+                post-destroot {
+                    # not needed and causes problems with rpaths
+                    set site_packages \[python_dir\]
+                    delete ${destroot}\${site_packages}/ompl/util/libompl.dylib
+                }
+            }
         }
-    } else {
-        post-destroot {
-            # not needed and causes problems with rpaths
-            delete \
-                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ompl/util/libompl.dylib
-        }
-    }
+    }]
 }
 
 # enable one python variant so that the python bindings can be compiled
-if { ![variant_isset python26] && ![variant_isset python27] } {
-    default_variants        +python27
+if { ![variant_isset python26] && ![variant_isset python27] &&
+     ![variant_isset python31] && ![variant_isset python32] &&
+     ![variant_isset python33]} {
+    default_variants +python27
 }
 
-# the python bindings rely on Boost.Python, so make sure it is installed.
-pre-fetch {
-    if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} {
-        return -code error "Please reinstall boost with the +python26 or +python27 variant enabled."
-    }
-}
-
 livecheck.type  regex
 livecheck.url   http://ompl.kavrakilab.org/download.html
 livecheck.regex (\[0-9.\]+), released
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121120/1baa09c0/attachment.html>


More information about the macports-changes mailing list