1 |
kolmodin 09/04/19 14:54:35 |
2 |
|
3 |
Added: ghc-6.10.2-readline.patch |
4 |
Log: |
5 |
Version bump dev-lang/ghc to 6.10.2, currently masked for testing. |
6 |
(Portage version: 2.1.6.7/cvs/Linux x86_64) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 dev-lang/ghc/files/ghc-6.10.2-readline.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/ghc/files/ghc-6.10.2-readline.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-lang/ghc/files/ghc-6.10.2-readline.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: ghc-6.10.2-readline.patch |
15 |
=================================================================== |
16 |
Lennart Kolmodin <kolmodin@g.o> 2009 |
17 |
Make GHC 6.10.2 use readline instead of editline |
18 |
|
19 |
diff -rN -u old-ghc-6.10.2/aclocal.m4 new-ghc-6.10.2/aclocal.m4 |
20 |
--- old-ghc-6.10.2/aclocal.m4 2009-04-02 22:56:21.000000000 +0200 |
21 |
+++ new-ghc-6.10.2/aclocal.m4 2009-04-02 22:56:23.000000000 +0200 |
22 |
@@ -900,18 +900,18 @@ |
23 |
fi])# FP_PROG_GHC_PKG |
24 |
|
25 |
|
26 |
-# FP_GHC_HAS_EDITLINE |
27 |
+# FP_GHC_HAS_READLINE |
28 |
# ------------------- |
29 |
-AC_DEFUN([FP_GHC_HAS_EDITLINE], |
30 |
+AC_DEFUN([FP_GHC_HAS_READLINE], |
31 |
[AC_REQUIRE([FP_PROG_GHC_PKG]) |
32 |
-AC_CACHE_CHECK([whether ghc has editline package], [fp_cv_ghc_has_editline], |
33 |
-[if "${GhcPkgCmd-ghc-pkg}" --show-package editline >/dev/null 2>&1; then |
34 |
- fp_cv_ghc_has_editline=yes |
35 |
+AC_CACHE_CHECK([whether ghc has readline package], [fp_cv_ghc_has_readline], |
36 |
+[if "${GhcPkgCmd-ghc-pkg}" describe readline >/dev/null 2>&1; then |
37 |
+ fp_cv_ghc_has_readline=yes |
38 |
else |
39 |
- fp_cv_ghc_has_editline=no |
40 |
+ fp_cv_ghc_has_readline=no |
41 |
fi]) |
42 |
-AC_SUBST([GhcHasEditline], [`echo $fp_cv_ghc_has_editline | sed 'y/yesno/YESNO/'`]) |
43 |
-])# FP_GHC_HAS_EDITLINE |
44 |
+AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/'`]) |
45 |
+])# FP_GHC_HAS_READLINE |
46 |
|
47 |
|
48 |
# FP_GCC_EXTRA_FLAGS |
49 |
diff -rN -u old-ghc-6.10.2/compiler/ghc.cabal.in new-ghc-6.10.2/compiler/ghc.cabal.in |
50 |
--- old-ghc-6.10.2/compiler/ghc.cabal.in 2009-04-02 22:56:21.000000000 +0200 |
51 |
+++ new-ghc-6.10.2/compiler/ghc.cabal.in 2009-04-02 22:56:23.000000000 +0200 |
52 |
@@ -28,8 +28,8 @@ |
53 |
Default: False |
54 |
Manual: True |
55 |
|
56 |
-Flag editline |
57 |
- Description: Use editline |
58 |
+Flag readline |
59 |
+ Description: Use readline |
60 |
Default: False |
61 |
Manual: True |
62 |
|
63 |
@@ -71,8 +71,8 @@ |
64 |
else |
65 |
Build-Depends: unix |
66 |
|
67 |
- if flag(editline) |
68 |
- Build-Depends: editline |
69 |
+ if flag(readline) |
70 |
+ Build-Depends: readline |
71 |
CPP-Options: -DUSE_EDITLINE |
72 |
|
73 |
GHC-Options: -Wall -fno-warn-name-shadowing -fno-warn-orphans |
74 |
diff -rN -u old-ghc-6.10.2/compiler/ghci/InteractiveUI.hs new-ghc-6.10.2/compiler/ghci/InteractiveUI.hs |
75 |
--- old-ghc-6.10.2/compiler/ghci/InteractiveUI.hs 2009-04-02 22:56:21.000000000 +0200 |
76 |
+++ new-ghc-6.10.2/compiler/ghci/InteractiveUI.hs 2009-04-02 22:56:23.000000000 +0200 |
77 |
@@ -66,7 +66,7 @@ |
78 |
|
79 |
#ifdef USE_EDITLINE |
80 |
import Control.Concurrent ( yield ) -- Used in readline loop |
81 |
-import System.Console.Editline.Readline as Readline |
82 |
+import System.Console.Readline as Readline |
83 |
#endif |
84 |
|
85 |
--import SystemExts |
86 |
@@ -96,6 +96,10 @@ |
87 |
|
88 |
import Data.IORef ( IORef, readIORef, writeIORef ) |
89 |
|
90 |
+#ifdef USE_EDITLINE |
91 |
+import System.Posix.Internals ( setNonBlockingFD ) |
92 |
+#endif |
93 |
+ |
94 |
----------------------------------------------------------------------------- |
95 |
|
96 |
ghciWelcomeMsg :: String |
97 |
@@ -322,10 +326,6 @@ |
98 |
when is_tty $ withReadline $ do |
99 |
Readline.initialize |
100 |
|
101 |
- withGhcAppData |
102 |
- (\dir -> Readline.readHistory (dir </> "ghci_history")) |
103 |
- (return True) |
104 |
- |
105 |
Readline.setAttemptedCompletionFunction (Just completeWord) |
106 |
--Readline.parseAndBind "set show-all-if-ambiguous 1" |
107 |
|
108 |
@@ -360,9 +360,6 @@ |
109 |
|
110 |
#ifdef USE_EDITLINE |
111 |
liftIO $ do |
112 |
- Readline.stifleHistory 100 |
113 |
- withGhcAppData (\dir -> Readline.writeHistory (dir </> "ghci_history")) |
114 |
- (return True) |
115 |
Readline.resetTerminal Nothing |
116 |
#endif |
117 |
|
118 |
@@ -634,11 +631,9 @@ |
119 |
return (Just str) |
120 |
|
121 |
withReadline :: IO a -> IO a |
122 |
-withReadline = bracket_ stopTimer startTimer |
123 |
- -- editline doesn't handle some of its system calls returning |
124 |
- -- EINTR, so our timer signal confuses it, hence we turn off |
125 |
- -- the timer signal when making calls to editline. (#2277) |
126 |
- -- If editline is ever fixed, we can remove this. |
127 |
+withReadline = flip finally (setNonBlockingFD 0) |
128 |
+ -- 1. readline sometimes puts stdin into blocking mode, |
129 |
+ -- so we need to put it back for the IO library |
130 |
|
131 |
-- These come from the RTS |
132 |
foreign import ccall unsafe startTimer :: IO () |
133 |
diff -rN -u old-ghc-6.10.2/compiler/ghci/Linker.lhs new-ghc-6.10.2/compiler/ghci/Linker.lhs |
134 |
--- old-ghc-6.10.2/compiler/ghci/Linker.lhs 2009-04-02 22:56:21.000000000 +0200 |
135 |
+++ new-ghc-6.10.2/compiler/ghci/Linker.lhs 2009-04-02 22:56:23.000000000 +0200 |
136 |
@@ -953,7 +953,7 @@ |
137 |
partOfGHCi |
138 |
| isWindowsTarget || isDarwinTarget = [] |
139 |
| otherwise = map PackageName |
140 |
- ["base", "haskell98", "template-haskell", "editline"] |
141 |
+ ["base", "haskell98", "template-haskell", "readline"] |
142 |
|
143 |
showLS :: LibrarySpec -> String |
144 |
showLS (Object nm) = "(static) " ++ nm |
145 |
diff -rN -u old-ghc-6.10.2/compiler/Makefile new-ghc-6.10.2/compiler/Makefile |
146 |
--- old-ghc-6.10.2/compiler/Makefile 2009-04-02 22:56:21.000000000 +0200 |
147 |
+++ new-ghc-6.10.2/compiler/Makefile 2009-04-02 22:56:23.000000000 +0200 |
148 |
@@ -118,15 +118,15 @@ |
149 |
CONFIGURE_FLAGS_STAGE2 += --ghc-option=-DDEBUGGER |
150 |
endif |
151 |
|
152 |
-# Enable editline if: |
153 |
-# - we're building stage 2/3, and we have built the editline package |
154 |
+# Enable readline if: |
155 |
+# - we're building stage 2/3, and we have built the readline package |
156 |
# |
157 |
-# But we don't enable editline on Windows, as Windows terminals have |
158 |
-# editline-like support builtin. |
159 |
+# But we don't enable readline on Windows, as Windows terminals have |
160 |
+# readline-like support builtin. |
161 |
# |
162 |
ifneq "$(TARGETPLATFORM)" "i386-unknown-mingw32" |
163 |
-ifeq "$(wildcard $(FPTOOLS_TOP_ABS)/libraries/editline/unbuildable)" "" |
164 |
-CONFIGURE_FLAGS_STAGE2 += --flags=editline |
165 |
+ifeq "$(wildcard $(FPTOOLS_TOP_ABS)/libraries/readline/unbuildable)" "" |
166 |
+CONFIGURE_FLAGS_STAGE2 += --flags=readline |
167 |
endif |
168 |
endif |
169 |
endif |
170 |
diff -rN -u old-ghc-6.10.2/configure.ac new-ghc-6.10.2/configure.ac |
171 |
--- old-ghc-6.10.2/configure.ac 2009-04-02 22:56:21.000000000 +0200 |
172 |
+++ new-ghc-6.10.2/configure.ac 2009-04-02 22:56:23.000000000 +0200 |
173 |
@@ -679,8 +679,8 @@ |
174 |
AC_SUBST(ghc_ge_609)dnl |
175 |
fi |
176 |
|
177 |
-# Check whether this GHC has editline installed |
178 |
-FP_GHC_HAS_EDITLINE |
179 |
+# Check whether this GHC has readline installed |
180 |
+FP_GHC_HAS_READLINE |
181 |
|
182 |
# Dummy arguments to print help for --with-editline-* arguments. |
183 |
# Those are actually passed to the editline package's configure script |
184 |
diff -rN -u old-ghc-6.10.2/libraries/ifBuildable.hs new-ghc-6.10.2/libraries/ifBuildable.hs |
185 |
--- old-ghc-6.10.2/libraries/ifBuildable.hs 2009-04-02 22:56:22.000000000 +0200 |
186 |
+++ new-ghc-6.10.2/libraries/ifBuildable.hs 2009-04-02 22:56:23.000000000 +0200 |
187 |
@@ -36,5 +36,5 @@ |
188 |
requiredLines = filter ((3 == ) . length) $ map words nonCommentLines |
189 |
requiredLibraries = [ x | 'l':'i':'b':'r':'a':'r':'i':'e':'s':'/':x |
190 |
<- map head requiredLines ] |
191 |
- return $ filter ("editline" /=) requiredLibraries |
192 |
+ return $ filter ("readline" /=) requiredLibraries |
193 |
|
194 |
diff -rN -u old-ghc-6.10.2/libraries/Makefile new-ghc-6.10.2/libraries/Makefile |
195 |
--- old-ghc-6.10.2/libraries/Makefile 2009-04-02 22:56:22.000000000 +0200 |
196 |
+++ new-ghc-6.10.2/libraries/Makefile 2009-04-02 22:56:23.000000000 +0200 |
197 |
@@ -46,7 +46,7 @@ |
198 |
ifeq "$(Windows)" "YES" |
199 |
SUBDIRS += $(wildcard Win32) |
200 |
endif |
201 |
-SUBDIRS += directory process pretty hpc template-haskell editline Cabal random haskell98 |
202 |
+SUBDIRS += directory process pretty hpc template-haskell readline Cabal random haskell98 |
203 |
|
204 |
# Set GhcBootLibs=YES from the command line to work with just the libraries |
205 |
# needed to bootstrap GHC. |
206 |
diff -rN -u old-ghc-6.10.2/Makefile new-ghc-6.10.2/Makefile |
207 |
--- old-ghc-6.10.2/Makefile 2009-04-02 22:56:21.000000000 +0200 |
208 |
+++ new-ghc-6.10.2/Makefile 2009-04-02 22:56:23.000000000 +0200 |
209 |
@@ -393,7 +393,7 @@ |
210 |
echo "HaveLibGmp = $(HaveLibGmp)" >> $(BIN_DIST_VARFILE) |
211 |
echo "GhcLibsWithUnix = $(GhcLibsWithUnix)" >> $(BIN_DIST_VARFILE) |
212 |
echo "GhcWithInterpreter = $(GhcWithInterpreter)" >> $(BIN_DIST_VARFILE) |
213 |
- echo "GhcHasEditline = $(GhcHasEditline)" >> $(BIN_DIST_VARFILE) |
214 |
+ echo "GhcHasReadline = $(GhcHasReadline)" >> $(BIN_DIST_VARFILE) |
215 |
echo "BootingFromHc = $(BootingFromHc)" >> $(BIN_DIST_VARFILE) |
216 |
echo "XMLDocWays = $(XMLDocWays)" >> $(BIN_DIST_VARFILE) |
217 |
# We won't actually use xsltproc, but we need to know if it's "" or not |
218 |
diff -rN -u old-ghc-6.10.2/mk/config.mk.in new-ghc-6.10.2/mk/config.mk.in |
219 |
--- old-ghc-6.10.2/mk/config.mk.in 2009-04-02 22:56:22.000000000 +0200 |
220 |
+++ new-ghc-6.10.2/mk/config.mk.in 2009-04-02 22:56:23.000000000 +0200 |
221 |
@@ -891,8 +891,8 @@ |
222 |
GHC = @WithGhc@ |
223 |
GhcDir = $(dir $(GHC)) |
224 |
|
225 |
-# Set to YES if $(GHC) has the editline package installed |
226 |
-GhcHasEditline = @GhcHasEditline@ |
227 |
+# Set to YES if $(GHC) has the readline package installed |
228 |
+GhcHasReadline = @GhcHasReadline@ |
229 |
|
230 |
HBC = @HBC@ |
231 |
NHC = @NHC@ |