forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
arangodb2.rb
89 lines (74 loc) · 2.48 KB
/
arangodb2.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
class Arangodb2 < Formula
desc "The Multi-Model NoSQL Database (Version 2)."
homepage "https://www.arangodb.com/"
url "https://www.arangodb.com/repositories/Source/ArangoDB-2.8.11.tar.gz"
sha256 "1379871bc4209d0c9c3243e1ac6072bd8f3d541c488089ed29c8b285ebacd1e1"
bottle do
sha256 "63855f4e73dfb190fa0853e2f0f94bf7773660e6d328dac55663d922bae75ce7" => :el_capitan
sha256 "dea8e983e16c7bd814feff1e6d4b66880c8bd491c3e7c0f39678774fa28cc900" => :yosemite
sha256 "da10623adf5c65ea1306ac827163d2644b37da3baa60d24be711a0a03c9ab5ae" => :mavericks
end
depends_on "gcc" if MacOS.version == :mavericks
depends_on "go" => :build
depends_on "openssl"
conflicts_with "arangodb", :because => "Differing versions of the same formula"
needs :cxx11
fails_with :clang do
build 600
cause "Fails with compile errors"
end
def install
ENV.libcxx
# clang on 10.8 will still try to build against libstdc++,
# which fails because it doesn't have the C++0x features
# arangodb requires.
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--disable-relative
--datadir=#{share}
--localstatedir=#{var}
--program-suffix=-2.8
]
system "./configure", *args
system "make", "install"
end
def post_install
(var/"lib/arangodb").mkpath
(var/"log/arangodb").mkpath
system "#{sbin}/arangod-2.8", "--upgrade"
end
def caveats
s = <<-EOS.undent
Please note that clang and/or its standard library 7.0.0 has a severe
performance issue. Please consider using '--cc=gcc-5' when installing
if you are running on such a system.
EOS
s
end
plist_options :manual => "#{HOMEBREW_PREFIX}/opt/arangodb2/sbin/arangod-2.8"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<string>#{opt_sbin}/arangod-2.8</string>
<string>-c</string>
<string>#{etc}/arangodb/arangod-2.8.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
EOS
end
test do
assert_equal "it works!\n", shell_output("#{bin}/arangosh-2.8 --javascript.execute-string \"require('@arangodb').print('it works!')\"")
end
end