forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
expect.rb
59 lines (49 loc) · 2.21 KB
/
expect.rb
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
class Expect < Formula
desc "Program that can automate interactive applications"
homepage "http://expect.sourceforge.net"
url "https://downloads.sourceforge.net/project/expect/Expect/5.45/expect5.45.tar.gz"
sha256 "b28dca90428a3b30e650525cdc16255d76bb6ccd65d448be53e620d95d5cc040"
bottle do
revision 1
sha256 "dafd62a44b446d75f43d5d331eb627af53f28539835153101990a248174c48dc" => :el_capitan
sha256 "160fc63e9cd6de38ef22c8363fa9f317069827df656e0ac012c9a93f9c921feb" => :yosemite
sha256 "024522f2635d4f6bc2e9d3899932e4313c626bc11caf2ffba3141c48caf006ac" => :mavericks
end
option "with-threads", "Build with multithreading support"
option "with-brewed-tk", "Use Homebrew's Tk (has optional Cocoa and threads support)"
deprecated_option "enable-threads" => "with-threads"
depends_on "homebrew/dupes/tcl-tk" if build.with? "brewed-tk"
# Autotools are introduced here to regenerate configure script. Remove
# if the patch has been applied in newer releases.
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
# Fix Tcl private header detection.
# https://sourceforge.net/p/expect/patches/17/
patch do
url "https://sourceforge.net/p/expect/patches/17/attachment/expect_detect_tcl_private_header_os_x_mountain_lion.patch"
sha256 "bfce1856da9aaf5bcb89673da3be4f96611658cb05d5fbbba3f5287e359ff686"
end
def install
args = ["--prefix=#{prefix}", "--exec-prefix=#{prefix}", "--mandir=#{man}"]
args << "--enable-shared"
args << "--enable-threads" if build.with? "threads"
args << "--enable-64bit" if MacOS.prefer_64_bit?
if build.with? "brewed-tk"
args << "--with-tcl=#{Formula["tcl-tk"].opt_prefix}/lib"
else
ENV.prepend "CFLAGS", "-I#{MacOS.sdk_path}/System/Library/Frameworks/Tcl.framework/Versions/8.5/Headers/tcl-private"
args << "--with-tcl=#{MacOS.sdk_path}/usr/lib"
end
# Regenerate configure script. Remove after patch applied in newer
# releases.
system "autoreconf", "--force", "--install", "--verbose"
system "./configure", *args
system "make"
system "make", "install"
lib.install_symlink Dir[lib/"expect*/libexpect*"]
end
test do
system "#{bin}/mkpasswd"
end
end