source: trunk/dports/science/ompl/Portfile @ 91030

Last change on this file since 91030 was 91030, checked in by mmoll@…, 5 years ago

science/ompl: update to 0.10.2

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1# $Id: Portfile 91030 2012-03-22 17:09:42Z mmoll@macports.org $
2
3PortSystem 1.0
4PortGroup cmake 1.0
5
6name                ompl
7version             0.10.2
8categories          science
9maintainers         mmoll
10description         The Open Motion Planning Library (OMPL)
11long_description    The Open Motion Planning Library (OMPL) consists of a set \
12                    of sampling-based motion planning algorithms.
13homepage            http://ompl.kavrakilab.org
14platforms           darwin
15license             BSD
16master_sites        sourceforge
17checksums           md5     2e7ad9780070b93916f1e695696fd185 \
18                    sha1    d6c47ca624f6133c48d8bee12ca52e0bc5644a68 \
19                    rmd160  ba8b4e3b799389b4182e8fea433cd284d41e3067
20distname            ${name}-${version}-Source
21depends_lib-append  port:boost port:ode
22
23# no universal of gccxml-devel
24universal_variant   no
25configure.args-append   -DOMPL_BUILD_TESTS=OFF -DOMPL_BUILD_DEMOS=OFF
26# generate the extra C++ code needed for Python bindings. This code seems
27# somewhat dependent on compiler and/or boost version, so we can't
28# pre-generate them and make them available as an extra download.
29post-configure {
30    system "cd ${worksrcpath}; ${build.cmd} update_bindings"
31}
32
33# The +app variant includes all the content of the regular OMPL version, but
34# adds a simple GUI and an extra library with bindings to the assimp and pqp
35# libraries. The cascade of dependencies due to pyqt4 is rather large, so by
36# default the +app variant is not enabled. Also, the additions to OMPL in
37# this variant are distributed under a slightly different license than the
38# regular OMPL version.
39variant app description {Include GUI and extra demo code} {
40    distname            omplapp-${version}-Source
41    license             noncommercial
42    pre-extract {
43        ui_warn "The +app variant causes some extra code to be compiled that is
44distributed under the Rice University Software Distribution License. For
45details, please read:
46http://ompl.kavrakilab.org/license.html#ricelicense"
47    }
48    depends_lib-append  port:assimp port:pqp port:flann port:libccd
49    checksums           md5     37b49b2a385ea44207f2a24d5203b027 \
50                        sha1    7f8f94ab8dfdfb33c188cd4a8b4c9fac6ce5c1fe \
51                        rmd160  aaa548e3b6c79cb20be8c5ecdb41b3b5f5d0c3e9
52}
53
54variant python26 description {Use python2.6 for python bindings} conflicts python27 {
55    depends_build-append    port:py26-pyplusplus-devel
56    depends_lib-append      port:python26
57    configure.args-append   -DPYTHON_EXEC=${prefix}/bin/python2.6
58    if { [variant_isset app] } {
59        depends_lib-append      port:py26-pyqt4 port:py26-opengl
60        post-destroot {
61            reinplace "s|#!/usr/bin/env python|#!${prefix}/bin/python2.6|g" \
62                ${destroot}${prefix}/bin/ompl_app
63            # not needed and causes problems with rpaths
64            delete \
65                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ompl/util/libompl.dylib \
66                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ompl/app/libompl_app.dylib
67        }
68    } else {
69        post-destroot {
70            # not needed and causes problems with rpaths
71            delete  \
72                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ompl/util/libompl.dylib
73        }
74    }
75}
76
77variant python27 description {Use python2.7 for python bindings} conflicts python26 {
78    depends_build-append    port:py27-pyplusplus-devel
79    depends_lib-append      port:python27
80    configure.args-append   -DPYTHON_EXEC=${prefix}/bin/python2.7
81    if { [variant_isset app] } {
82        depends_lib-append  port:py27-pyqt4 port:py27-opengl
83        post-destroot {
84            reinplace "s|#!/usr/bin/env python|#!${prefix}/bin/python2.7|g" \
85                ${destroot}${prefix}/bin/ompl_app
86            # not needed and causes problems with rpaths
87            delete \
88                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ompl/util/libompl.dylib \
89                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ompl/app/libompl_app.dylib
90        }
91    } else {
92        post-destroot {
93            # not needed and causes problems with rpaths
94            delete \
95                ${destroot}${prefix}/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ompl/util/libompl.dylib
96        }
97    }
98}
99
100# enable one python variant so that the python bindings can be compiled
101if { ![variant_isset python26] && ![variant_isset python27] } {
102    default_variants        +python27
103}
104
105# the python bindings rely on Boost.Python, so make sure it is installed.
106pre-fetch {
107    if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} {
108        return -code error "Please reinstall boost with the +python26 or +python27 variant enabled."
109    }
110}
111
112livecheck.type  regex
113livecheck.url   http://ompl.kavrakilab.org/download.html
114livecheck.regex (\[0-9.\]+), released
Note: See TracBrowser for help on using the repository browser.