forked from ahmadia/homebrew-science
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ckon.rb
95 lines (91 loc) · 3.34 KB
/
ckon.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
class Ckon < Formula
desc "C++ tool for data analyses in the CERN ROOT framework"
homepage "https://tschaume.github.io/ckon/"
url "https://github.com/tschaume/ckon/archive/v0.7.1.tar.gz"
sha256 "4cc8bde10430e21520aed4b7ac5f6d96a80b8a91014760997f9a7039103a7e0d"
revision 2
head "https://github.com/tschaume/ckon.git"
bottle do
cellar :any
sha256 "e2464bbde400dd6de4216fb69c0768a2baeea6191542d2bef875b4532314d8af" => :el_capitan
sha256 "f2fc9c6438725ffeeebee3fe8de52faff8edad71c43da0a3068f459053ffddf9" => :yosemite
sha256 "3e08681ba64857a892c80f4a9913396871c8c4d48d3bb54dc6282d3326ffdc7a" => :mavericks
end
depends_on "boost"
depends_on "curl"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
def install
system "./autogen.sh"
autoreconf_args = ["-v", "--force", "--install", "-Wall"]
system "autoreconf", *autoreconf_args
boostopts = [
"--with-boost", "--with-boost-filesystem",
"--with-boost-system", "--with-boost-regex",
"--with-boost-program-options"
]
system "./configure", "--prefix=#{prefix}", *boostopts
system "make", "install"
end
test do
system "#{bin}/ckon", "--version"
(testpath/"ckon.cfg").write <<-EOS.undent
suffix=0
yaml=1
[ckon]
src_dir=StRoot
prog_subdir=programs
build_dir=build
install_dir=build
exclSuffix=""
NoRootCint="BesCocktail"
cppflags="-Wall"
boost="system filesystem program_options"
[ldadd]
cbes=-lMathMore
EOS
(testpath/"ckonignore").write <<-EOS.undent
macros
EOS
(testpath/"ckon.out").write <<-EOS.undent
found ignore string macros in StRoot/BesCocktail/macros
found ignore string macros in StRoot/BesCocktail/macros/bingchu
"StRoot/BesCocktail"
found ignore string macros in StRoot/BesCocktail/macros
found ignore string macros in StRoot/BesCocktail/macros
Processing file "StRoot/BesCocktail/Analysis.h"
class "Analysis" found at: 302
Processing file "StRoot/BesCocktail/CmdLine.h"
class "CmdLine" found at: 255
Processing file "StRoot/BesCocktail/Database.h"
class "DatabaseManager" found at: 1864
Processing file "StRoot/BesCocktail/Functions.h"
class "Functions" found at: 310
Processing file "StRoot/BesCocktail/Simulation.h"
class "Simulation" found at: 329
Processing file "StRoot/BesCocktail/Utils.h"
class "Utils" found at: 168
Processing file "StRoot/BesCocktail/Analysis.h"
Processing file "StRoot/BesCocktail/CmdLine.h"
Processing file "StRoot/BesCocktail/Database.h"
namespace "YAML" found at: 756
Processing file "StRoot/BesCocktail/Functions.h"
Processing file "StRoot/BesCocktail/Simulation.h"
Processing file "StRoot/BesCocktail/Utils.h"
core_lib_string: lib/libMyCollection.la
core_lib_string: lib/libMyCollection.la
1 sub-directories processed.
EOS
cd testpath
mkdir "StRoot"
system "git", "clone", "https://github.com/tschaume/BesCocktail.git", "StRoot/BesCocktail"
cd("StRoot/BesCocktail") { system "git", "checkout", "-q", "28446981a89cb851c43536200cc21310628aa555" }
result = File.open(testpath/"ckon.out").read
require "open3"
Open3.popen3("#{bin}/ckon", "-v", "dry") do |_, stdout, _|
assert_equal result, stdout.read
end
system "#{bin}/ckon", "clean"
end
end