joshua: fix new Website, addition of Chinese language pack and unpacking of language packs

Closes #629.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
This commit is contained in:
Lewis John McGibbney 2016-04-26 09:37:45 -07:00 committed by Andrew Janke
parent f1305bde50
commit 8f619a8ed8

View file

@ -1,9 +1,9 @@
class Joshua < Formula
desc "Statistical machine translation decoder."
homepage "http://joshua-decoder.org/"
homepage "https://joshua.incubator.apache.org/"
url "https://cs.jhu.edu/~post/files/joshua-6.0.5.tgz"
sha256 "972116a74468389e89da018dd985f1ed1005b92401907881a14bdcc1be8bd98a"
head "https://github.com/joshua-decoder/joshua.git"
head "https://git-wip-us.apache.org/repos/asf/incubator-joshua.git"
bottle do
cellar :any_skip_relocation
@ -14,7 +14,8 @@ class Joshua < Formula
end
option "with-es-en-phrase-pack", "Build with SpanishEnglish phrase-based model [1.9 GB]."
option "with-ar-en-phrase-pack", "Build with ArabicEnglish phrase-based model [2.4 GB]."
option "with-ar-en-phrase-pack", "Build with ArabicEnglish phrase-based model [2.1 GB]."
option "with-zh-en-hiero-pack", "Build with Chinese->English hiero-based model [2.4 GB]."
depends_on :java
depends_on "ant" => :build
@ -32,6 +33,11 @@ class Joshua < Formula
sha256 "2b6665b58b11e4c25d48191d3d5b62b7c591851a9767b14f9ccebf1951fddf90"
end
resource "zh-en-hiero-pack" do
url "https://cs.jhu.edu/~post/language-packs/zh-en-hiero-2016-01-13.tgz"
sha256 "ded27fe639d019c91cfefce513abb762ad41483962b957474573e2042c786d46"
end
def install
rm Dir["lib/*.{gr,tar.gz}"]
rm_rf "lib/README"
@ -40,10 +46,19 @@ class Joshua < Formula
system "ant"
end
if build.with? "es-en-phrase-pack"
resource("es-en-phrase-pack").stage { share.install "language-pack-es-en-phrase-2015-03-06", share/"joshualanguagepacks" }
resource("es-en-phrase-pack").stage do
(libexec/"language-pack-es-en-phrase-2015-03-06").install Dir["*"]
end
end
if build.with? "ar-en-phrase-pack"
resource("ar-en-phrase-pack").stage { share.install "language-pack-ar-en-phrase-2015-03-18", share/"joshualanguagepacks" }
resource("ar-en-phrase-pack").stage do
(libexec/"language-pack-ar-en-phrase-2015-03-18").install Dir["*"]
end
end
if build.with? "zh-en-hiero-pack"
resource("zh-en-hiero-pack").stage do
(libexec/"zh-en-hiero-pack-2016-01").install Dir["*"]
end
end
libexec.install Dir["*"]
bin.install_symlink Dir["#{libexec}/bin/*"]