Ticket #33641: Portfile2

File Portfile2, 3.5 KB (added by mamoll (Mark Moll), 12 years ago)
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; c-basic-offset: 4 -*-
2# $Id: Portfile 92087 2012-04-17 22:18:29Z mmoll@macports.org $
3
4PortSystem          1.0
5PortGroup           python 1.0
6
7set realname        graph-tool
8name                py-${realname}
9version             2.2.16
10categories          python science
11platforms           darwin
12license             GPL-3
13maintainers         skewed.de:tiago mmoll
14description         Efficient python graph module
15long_description    graph-tool is an efficient python module for manipulation \
16                    and statistical analysis of graphs. The internal data \
17                    structures and most algorithms are implemented in C++ with \
18                    the Boost Graph Library.
19homepage            http://graph-tool.skewed.de
20# Latest release (2.2.16.2) doesn't compile with current compilers
21# We'll switch back to a regular release once it comes out.
22# master_sites        http://downloads.skewed.de/graph-tool/
23# use_bzip2           yes
24# checksums           md5     6d471b18ebe8dd4e8a475d73d4e63d9a \
25#                     sha1    c6cb13ac916be652fe49637e336885471f51d698 \
26#                     rmd160  a76074ef55ed438541430830c00ae83e2d103144
27fetch.type          git
28git.url             git://git.skewed.de/graph-tool
29git.branch          ed7b3bc99df5440978bd258c70171cec806f5534
30distname            ${realname}-${version}
31
32python.versions     25 26 27 31 32
33python.default_version 27
34
35# graph-tool relies on Boost.Python, so make sure it is installed.
36pre-fetch {
37    if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} {
38        return -code error "Please reinstall boost with one of the python variants enabled."
39    }
40}
41
42if {$subport != $name} {
43    pre-configure {
44        system "cd ${worksrcpath} && ./autogen.sh"
45    }
46    universal_variant  no
47    depends_build-append port:autoconf port:automake
48    depends_lib-append port:boost \
49                       port:cairomm \
50                       port:cgal \
51                       port:expat \
52                       path:bin/dot:graphviz \
53                       port:py${python.version}-numpy \
54                       port:py${python.version}-scipy
55    use_configure      yes
56    configure.env-append PYTHON=${python.bin} \
57                         PYTHON_VERSION=${python.branch} \
58                         PYTHON_CPPFLAGS=-I${python.include} \
59                         PYTHON_LDFLAGS="-L${python.libdir}/.. -lpython${python.branch}"
60    configure.cflags-append   -I${prefix}/include
61    configure.cxxflags-append -I${prefix}/include
62    configure.ldflags-append -L${prefix}/lib
63    configure.args-append --with-boost=${prefix}
64    build.cmd          make
65    build.target       all
66    destroot.cmd       make
67    destroot.destdir   DESTDIR=${destroot}
68    # this port does not compile with either of these compilers or with FSF gcc4x
69    # if {${configure.compiler} == "llvm-gcc-4.2" || ${configure.compiler} == "clang" } {
70    #     depends_lib-append  port:apple-gcc42
71    #     configure.compiler  apple-gcc-4.2
72    # }
73
74    post-destroot {
75        xinstall -d ${destroot}${python.pkgd}
76        file rename ${destroot}${prefix}/lib/python${python.branch}/site-packages/graph_tool \
77            ${destroot}${python.pkgd}
78        file rename ${destroot}${prefix}/doc/graph-tool \
79            ${destroot}${prefix}/share/doc/py${python.version}-graph-tool
80    }
81}
82
83if {$name == $subport} {
84    livecheck.type      regex
85    livecheck.url       $homepage
86    livecheck.regex     Version (\[0-9.\]+) of graph-tool
87} else {
88    livecheck.type      none
89}