forked from keitheis/homebrew-dupes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ncurses.rb
83 lines (70 loc) · 2.54 KB
/
ncurses.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
require 'formula'
class Ncurses < Formula
homepage 'http://www.gnu.org/s/ncurses/'
url 'http://ftpmirror.gnu.org/ncurses/ncurses-5.9.tar.gz'
mirror 'http://ftp.gnu.org/gnu/ncurses/ncurses-5.9.tar.gz'
sha1 '3e042e5f2c7223bffdaac9646a533b8c758b65b5'
keg_only :provided_by_osx
option :universal
# Fix building C++ bindings with clang
patch :p0 do
url "https://trac.macports.org/export/103963/trunk/dports/devel/ncurses/files/constructor_types.diff"
sha1 "60f3e64c7793381307e2a3849df7ae282e46c36e"
end
# Stop using obsolete -no-cpp-precomp flag, which breaks FSF GCC
# Reported upstream by email
patch :DATA
def install
ENV.universal_binary if build.universal?
system "./configure", "--disable-debug",
"--prefix=#{prefix}",
"--mandir=#{man}",
"--with-shared",
"--enable-widec",
"--with-manpage-format=normal",
"--enable-symlinks"
system "make"
system "make install"
make_libncurses_symlinks
end
def make_libncurses_symlinks
major = version.to_s.split(".")[0]
cd lib do
%w{form menu ncurses panel}.each do |name|
ln_s "lib#{name}w.#{major}.dylib", "lib#{name}.dylib"
ln_s "lib#{name}w.#{major}.dylib", "lib#{name}.#{major}.dylib"
ln_s "lib#{name}w.a", "lib#{name}.a"
ln_s "lib#{name}w_g.a", "lib#{name}_g.a"
end
ln_s "libncurses++w.a", "libncurses++.a"
end
cd bin do
ln_s "ncursesw#{major}-config", "ncurses#{major}-config"
end
end
end
__END__
diff --git a/Ada95/configure b/Ada95/configure
index 4db6f1f..e82bb4b 100755
--- a/Ada95/configure
+++ b/Ada95/configure
@@ -7460,7 +7460,6 @@ CF_EOF
chmod +x mk_shared_lib.sh
;;
darwin*) #(vi
- EXTRA_CFLAGS="-no-cpp-precomp"
CC_SHARED_OPTS="-dynamic"
MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
diff --git a/configure b/configure
index 639b790..25d69b3 100755
--- a/configure
+++ b/configure
@@ -5584,7 +5584,6 @@ CF_EOF
chmod +x mk_shared_lib.sh
;;
darwin*) #(vi
- EXTRA_CFLAGS="-no-cpp-precomp"
CC_SHARED_OPTS="-dynamic"
MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@'
test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi