forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tk.rb
42 lines (34 loc) · 1.21 KB
/
tk.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
require 'formula'
class Tk < Formula
homepage 'http://www.tcl.tk/'
url 'http://sourceforge.net/projects/tcl/files/Tcl/8.5.9/tk8.5.9-src.tar.gz'
md5 '7cdeb9feb61593f58a0ae61f2497580e'
version '8.5.9'
# must use a Homebrew-built Tcl since versions must match
depends_on 'tcl'
def options
[['--enable-threads', 'Build with multithreading support'],
['--enable-aqua', 'Build with Aqua support']]
end
def install
args = ["--prefix=#{prefix}",
"--mandir=#{man}",
"--with-tcl=#{HOMEBREW_PREFIX}/lib"]
args << "--enable-threads" if ARGV.include? "--enable-threads"
args << "--enable-aqua" if ARGV.include? "--enable-aqua"
args << "--enable-64bit" if MacOS.prefer_64_bit?
cd 'unix' do
# required to build Aqua support
inreplace 'Makefile.in' do |s|
s.change_make_var! "REZ_SWITCHES", "@REZ_FLAGS@ -i $(GENERIC_DIR) " +
"-i $(TCL_GENERIC_DIR) -i #{HOMEBREW_PREFIX}/include"
end
# so we can find the necessary Tcl headers
ENV.append 'CFLAGS', "-I#{HOMEBREW_PREFIX}/include"
system "./configure", *args
system "make"
system "make install"
ln_s bin+'wish8.5', bin+'wish'
end
end
end