blob: 26d6bffbba97290e189f32c65b2adceba3d8a00a (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
 | require "formula"
class MobileShell < Formula
  homepage "http://mosh.mit.edu/"
  url "https://mosh.mit.edu/mosh-1.2.4.tar.gz"
  sha256 "e74d0d323226046e402dd469a176075fc2013b69b0e67cea49762c957175df46"
  revision 2
  head do
    url "https://github.com/keithw/mosh.git"
    depends_on "autoconf" => :build
    depends_on "automake" => :build
  end
  option "with-check", "Run build-time tests"
  depends_on "openssl"
  depends_on "pkg-config" => :build
  depends_on "protobuf"
  def install
    system "./autogen.sh" if build.head?
    # teach mosh to locate mosh-client without referring
    # PATH to support launching outside shell e.g. via launcher
    inreplace "scripts/mosh", "'mosh-client", "\'#{bin}/mosh-client"
    # Upstream prefers O2:
    # https://github.com/keithw/mosh/blob/master/README.md
    ENV.O2
    system "./configure", "--prefix=#{prefix}", "--enable-completion"
    system "make", "check" if build.with? "check"
    system "make", "install"
  end
  test do
    ENV["TERM"]="xterm"
    system "#{bin}/mosh-client", "-c"
  end
end
 |