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 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup python 1.0 |
---|
6 | |
---|
7 | set realname graph-tool |
---|
8 | name py-${realname} |
---|
9 | version 2.2.16.2 |
---|
10 | categories python science |
---|
11 | platforms darwin |
---|
12 | license GPL-3 |
---|
13 | maintainers skewed.de:tiago mmoll |
---|
14 | description Efficient python graph module |
---|
15 | long_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. |
---|
19 | homepage http://graph-tool.skewed.de |
---|
20 | master_sites http://downloads.skewed.de/graph-tool/ |
---|
21 | use_bzip2 yes |
---|
22 | checksums md5 6d471b18ebe8dd4e8a475d73d4e63d9a \ |
---|
23 | sha1 c6cb13ac916be652fe49637e336885471f51d698 \ |
---|
24 | rmd160 a76074ef55ed438541430830c00ae83e2d103144 |
---|
25 | distname ${realname}-${version} |
---|
26 | |
---|
27 | python.versions 25 26 27 |
---|
28 | python.default_version 27 |
---|
29 | |
---|
30 | # graph-tool relies on Boost.Python, so make sure it is installed. |
---|
31 | pre-fetch { |
---|
32 | if {![file exists ${prefix}/lib/libboost_python-mt.dylib]} { |
---|
33 | return -code error "Please reinstall boost with one of the python variants enabled." |
---|
34 | } |
---|
35 | } |
---|
36 | |
---|
37 | if {$subport != $name} { |
---|
38 | universal_variant no |
---|
39 | depends_build-append port:autoconf port:automake |
---|
40 | depends_lib-append port:boost \ |
---|
41 | port:cairomm \ |
---|
42 | port:cgal \ |
---|
43 | port:expat \ |
---|
44 | path:bin/dot:graphviz \ |
---|
45 | port:py${python.version}-numpy \ |
---|
46 | port:py${python.version}-scipy |
---|
47 | use_configure yes |
---|
48 | configure.env-append PYTHON=${python.bin} \ |
---|
49 | PYTHON_VERSION=${python.branch} \ |
---|
50 | PYTHON_CPPFLAGS=-I${python.include} \ |
---|
51 | PYTHON_LDFLAGS="-L${python.libdir}/.. -lpython${python.branch}" |
---|
52 | configure.cflags-append -I${prefix}/include |
---|
53 | configure.cxxflags-append -I${prefix}/include |
---|
54 | configure.ldflags-append -L${prefix}/lib |
---|
55 | configure.args-append --with-boost=${prefix} |
---|
56 | build.cmd make |
---|
57 | build.target all |
---|
58 | destroot.cmd make |
---|
59 | destroot.destdir DESTDIR=${destroot} |
---|
60 | variant gcc44 { |
---|
61 | depends_build-append port:gcc44 |
---|
62 | configure.compiler "macports-gcc-4.4" |
---|
63 | } |
---|
64 | variant gcc45 { |
---|
65 | depends_build-append port:gcc45 |
---|
66 | configure.compiler "macports-gcc-4.5" |
---|
67 | } |
---|
68 | variant gcc46 { |
---|
69 | depends_build-append port:gcc46 |
---|
70 | configure.compiler "macports-gcc-4.6" |
---|
71 | } |
---|
72 | variant gcc47 { |
---|
73 | depends_build-append port:gcc47 |
---|
74 | configure.compiler "macports-gcc-4.7" |
---|
75 | } |
---|
76 | # this port doesn't compile with clang or llvm-gcc-4.2 |
---|
77 | if { ![variant_isset gcc44] && ![variant_isset gcc46] && ![variant_isset gcc47] } { |
---|
78 | default_variants +gcc45 |
---|
79 | } |
---|
80 | |
---|
81 | post-destroot { |
---|
82 | xinstall -d ${destroot}${python.pkgd} |
---|
83 | file rename ${destroot}${prefix}/lib/python${python.branch}/site-packages/graph_tool \ |
---|
84 | ${destroot}${python.pkgd} |
---|
85 | file rename ${destroot}${prefix}/doc/graph-tool \ |
---|
86 | ${destroot}${prefix}/share/doc/py${python.version}-graph-tool |
---|
87 | } |
---|
88 | } |
---|
89 | |
---|
90 | if {$name == $subport} { |
---|
91 | livecheck.type regex |
---|
92 | livecheck.url $homepage |
---|
93 | livecheck.regex Version (\[0-9.\]+) of graph-tool |
---|
94 | } else { |
---|
95 | livecheck.type none |
---|
96 | } |
---|