cayley 0.7.7

fix

Closes #45360.

Signed-off-by: Rui Chen <rchen@meetup.com>
This commit is contained in:
Rui Chen 2019-10-15 10:13:14 -04:00
parent 2a83d48980
commit 12d539155a

View file

@ -1,9 +1,9 @@
class Cayley < Formula
desc "Graph database inspired by Freebase and Knowledge Graph"
homepage "https://github.com/cayleygraph/cayley"
url "https://github.com/cayleygraph/cayley/archive/v0.7.5.tar.gz"
sha256 "4fcc8bf44f775dbbbd6146713f6fbdc80f2d88e2e8b93767f62eb5d635a56739"
head "https://github.com/google/cayley.git"
url "https://github.com/cayleygraph/cayley.git",
:tag => "v0.7.7",
:revision => "dcf764fef381f19ee49fad186b4e00024709f148"
bottle do
cellar :any_skip_relocation
@ -13,24 +13,29 @@ class Cayley < Formula
end
depends_on "bazaar" => :build
depends_on "dep" => :build
depends_on "go" => :build
depends_on "mercurial" => :build
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/cayleygraph/cayley").install buildpath.children
cd "src/github.com/cayleygraph/cayley" do
system "dep", "ensure", "-vendor-only"
system "go", "build", "-o", bin/"cayley", "-ldflags",
"-X main.Version=#{version}", ".../cmd/cayley"
dir = buildpath/"src/github.com/cayleygraph/cayley"
dir.install buildpath.children
cd dir do
commit = Utils.popen_read("git rev-parse --short HEAD").chomp
ldflags = %W[
-s -w
-X github.com/cayleygraph/cayley/version.Version=#{version}
-X github.com/cayleygraph/cayley/version.GitHash=#{commit}
]
system "go", "build", "-o", bin/"cayley", "-ldflags", ldflags.join(" "), ".../cmd/cayley"
inreplace "cayley_example.yml", "./cayley.db", var/"cayley/cayley.db"
etc.install "cayley_example.yml" => "cayley.yml"
(pkgshare/"assets").install "docs", "static", "templates"
# Install samples
system "gzip", "-d", "data/30kmoviedata.nq.gz"
(pkgshare/"samples").install "data/testdata.nq", "data/30kmoviedata.nq"
@ -46,7 +51,7 @@ class Cayley < Formula
end
end
plist_options :manual => "cayley http --assets=#{HOMEBREW_PREFIX}/share/cayley/assets --config=#{HOMEBREW_PREFIX}/etc/cayley.conf"
plist_options :manual => "cayley http --config=#{HOMEBREW_PREFIX}/etc/cayley.conf"
def plist; <<~EOS
<?xml version="1.0" encoding="UTF-8"?>
@ -64,7 +69,6 @@ class Cayley < Formula
<array>
<string>#{opt_bin}/cayley</string>
<string>http</string>
<string>--assets=#{opt_pkgshare}/assets</string>
<string>--config=#{etc}/cayley.conf</string>
</array>
<key>RunAtLoad</key>