Skip to content

Instantly share code, notes, and snippets.

@yawara
Forked from jiayun/graph-tool.rb
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yawara/009959e76f348b9ded53 to your computer and use it in GitHub Desktop.
Save yawara/009959e76f348b9ded53 to your computer and use it in GitHub Desktop.
require 'formula'
class GraphTool < Formula
homepage 'http://graph-tool.skewed.de/'
url 'http://downloads.skewed.de/graph-tool/graph-tool-2.2.31.tar.bz2'
sha1 '5e0b1c215ecd76191a82c745df0fac17e33bfb09'
head 'https://github.com/count0/graph-tool.git'
depends_on 'pkg-config' => :build
depends_on 'boost' => 'c++11'
depends_on 'cgal' => 'c++11'
depends_on 'google-sparsehash' => ['c++11', :optional]
depends_on 'cairomm' => 'c++11'
depends_on 'py3cairo'
depends_on 'python3'
#depends_on 'matplotlib' => :python
#depends_on 'numpy' => :python
#depends_on 'scipy' => :python
def install
ENV.cxx11
config_args = %W[
--disable-debug
--disable-dependency-tracking
--disable-optimization
--prefix=#{prefix}
--with-python-module-path=/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages
]
config_args << "--disable-sparsehash" if build.without? 'google-sparsehash'
system "./configure", "LDFLAGS=-L/usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/lib/python3.4/config-3.4m -lpython3.4m ", "PYTHON_EXTRA_LDFLAGS=-Wl,-stack_size,1000000 -framework CoreFoundation /usr/local/Cellar/python3/3.4.3/Frameworks/Python.framework/Versions/3.4/Python ", *config_args
system "make", "install"
end
end
@yawara
Copy link
Author

yawara commented Jul 1, 2015

Python3のバージョン(ここでは3.4.3)がハードコーディングされいるので、利用する場合は適宜自分の環境のバージョンに読み替えてください。

どうやらgraph-toolをPython3でインストールしたい場合は--with-python3をつければいいらしい。

brew install --with-python3 graph-tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment