-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathmoose.rb
67 lines (53 loc) · 1.66 KB
/
moose.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
class Moose < Formula
desc "Multiscale Object Oriented Simulation Environment"
homepage "http://moose.ncbs.res.in"
url "https://github.com/BhallaLab/moose/archive/master.tar.gz"
version "3.1.0"
option "with-gui", "Enable gui support"
depends_on "cmake" => :build
depends_on "gsl"
depends_on "hdf5"
depends_on "matplotlib" => :python
depends_on "python" if MacOS.version <= :snow_leopard
depends_on "pyqt" => :recommended
def install
args = std_cmake_args
args << "-DWITH_SBML=ON"
# Use libsbml-5.9.0 which is shipped with moose. Use static linking
# mechanism. DO NOT rely on macport version.
# if build.with?("libsbml")
# args << "-DWITH_SBML=ON"
# end
mkdir "_build" do
system "cmake", "..", *args
system "make"
end
Dir.chdir("moose-core/python") do
system "python", *Language::Python.setup_install_args(prefix)
end
if build.with?("gui")
(lib/"moose").install "moose-gui"
(lib/"moose").install "moose-examples"
# A wrapper script to launch moose gui. Do we need to set PYTHONPATH here,
# when prefix is not /usr/local?
(bin/"moosegui").write <<-EOS.undent
#!/bin/bash
GUIDIR="#{lib}/moose/moose-gui"
(cd ${GUIDIR} && python mgui.py)
EOS
chmod 0755, bin/"moosegui"
end
end
def caveats
<<-EOS.undent
Please install python-networkx and python-suds-jurko using pip to complete
the dependencies.
$ pip install networkx suds-jurko
EOS
end
test do
## This will not work on Travis
# system "#{HOMEBREW_PREFIX}/bin/python", "-c", "import moose"
system "python", "-c", "import moose"
end
end