aboutsummaryrefslogtreecommitdiffstats
path: root/lang
diff options
context:
space:
mode:
authorpav <pav@FreeBSD.org>2005-05-26 06:02:58 +0800
committerpav <pav@FreeBSD.org>2005-05-26 06:02:58 +0800
commit993973c282ab35565b1c441951b73d9044401a64 (patch)
treebbc8d5c4c0b4dffbc695d79b53a5b7e31db9d4f6 /lang
parentc01be30a277155a887eb1dcb916828b2212bd894 (diff)
downloadfreebsd-ports-gnome-993973c282ab35565b1c441951b73d9044401a64.tar.gz
freebsd-ports-gnome-993973c282ab35565b1c441951b73d9044401a64.tar.zst
freebsd-ports-gnome-993973c282ab35565b1c441951b73d9044401a64.zip
- Unbreak on 5.X
PR: ports/81474 Submitted by: Johan van Selst <johans@stack.nl>
Diffstat (limited to 'lang')
-rw-r--r--lang/ghc5/Makefile33
-rw-r--r--lang/ghc5/files/patch-ghc-rts-rts.conf.in6
-rw-r--r--lang/ghc5/files/patch-ghc_compiler_ghci_InteractiveUI.hs98
-rw-r--r--lang/ghc5/files/patch-ghc_compiler_ndpFlatten_Flattening.hs13
-rw-r--r--lang/ghc5/files/patch-ghc_rts_Profiling.c10
-rw-r--r--lang/ghc5/files/patch-ghc_utils_ghc-pkg_Main.hs15
-rw-r--r--lang/ghc5/files/patch-ghc_utils_hsc2hs_Main.hs109
-rw-r--r--lang/ghc5/files/patch-libraries_base_Data_List.hs11
8 files changed, 275 insertions, 20 deletions
diff --git a/lang/ghc5/Makefile b/lang/ghc5/Makefile
index 4dfccaa8b908..1948b838b23c 100644
--- a/lang/ghc5/Makefile
+++ b/lang/ghc5/Makefile
@@ -1,8 +1,9 @@
-# New ports collection makefile for: ghc Date created:
-# 28 August 1999 Whom: Simon Marlow
-# <simonmar@microsoft.com>
+# New ports collection makefile for: ghc
+# Date created: 28 August 1999
+# Whom: Simon Marlow <simonmar@microsoft.com>
#
# $FreeBSD$
+#
PORTNAME= ghc5
PORTVERSION= 5.04.3
@@ -11,6 +12,11 @@ CATEGORIES= lang haskell
MASTER_SITES= http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \
http://www.haskell.org/ghc/dist/${PORTVERSION}/FreeBSD/:boot
+MAINTAINER= simonmar@microsoft.com
+COMMENT= A Compiler for the functional language Haskell
+
+LIB_DEPENDS= gmp.6:${PORTSDIR}/math/libgmp4
+
ONLY_FOR_ARCHS= i386
SRC_DIST= ghc-${PORTVERSION}-src${EXTRACT_SUFX}:source
@@ -18,11 +24,8 @@ BOOT_DIST= ghc-${PORTVERSION}-i386-unknown-freebsd-boot${EXTRACT_SUFX}:boot
BOOT_DIST5= ghc-${PORTVERSION}-i386-unknown-freebsd5-boot${EXTRACT_SUFX}:boot
USE_BZIP2= yes
-.include <bsd.port.pre.mk>
-.if ${OSVERSION} >= 502126
-BROKEN= "Does not compile on FreeBSD >= 5.x"
-.endif
+.include <bsd.port.pre.mk>
DISTFILES= ${SRC_DIST}
@@ -30,20 +33,16 @@ DISTFILES= ${SRC_DIST}
DISTFILES+= ${BOOT_DIST}
.else
DISTFILES+= ${BOOT_DIST5}
+BUILD_DEPENDS+= ${LOCALBASE}/lib/compat/libreadline.so.4:${PORTSDIR}/misc/compat4x
.endif
-LIB_DEPENDS= gmp.6:${PORTSDIR}/math/libgmp4
-
-MAINTAINER= simonmar@microsoft.com
-COMMENT= A Compiler for the functional language Haskell
-
WRKSRC= ${WRKDIR}/ghc-${PORTVERSION}
USE_PERL5= yes
USE_REINPLACE= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
-PLIST_SUB= GHC_VERSION=${PORTVERSION}
+PLIST_SUB= GHC_VERSION=${PORTVERSION}
.if defined(WITHOUT_PROFILE)
PLIST_SUB+= PROFILE="@comment "
.else
@@ -55,7 +54,7 @@ PLIST_SUB+= PROFILE=""
BOOT_DIR= ${WRKDIR}/ghc-${PORTVERSION}-boot
BOOT_GHC= ${BOOT_DIR}/bin/i386-unknown-freebsd/ghc-${PORTVERSION}
-CONFIGURE_ARGS= --with-ghc=${BOOT_GHC} --with-gcc=${CC}
+CONFIGURE_ARGS= --with-ghc=${BOOT_GHC} --with-gcc=${CC}
# specifying CONFIGURE_TARGET doesn't work for some reason.
CONFIGURE_TARGET=
# libgmp:
@@ -63,14 +62,14 @@ CONFIGURE_ENV+= CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
# override TMPDIR because /tmp often doesn't have enough space
# to build some of the larger libraries.
-TMPDIR = ${WRKSRC}/tmp
-MAKE_ENV += TMPDIR=${TMPDIR}
+TMPDIR= ${WRKSRC}/tmp
+MAKE_ENV+= TMPDIR=${TMPDIR}
pre-everything::
.if !defined(WITHOUT_PROFILE)
@${ECHO_CMD} "To build GHC without profiling libraries,"
@${ECHO_CMD} "hit Ctrl-C now and restart with 'make"
- @$(ECHO_CMD) "WITHOUT_PROFILE=YES'."
+ @${ECHO_CMD} "WITHOUT_PROFILE=YES'."
.else
@${ECHO_CMD} "Building GHC without profiling libraries."
.endif
diff --git a/lang/ghc5/files/patch-ghc-rts-rts.conf.in b/lang/ghc5/files/patch-ghc-rts-rts.conf.in
index d9679728b591..713e9d21f733 100644
--- a/lang/ghc5/files/patch-ghc-rts-rts.conf.in
+++ b/lang/ghc5/files/patch-ghc-rts-rts.conf.in
@@ -1,10 +1,10 @@
---- ghc/rts/rts.conf.in.orig Thu Dec 11 15:53:05 2003
-+++ ghc/rts/rts.conf.in Thu Dec 11 16:08:54 2003
+--- ghc/rts/rts.conf.in.orig Mon Feb 10 11:18:31 2003
++++ ghc/rts/rts.conf.in Tue May 24 21:03:38 2005
@@ -134,6 +134,7 @@
, "-u", "GHCziWeak_runFinalizzerBatch_closure"
, "-u", "__stginit_Prelude"
#endif
-+ , "-L%%LOCALBASE%%/lib"
++ , "-L/usr/local/lib"
]
#ifdef HAVE_FRAMEWORK_HASKELLSUPPORT
, extra_frameworks = [ "HaskellSupport" ]
diff --git a/lang/ghc5/files/patch-ghc_compiler_ghci_InteractiveUI.hs b/lang/ghc5/files/patch-ghc_compiler_ghci_InteractiveUI.hs
new file mode 100644
index 000000000000..27694344f8f7
--- /dev/null
+++ b/lang/ghc5/files/patch-ghc_compiler_ghci_InteractiveUI.hs
@@ -0,0 +1,98 @@
+--- ghc/compiler/ghci/InteractiveUI.hs.orig Tue May 24 23:10:08 2005
++++ ghc/compiler/ghci/InteractiveUI.hs Tue May 24 23:11:37 2005
+@@ -80,12 +80,12 @@ import GHC.Posix ( setNonBlockingFD )
+
+ -----------------------------------------------------------------------------
+
+-ghciWelcomeMsg = "\
+-\ ___ ___ _\n\
+-\ / _ \\ /\\ /\\/ __(_)\n\
+-\ / /_\\// /_/ / / | | GHC Interactive, version " ++ cProjectVersion ++ ", for Haskell 98.\n\
+-\/ /_\\\\/ __ / /___| | http://www.haskell.org/ghc/\n\
+-\\\____/\\/ /_/\\____/|_| Type :? for help.\n"
++ghciWelcomeMsg = ""++
++ " ___ ___ _\n"++
++ " / _ \\ /\\ /\\/ __(_)\n"++
++ " / /_\\// /_/ / / | | GHC Interactive, version " ++ cProjectVersion ++ ", for Haskell 98.\n"++
++ "/ /_\\\\/ __ / /___| | http://www.haskell.org/ghc/\n"++
++ "\\____/\\/ /_/\\____/|_| Type :? for help.\n"
+
+ GLOBAL_VAR(commands, builtin_commands, [(String, String -> GHCi Bool)])
+
+@@ -118,41 +118,41 @@ keepGoingPaths a str = a (toArgs str) >>
+ shortHelpText = "use :? for help.\n"
+
+ -- NOTE: spaces at the end of each line to workaround CPP/string gap bug.
+-helpText = "\
+-\ Commands available from the prompt:\n\
+-\\n\
+-\ <stmt> evaluate/run <stmt>\n\
+-\ :add <filename> ... add module(s) to the current target set\n\
+-\ :browse [*]<module> display the names defined by <module>\n\
+-\ :cd <dir> change directory to <dir>\n\
+-\ :def <cmd> <expr> define a command :<cmd>\n\
+-\ :help, :? display this list of commands\n\
+-\ :info [<name> ...] display information about the given names\n\
+-\ :load <filename> ... load module(s) and their dependents\n\
+-\ :module [+/-] [*]<mod> ... set the context for expression evaluation\n\
+-\ :reload reload the current module set\n\
+-\\n\
+-\ :set <option> ... set options\n\
+-\ :set args <arg> ... set the arguments returned by System.getArgs\n\
+-\ :set prog <progname> set the value returned by System.getProgName\n\
+-\\n\
+-\ :show modules show the currently loaded modules\n\
+-\ :show bindings show the current bindings made at the prompt\n\
+-\\n\
+-\ :type <expr> show the type of <expr>\n\
+-\ :undef <cmd> undefine user-defined command :<cmd>\n\
+-\ :unset <option> ... unset options\n\
+-\ :quit exit GHCi\n\
+-\ :!<command> run the shell command <command>\n\
+-\\n\
+-\ Options for `:set' and `:unset':\n\
+-\\n\
+-\ +r revert top-level expressions after each evaluation\n\
+-\ +s print timing/memory stats after each evaluation\n\
+-\ +t print type after evaluation\n\
+-\ -<flags> most GHC command line flags can also be set here\n\
+-\ (eg. -v2, -fglasgow-exts, etc.)\n\
+-\"
++helpText = ( ""++
++ " Commands available from the prompt:\n"++
++ "\n"++
++ " <stmt> evaluate/run <stmt>\n"++
++ " :add <filename> ... add module(s) to the current target set\n"++
++ " :browse [*]<module> display the names defined by <module>\n"++
++ " :cd <dir> change directory to <dir>\n"++
++ " :def <cmd> <expr> define a command :<cmd>\n"++
++ " :help, :? display this list of commands\n"++
++ " :info [<name> ...] display information about the given names\n"++
++ " :load <filename> ... load module(s) and their dependents\n"++
++ " :module [+/-] [*]<mod> ... set the context for expression evaluation\n"++
++ " :reload reload the current module set\n"++
++ "\n"++
++ " :set <option> ... set options\n"++
++ " :set args <arg> ... set the arguments returned by System.getArgs\n"++
++ " :set prog <progname> set the value returned by System.getProgName\n"++
++ "\n"++
++ " :show modules show the currently loaded modules\n"++
++ " :show bindings show the current bindings made at the prompt\n"++
++ "\n"++
++ " :type <expr> show the type of <expr>\n"++
++ " :undef <cmd> undefine user-defined command :<cmd>\n"++
++ " :unset <option> ... unset options\n"++
++ " :quit exit GHCi\n"++
++ " :!<command> run the shell command <command>\n"++
++ "\n"++
++ " Options for `:set' and `:unset':\n"++
++ "\n"++
++ " +r revert top-level expressions after each evaluation\n"++
++ " +s print timing/memory stats after each evaluation\n"++
++ " +t print type after evaluation\n"++
++ " -<flags> most GHC command line flags can also be set here\n"++
++ " (eg. -v2, -fglasgow-exts, etc.)\n"++
++ "" )
+
+ interactiveUI :: CmState -> [FilePath] -> [LibrarySpec] -> IO ()
+ interactiveUI cmstate paths cmdline_libs = do
diff --git a/lang/ghc5/files/patch-ghc_compiler_ndpFlatten_Flattening.hs b/lang/ghc5/files/patch-ghc_compiler_ndpFlatten_Flattening.hs
new file mode 100644
index 000000000000..1c2ddf3a8f37
--- /dev/null
+++ b/lang/ghc5/files/patch-ghc_compiler_ndpFlatten_Flattening.hs
@@ -0,0 +1,13 @@
+--- ghc/compiler/ndpFlatten/Flattening.hs.orig Tue May 24 22:10:38 2005
++++ ghc/compiler/ndpFlatten/Flattening.hs Tue May 24 22:10:56 2005
+@@ -650,8 +650,8 @@ dftbpBinders indexBnds exprBnds =
+ return ((fBnd, (newBnd:restBnds)), liftTy ty)
+
+ dftbpBinders' _ _ _ =
+- panic "Flattening.dftbpBinders: index and expression binder lists \
+- \have different length!"
++ panic ("Flattening.dftbpBinders: index and expression binder lists "++
++ "have different length!")
+
+ getExprOfBind:: CoreBind -> CoreExpr
+ getExprOfBind (NonRec _ expr) = expr
diff --git a/lang/ghc5/files/patch-ghc_rts_Profiling.c b/lang/ghc5/files/patch-ghc_rts_Profiling.c
new file mode 100644
index 000000000000..d0d78bcb7a39
--- /dev/null
+++ b/lang/ghc5/files/patch-ghc_rts_Profiling.c
@@ -0,0 +1,10 @@
+--- ghc/rts/Profiling.c.orig Tue May 24 23:15:46 2005
++++ ghc/rts/Profiling.c Tue May 24 23:15:56 2005
+@@ -713,6 +713,7 @@ reportCCSProfiling( void )
+ gen_XML_logfile();
+ return;
+ default:
++ /* do nothing */;
+ }
+
+ fprintf(prof_file, "\t%s Time and Allocation Profiling Report (%s)\n",
diff --git a/lang/ghc5/files/patch-ghc_utils_ghc-pkg_Main.hs b/lang/ghc5/files/patch-ghc_utils_ghc-pkg_Main.hs
new file mode 100644
index 000000000000..ff33794728ca
--- /dev/null
+++ b/lang/ghc5/files/patch-ghc_utils_ghc-pkg_Main.hs
@@ -0,0 +1,15 @@
+--- ghc/utils/ghc-pkg/Main.hs.orig Tue May 24 21:09:06 2005
++++ ghc/utils/ghc-pkg/Main.hs Tue May 24 21:32:53 2005
+@@ -190,9 +190,9 @@ checkConfigAccess pkgconf = do
+ maybeRestoreOldConfig :: String -> IO () -> IO ()
+ maybeRestoreOldConfig conf_file io
+ = my_catch io (\e -> do
+- hPutStr stdout "\nWARNING: an error was encountered while the new \n\
+- \configuration was being written. Attempting to \n\
+- \restore the old configuration... "
++ hPutStr stdout ("\nWARNING: an error was encountered while the new \n"++
++ "configuration was being written. Attempting to \n"++
++ "restore the old configuration... ")
+ renameFile (conf_file ++ ".old") conf_file
+ hPutStrLn stdout "done."
+ my_throw e
diff --git a/lang/ghc5/files/patch-ghc_utils_hsc2hs_Main.hs b/lang/ghc5/files/patch-ghc_utils_hsc2hs_Main.hs
new file mode 100644
index 000000000000..492c27810468
--- /dev/null
+++ b/lang/ghc5/files/patch-ghc_utils_hsc2hs_Main.hs
@@ -0,0 +1,109 @@
+--- ghc/utils/hsc2hs/Main.hs.orig Tue May 24 21:37:37 2005
++++ ghc/utils/hsc2hs/Main.hs Tue May 24 21:37:39 2005
+@@ -562,17 +562,17 @@ output flags name toks = do
+ _ -> return ()
+
+ when needsH $ writeFile outHName $
+- "#ifndef "++includeGuard++"\n\
+- \#define "++includeGuard++"\n\
+- \#if " ++
+- "__GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 409\n\
+- \#include <Rts.h>\n\
+- \#endif\n\
+- \#include <HsFFI.h>\n\
+- \#if __NHC__\n\
+- \#undef HsChar\n\
+- \#define HsChar int\n\
+- \#endif\n"++
++ "#ifndef "++includeGuard++"\n"++
++ "#define "++includeGuard++"\n"++
++ "#if " ++
++ "__GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 409\n"++
++ "#include <Rts.h>\n"++
++ "#endif\n"++
++ "#include <HsFFI.h>\n"++
++ "#if __NHC__\n"++
++ "#undef HsChar\n"++
++ "#define HsChar int\n"++
++ "#endif\n"++
+ concatMap outFlagH flags++
+ concatMap outTokenH specials++
+ "#endif\n"
+@@ -615,8 +615,8 @@ outHeaderCProg (pos, key, arg) = case ke
+ (header, _:body) -> case break isSpace header of
+ (name, args) ->
+ outCLine pos++
+- "#define hsc_"++name++"("++dropWhile isSpace args++") \
+- \printf ("++joinLines body++");\n"
++ "#define hsc_"++name++"("++dropWhile isSpace args++") "++
++ "printf ("++joinLines body++");\n"
+ _ -> ""
+ where
+ joinLines = concat . intersperse " \\\n" . lines
+@@ -624,11 +624,11 @@ outHeaderCProg (pos, key, arg) = case ke
+ outHeaderHs :: [Flag] -> Maybe String -> [(SourcePos, String, String)] -> String
+ outHeaderHs flags inH toks =
+ "#if " ++
+- "__GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 409\n\
+- \ printf (\"{-# OPTIONS -optc-D" ++
+- "__GLASGOW_HASKELL__=%d #-}\\n\", \
+- \__GLASGOW_HASKELL__);\n\
+- \#endif\n"++
++ "__GLASGOW_HASKELL__ && __GLASGOW_HASKELL__ < 409\n"++
++ " printf (\"{-# OPTIONS -optc-D" ++
++ "__GLASGOW_HASKELL__=%d #-}\\n\", "++
++ "__GLASGOW_HASKELL__);\n"++
++ "#endif\n"++
+ case inH of
+ Nothing -> concatMap outFlag flags++concatMap outSpecial toks
+ Just f -> outOption ("-#include \""++f++"\"")
+@@ -686,12 +686,12 @@ outEnum arg =
+ (enum, rest) -> let
+ this = case break (== '=') $ dropWhile isSpace enum of
+ (name, []) ->
+- " hsc_enum ("++t++", "++f++", \
+- \hsc_haskellize (\""++name++"\"), "++
++ " hsc_enum ("++t++", "++f++", "++
++ "hsc_haskellize (\""++name++"\"), "++
+ name++");\n"
+ (hsName, _:cName) ->
+- " hsc_enum ("++t++", "++f++", \
+- \printf (\"%s\", \""++hsName++"\"), "++
++ " hsc_enum ("++t++", "++f++", "++
++ "printf (\"%s\", \""++hsName++"\"), "++
+ cName++");\n"
+ in this++enums rest
+ in enums afterF
+@@ -712,9 +712,9 @@ outTokenH (pos, key, arg) =
+ 's':'t':'r':'u':'c':'t':' ':_ -> arg++"\n"
+ 't':'y':'p':'e':'d':'e':'f':' ':_ -> arg++"\n"
+ 'i':'n':'l':'i':'n':'e':' ':_ ->
+- "#ifdef __GNUC__\n\
+- \extern\n\
+- \#endif\n"++
++ "#ifdef __GNUC__\n"++
++ "extern\n"++
++ "#endif\n"++
+ arg++"\n"
+ _ -> "extern "++header++";\n"
+ where header = takeWhile (\c -> c /= '{' && c /= '=') arg
+@@ -731,13 +731,13 @@ outTokenC (pos, key, arg) =
+ case span (\c -> c /= '{' && c /= '=') arg' of
+ (header, body) ->
+ outCLine pos++
+- "#ifndef __GNUC__\n\
+- \extern inline\n\
+- \#endif\n"++
++ "#ifndef __GNUC__\n"++
++ "extern inline\n"++
++ "#endif\n"++
+ header++
+- "\n#ifndef __GNUC__\n\
+- \;\n\
+- \#else\n"++
++ "\n#ifndef __GNUC__\n"++
++ ";\n"++
++ "#else\n"++
+ body++
+ "\n#endif\n"
+ _ -> outCLine pos++arg++"\n"
diff --git a/lang/ghc5/files/patch-libraries_base_Data_List.hs b/lang/ghc5/files/patch-libraries_base_Data_List.hs
new file mode 100644
index 000000000000..d10543287bd7
--- /dev/null
+++ b/lang/ghc5/files/patch-libraries_base_Data_List.hs
@@ -0,0 +1,11 @@
+--- libraries/base/Data/List.hs.orig Tue May 24 23:25:06 2005
++++ libraries/base/Data/List.hs Tue May 24 23:37:14 2005
+@@ -144,7 +144,7 @@ import GHC.Show ( lines, words, unlines,
+ import GHC.Base
+ #endif
+
+-infix 5 \\
++infix 5 \\ -- comment to fool cpp
+
+ -- -----------------------------------------------------------------------------
+ -- List functions