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