forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geant.rb
38 lines (33 loc) · 1.13 KB
/
geant.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
require 'formula'
class Geant < Formula
homepage 'http://geant4.cern.ch'
url 'http://geant4.cern.ch/support/source/geant4.10.00.tar.gz'
sha1 'cd91d0b50aab119c85a05c7a44b6fac9168af02d'
option 'with-g3tog4', 'Use G3toG4 Library'
option 'with-gdml', 'Use GDML'
option 'with-notimeout', 'Set notimeout in installing data'
depends_on 'cmake' => :build
depends_on :x11
depends_on 'clhep'
depends_on 'qt' => :optional
depends_on 'xerces-c' if build.with? 'gdml'
def install
mkdir 'geant-build' do
args = %W[
../
-DGEANT4_INSTALL_DATA=ON
-DGEANT4_USE_OPENGL_X11=ON
-DGEANT4_USE_RAYTRACER_X11=ON
-DGEANT4_BUILD_EXAMPLE=ON
-DGEANT4_USE_SYSTEM_CLHEP=ON
]
args << '-DGEANT4_INSTALL_DATA_TIMEOUT=86400' if build.with? 'notimeout'
args << '-DGEANT4_USE_QT=ON' if build.with? 'qt'
args << '-DGEANT4_USE_G3TOG4=ON' if build.with? 'g3tog4'
args << '-DGEANT4_USE_GDML=ON' if build.with? 'gdml'
args.concat(std_cmake_args)
system "cmake", *args
system "make install"
end
end
end