arangodb 3.0.2

Closes #2576.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
ArangoDB Release BOT 2016-07-01 21:23:26 +02:00 committed by ilovezfs
parent ddacbe3ab0
commit 060b458d4b

View file

@ -1,8 +1,9 @@
class Arangodb < Formula
desc "Universal open-source database with a flexible data model"
desc "The Multi-Model NoSQL Database."
homepage "https://www.arangodb.com/"
url "https://www.arangodb.com/repositories/Source/ArangoDB-2.8.9.tar.gz"
sha256 "cff21ca654056bed08781c5e462966f5f15acec7b6522191d286dee3339e327e"
url "https://www.arangodb.com/repositories/Source/ArangoDB-3.0.2.tar.gz"
sha256 "04c00d58d7e63137ccb7d0a73112aa01e34e08c98b3c82c62ef7987f0d214ac2"
head "https://github.com/arangodb/arangodb.git", :branch => "unstable"
bottle do
revision 1
@ -11,11 +12,7 @@ class Arangodb < Formula
sha256 "60d59e09f4a440cffeb077f1de14784519223e6f25ccaaf6df692dc63fd6cac8" => :mavericks
end
head do
url "https://github.com/arangodb/arangodb.git", :branch => "unstable"
depends_on "cmake" => :build
end
depends_on "go" => :build
depends_on "openssl"
@ -26,66 +23,82 @@ class Arangodb < Formula
cause "Fails with compile errors"
end
def install
ENV.libcxx
if build.head?
mkdir "arangodb-build" do
system "cmake", "..", "-DHOMEBREW=On", "-DUSE_OPTIMIZE_FOR_ARCHITECTURE=Off", "-DASM_OPTIMIZATIONS=Off", "-DETCDIR=#{prefix}/etc", "-DVARDIR=#{var}", *std_cmake_args
system "make", "install"
resource "arangodb2" do
url "https://www.arangodb.com/repositories/Source/ArangoDB-2.8.10.tar.gz"
sha256 "3a455e9d6093739660ad79bd3369652db79f3dabd9ae02faca1b014c9aa220f4"
end
else
# clang on 10.8 will still try to build against libstdc++,
# which fails because it doesn't have the C++0x features
# arangodb requires.
resource "upgrade" do
url "https://www.arangodb.com/repositories/Source/upgrade3-1.0.0.tar.gz"
sha256 "965f899685e420530bb3c68ada903c815ebd0aa55e477d6949abba9506574011"
end
def install
ENV.cxx11
(libexec/"arangodb2/bin").install resource("upgrade")
resource("arangodb2").stage do
ENV.cxx11
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--prefix=#{libexec}/arangodb2
--disable-relative
--datadir=#{share}
--localstatedir=#{var}
--program-suffix=-2.8
]
args << "--program-suffix=-unstable" if build.head?
if ENV.compiler != :clang
ENV.append "LDFLAGS", "-static-libgcc -static-libstdc++"
if ENV.compiler == "gcc-6"
ENV.append "CXXFLAGS", "-O2 -g -fno-delete-null-pointer-checks"
inreplace "3rdParty/Makefile.v8", "CXXFLAGS=\"", "CXXFLAGS=\"-fno-delete-null-pointer-checks "
end
system "./configure", *args
system "make", "install"
end
mkdir "build" do
args = std_cmake_args + %W[
-DHOMEBREW=ON
-DUSE_OPTIMIZE_FOR_ARCHITECTURE=OFF
-DASM_OPTIMIZATIONS=OFF
-DETCDIR=#{etc}
-DVARDIR=#{var}
]
if ENV.compiler == "gcc-6"
ENV.append "V8_CXXFLAGS", "-O3 -g -fno-delete-null-pointer-checks"
end
system "cmake", "..", *args
system "make", "V=1", "Verbose=1", "VERBOSE=1", "install"
end
end
# moving the "if" inside post_install does not work
if build.head?
def post_install
(var/"lib/arangodb3").mkpath
(var/"log/arangodb3").mkpath
end
else
def post_install
(var/"arangodb").mkpath
(var/"log/arangodb").mkpath
system "#{sbin}/arangod", "--upgrade"
end
args = %W[
#{libexec}/arangodb2
#{var}/lib/arangodb
#{opt_prefix}
#{var}/lib/arangodb3
]
system libexec/"arangodb2/bin/upgrade.sh", *args
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
The database format between ArangoDB 2.x and ArangoDB 3.x has
been changed, please checkout
https://docs.arangodb.com/3.0/Manual/Administration/Upgrading/index.html
if build.head?
s += <<-EOS.undent
A default password has been set. You can change it by executing
#{sbin}/arango-secure-installation
An empty password has been set. Please change it by executing
#{opt_sbin}/arango-secure-installation
EOS
end
s
end
@ -101,12 +114,8 @@ class Arangodb < Formula
<true/>
<key>Label</key>
<string>#{plist_name}</string>
<key>ProgramArguments</key>
<array>
<key>Program</key>
<string>#{opt_sbin}/arangod</string>
<string>-c</string>
<string>#{etc}/arangodb/arangod.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
@ -115,6 +124,8 @@ class Arangodb < Formula
end
test do
assert_equal "it works!\n", shell_output("#{bin}/arangosh --javascript.execute-string \"require('@arangodb').print('it works!')\"")
testcase = "require('@arangodb').print('it works!')"
output = shell_output("#{bin}/arangosh --server.password \"\" --javascript.execute-string \"#{testcase}\"")
assert_equal "it works!", output.chomp
end
end