1 | # -*- coding: utf-8; mode: tcl; tab-width: 4; c-basic-offset: 4 -*- |
---|
2 | # $Id: Portfile 118258 2014-03-27 19:29:47Z mmoll@macports.org $ |
---|
3 | |
---|
4 | PortSystem 1.0 |
---|
5 | PortGroup python 1.0 |
---|
6 | PortGroup active_variants 1.1 |
---|
7 | PortGroup compiler_blacklist_versions 1.0 |
---|
8 | |
---|
9 | set realname graph-tool |
---|
10 | name py-${realname} |
---|
11 | version 2.2.31 |
---|
12 | categories python science |
---|
13 | platforms darwin |
---|
14 | license GPL-3 |
---|
15 | maintainers skewed.de:tiago mmoll |
---|
16 | description Efficient python graph module |
---|
17 | long_description graph-tool is an efficient python module for manipulation \ |
---|
18 | and statistical analysis of graphs. The internal data \ |
---|
19 | structures and most algorithms are implemented in C++ with \ |
---|
20 | the Boost Graph Library. |
---|
21 | homepage http://graph-tool.skewed.de |
---|
22 | master_sites http://downloads.skewed.de/graph-tool/ |
---|
23 | use_bzip2 yes |
---|
24 | checksums md5 5c2f66d90f77824b924b2b81f5043822 \ |
---|
25 | sha1 5e0b1c215ecd76191a82c745df0fac17e33bfb09 \ |
---|
26 | rmd160 23f52640ab4dfaea1d5b6432a1b5c8293deedbc5 |
---|
27 | distname ${realname}-${version} |
---|
28 | |
---|
29 | if {[string match *clang* ${configure.cxx}] && |
---|
30 | ${os.major} <= 12 && ${os.platform} eq "darwin"} { |
---|
31 | version 2.2.26 |
---|
32 | checksums md5 317b29de0d3ef715fdc9281e078cfb17 \ |
---|
33 | sha1 108be4cf6212eb6886f172ea03813187f73e4c3c \ |
---|
34 | rmd160 cd2e8506522821750d70a97b951254f0a133d218 |
---|
35 | } |
---|
36 | |
---|
37 | python.versions 26 27 32 33 34 |
---|
38 | python.default_version 27 |
---|
39 | |
---|
40 | if {${name} ne ${subport}} { |
---|
41 | compiler.blacklist gcc-3.3 {*gcc-4.[0-3]} |
---|
42 | compiler.blacklist-append {clang < 500} |
---|
43 | universal_variant no |
---|
44 | depends_build-append port:pkgconfig |
---|
45 | depends_lib-append port:boost \ |
---|
46 | port:cairomm \ |
---|
47 | port:cgal \ |
---|
48 | port:expat \ |
---|
49 | path:bin/dot:graphviz \ |
---|
50 | port:py${python.version}-numpy \ |
---|
51 | port:py${python.version}-scipy \ |
---|
52 | port:py${python.version}-gobject3 \ |
---|
53 | port:py${python.version}-cairo |
---|
54 | use_configure yes |
---|
55 | # parallel build starts swapping, even on a MacBook Pro with 8GB of RAM. |
---|
56 | use_parallel_build no |
---|
57 | |
---|
58 | # graph-tool relies on Boost.Python, so make sure it is installed. |
---|
59 | require_active_variants boost python${python.version} |
---|
60 | |
---|
61 | # PYTHON_EXTRA_LDFLAGS is set to work around incorrect detection of |
---|
62 | # link flags by configure |
---|
63 | configure.env-append PYTHON=${python.bin} \ |
---|
64 | PYTHON_VERSION=${python.branch} \ |
---|
65 | PYTHON_CPPFLAGS=-I${python.include} \ |
---|
66 | PYTHON_LDFLAGS="-L${python.libdir}/.. -lpython${python.branch}" \ |
---|
67 | PYTHON_EXTRA_LDFLAGS="-L${python.libdir}/.. -lpython${python.branch}" |
---|
68 | configure.cppflags-append -I${prefix}/include -I${python.include}/.. |
---|
69 | configure.ldflags-append -L${prefix}/lib |
---|
70 | configure.args-append --with-boost=${prefix} --exec-prefix=${python.prefix} |
---|
71 | configure.cxxflags-append -std=c++11 |
---|
72 | if {[string match *clang* ${configure.compiler}] && |
---|
73 | ${os.major} >= 13 && ${os.platform} eq "darwin"} { |
---|
74 | configure.cxxflags-append -stdlib=libc++ |
---|
75 | } |
---|
76 | # Clang uses the old libstc++ from gcc 4.2 before OS X 10.9. Boost doesn't |
---|
77 | # include some of the tr1 headers in libstdc++ and defines its own tr1 |
---|
78 | # classes. This causes conflicts with sparsehash which insists on using |
---|
79 | # the old tr1 headers. |
---|
80 | if {[string match *gcc* ${configure.compiler}] || |
---|
81 | ${os.major} >= 13 && ${os.platform} eq "darwin"} { |
---|
82 | depends_lib-append port:sparsehash |
---|
83 | } else { |
---|
84 | configure.args-append --disable-sparsehash |
---|
85 | } |
---|
86 | build.cmd make |
---|
87 | build.target all |
---|
88 | destroot.cmd make |
---|
89 | destroot.destdir DESTDIR=${destroot} |
---|
90 | |
---|
91 | post-destroot { |
---|
92 | file rename ${destroot}${prefix}/share/doc/graph-tool \ |
---|
93 | ${destroot}${prefix}/share/doc/py${python.version}-graph-tool |
---|
94 | } |
---|
95 | } |
---|
96 | |
---|
97 | if {${name} eq ${subport}} { |
---|
98 | livecheck.type regex |
---|
99 | livecheck.url $homepage |
---|
100 | livecheck.regex Download version (\[0-9.\]+) |
---|
101 | } else { |
---|
102 | livecheck.type none |
---|
103 | } |
---|