homebrew-core/Formula/mobile-shell.rb
2016-09-26 05:14:14 -07:00

52 lines
1.8 KiB
Ruby

class MobileShell < Formula
desc "Remote terminal application"
homepage "https://mosh.org"
url "https://mosh.org/mosh-1.2.6.tar.gz"
sha256 "7e82b7fbfcc698c70f5843bb960dadb8e7bd7ac1d4d2151c9d979372ea850e85"
revision 3
bottle do
sha256 "bc1a1ce96af199e577ee7eecd75688f43aaa6bddec09a7973c487f8d4233e60f" => :sierra
sha256 "73f0c2c60aae22d886f44421034fe1e43e2c643dba10913026d9f2935b3c0ddc" => :el_capitan
sha256 "0d4e77bc71d3413788995fc3029ae29df2789ef6eed7871862a823ffeee7f12d" => :yosemite
end
head do
url "https://github.com/mobile-shell/mosh.git", :shallow => false
depends_on "autoconf" => :build
depends_on "automake" => :build
end
option "without-test", "Run build-time tests"
deprecated_option "without-check" => "without-test"
depends_on "pkg-config" => :build
depends_on "protobuf"
depends_on :perl => "5.14" if MacOS.version <= :mountain_lion
def install
# Fix for 'dyld: lazy symbol binding failed: Symbol not found: _clock_gettime' issue
# Reported 26 Sep 2016 https://github.com/mobile-shell/mosh/issues/807
if MacOS.version == "10.11" && MacOS::Xcode.installed? && MacOS::Xcode.version >= "8.0"
ENV["ac_cv_search_clock_gettime"] = "no"
end
# teach mosh to locate mosh-client without referring
# PATH to support launching outside shell e.g. via launcher
inreplace "scripts/mosh.pl", "'mosh-client", "\'#{bin}/mosh-client"
# Upstream prefers O2:
# https://github.com/keithw/mosh/blob/master/README.md
ENV.O2
system "./autogen.sh" if build.head?
system "./configure", "--prefix=#{prefix}", "--enable-completion"
system "make", "check" if build.with?("test") || build.bottle?
system "make", "install"
end
test do
system bin/"mosh-client", "-c"
end
end