forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexpect.rb
45 lines (36 loc) · 1.52 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
require 'formula'
class Expect < Formula
homepage 'http://expect.sourceforge.net'
url 'https://downloads.sourceforge.net/project/expect/Expect/5.45/expect5.45.tar.gz'
sha1 'e634992cab35b7c6931e1f21fbb8f74d464bd496'
option 'enable-threads', 'Build with multithreading support'
option 'with-brewed-tk', "Use Homebrew's Tk (has optional Cocoa and threads support)"
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"
sha1 "396c2672ec50d64f83002b950ca48420363b942f"
end
def install
args = ["--prefix=#{prefix}", "--exec-prefix=#{prefix}", "--mandir=#{man}"]
args << "--enable-shared"
args << "--enable-threads" if build.include? "enable-threads"
args << "--enable-64bit" if MacOS.prefer_64_bit?
args << "--with-tcl=#{Formula["tcl-tk"].opt_prefix}/lib" if build.with? 'brewed-tk'
# Regenerate configure script. Remove after patch applied in newer
# releases.
system "autoreconf", "--force", "--install", "--verbose"
system "./configure", *args
system "make"
system "make install"
end
test do
system "#{bin}/mkpasswd"
end
end