-
Notifications
You must be signed in to change notification settings - Fork 1
/
root.rb
76 lines (61 loc) · 1.94 KB
/
root.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
68
69
70
71
72
73
74
75
76
require 'formula'
class Root < Formula
homepage 'http://root.cern.ch'
url 'ftp://root.cern.ch/root/root_v5.34.01.source.tar.gz'
sha1 '6e0ed779568f1f9eb0f9af79bef26207444a4173'
version '5.34.01'
keg_only "See Caveats; ROOT likes to be included through thisroot.sh"
depends_on 'cmake' => :build
def options
[
['--cocoa', "Use the cocoa mode"],
['--minuit2', "Compile Minuit2"],
]
end
def install
# Build out of source
mkdir "cmake_oos"
cd "cmake_oos"
# Extend the CMake arguments
args = std_cmake_args
args.push("-Dminuit2=ON") if ARGV.include? '--minuit2'
args.push("-Dcocoa=ON") if ARGV.include? '--cocoa'
system "cmake", "..", *args
system "make install"
if ARGV.include? '--cocoa'
ln "#{prefix}/bin/root.exe" "#{prefix}/bin/root"
end
end
def test
# This test will fail and we won't accept that! It's enough to just replace
# "false" with the main program this formula installs, but it'd be nice if you
# were more thorough. Run the test with `brew test root`.
system "false"
end
def patches
# Fix the cocoa mode not compiling, due to a missing reference in the CMakeLists.txt
DATA
end
def caveats; <<-EOS.undent
Because ROOT depends on several installation-dependent
environment variables to function properly, you should
add the following commands to your shell initialization
script (.bashrc/.profile/etc.), or call them directly
before using ROOT.
For csh/tcsh users:
source #{prefix}/bin/thisroot.csh
For bash/zsh users:
. #{prefix}/bin/thisroot.sh
EOS
end
end
__END__
diff --git a/graf2d/cocoa/CMakeLists.txt b/graf2d/cocoa/CMakeLists.txt
index 556051c..a64acbf 100644
--- a/graf2d/cocoa/CMakeLists.txt
+++ b/graf2d/cocoa/CMakeLists.txt
@@ -5,6 +5,7 @@
ROOT_USE_PACKAGE(graf2d/quartz)
ROOT_USE_PACKAGE(gui/gui)
+ROOT_USE_PACKAGE(graf3d/gl)
add_definitions("-ObjC++ -std=c++11")