homebrew-core/Formula/goolabs.rb

52 lines
1.8 KiB
Ruby
Raw Normal View History

class Goolabs < Formula
desc "Command-line tool for morphologically analyzing Japanese language"
homepage "https://pypi.python.org/pypi/goolabs"
url "https://pypi.python.org/packages/source/g/goolabs/goolabs-0.2.2.tar.gz"
sha256 "9078bf8d26b69860cf6b9f1e6143014a596ee122743130b082ba2daea8a10e26"
2015-02-19 15:50:29 +00:00
bottle do
cellar :any
2015-03-14 22:16:45 +00:00
sha256 "b66b183f0a8ac370648b1c1a9a060be119b2f4dcd2579c9f7adb50c9467a3249" => :yosemite
sha256 "bd2d16c7d34b8d923e6d68356158e8a46b5266463a0e30ad557a133960efd0ff" => :mavericks
sha256 "6afbdf9a7c5caacc02463f7e8e8688359912112118ed8baf23dc38c3845b0c90" => :mountain_lion
2015-02-19 15:50:29 +00:00
end
depends_on :python if MacOS.version <= :snow_leopard
resource "six" do
url "https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz"
sha256 "e24052411fc4fbd1f672635537c3fc2330d9481b18c0317695b46259512c91d5"
end
resource "click" do
url "https://pypi.python.org/packages/source/c/click/click-4.0.tar.gz"
sha256 "f49e03611f5f2557788ceeb80710b1c67110f97c5e6740b97edf70245eea2409"
end
resource "requests" do
url "https://pypi.python.org/packages/source/r/requests/requests-2.7.0.tar.gz"
sha256 "398a3db6d61899d25fd4a06c6ca12051b0ce171d705decd7ed5511517b4bb93d"
end
def install
ENV["PYTHONPATH"] = libexec/"vendor/lib/python2.7/site-packages"
ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
res = %w[six click requests]
res.each do |r|
resource(r).stage do
system "python", *Language::Python.setup_install_args(libexec/"vendor")
end
end
system "python", *Language::Python.setup_install_args(libexec)
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])
end
test do
assert_match "Usage: goolabs morph", shell_output("#{bin}/goolabs morph test 2>&1", 2)
end
end