Bug 60155 - [patch] lang/ghc: Unbreak on -CURRENT + improvements
Summary: [patch] lang/ghc: Unbreak on -CURRENT + improvements
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Oliver Braun
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-11 16:00 UTC by stolz
Modified: 2003-12-12 16:33 UTC (History)
1 user (show)

See Also:


Attachments
ghc5-patch (6.60 KB, text/plain)
2003-12-11 16:00 UTC, stolz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description stolz 2003-12-11 16:00:36 UTC
- Fix build on -CURRENT by importing some gcc33 fixes
- Fix linker issue on -CURRENT by not using SplitObjs, same as:
   http://www.haskell.org/pipermail/glasgow-haskell-users/2003-June/005289.html
- Use libgmp from ports (saves further patching)
- Bump PORTREVISION

Successfully builds "hello world" on -CURRENT.

Fix: Add 5 patch files:
patch-ghc-compiler-nativeGen-MachMisc.lhs
patch-ghc-compiler-nativeGen-RegAllocInfo.lhs
patch-ghc-rts-RtsFlags.c
patch-ghc-rts-rts.conf.in
patch-ghc-utils-prof-cgprof-cgprof.c
Comment 1 Oliver Braun freebsd_committer freebsd_triage 2003-12-12 13:25:09 UTC
Responsible Changed
From-To: freebsd-ports-bugs->obraun

I'll handle this!
Comment 2 Oliver Braun freebsd_committer freebsd_triage 2003-12-12 15:40:29 UTC
> Successfully builds "hello world" on -CURRENT.


But it won't work on -STABLE. I would like to commit the following patch
(and the new patchfiles from Volker) which works on both.

Volker, ok?
Simon, approved?

Regards,
         Olli

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/lang/ghc/Makefile,v
retrieving revision 1.18
diff -u -r1.18 Makefile
--- Makefile	27 Mar 2003 22:55:09 -0000	1.18
+++ Makefile	12 Dec 2003 15:35:55 -0000
@@ -6,6 +6,7 @@
 
 PORTNAME=	ghc
 PORTVERSION=	5.04.3
+PORTREVISION=	1
 CATEGORIES=	lang haskell
 MASTER_SITES=	http://www.haskell.org/ghc/dist/${PORTVERSION}/:source \
 		http://www.haskell.org/ghc/dist/${PORTVERSION}/FreeBSD/:boot
@@ -25,12 +26,19 @@
 DISTFILES+=	${BOOT_DIST}
 .else
 DISTFILES+=	${BOOT_DIST5}
+EXTRA_PATCHES+=	${FILESDIR}/extra-patch-ghc-compiler-nativeGen-MachMisc.lhs \
+		${FILESDIR}/extra-patch-ghc-compiler-nativeGen-RegAllocInfo.lhs \
+		${FILESDIR}/extra-patch-ghc-rts-RtsFlags.c \
+		${FILESDIR}/extra-patch-ghc-rts-rts.conf.in \
+		${FILESDIR}/extra-patch-ghc-utils-prof-cgprof-cgprof.c
+LIB_DEPENDS=	gmp.6:${PORTSDIR}/math/libgmp4
 .endif
 
 MAINTAINER=	simonmar@microsoft.com
 COMMENT=	A Compiler for the functional language Haskell
 
 USE_PERL5=	yes
+USE_REINPLACE=	yes
 USE_GMAKE=	yes
 GNU_CONFIGURE=	yes
 
@@ -49,6 +57,13 @@
 CONFIGURE_ARGS= --with-ghc=${BOOT_GHC}
 # specifying CONFIGURE_TARGET doesn't work for some reason.
 CONFIGURE_TARGET=
+# libgmp:
+.if ${OSVERSION} >= 500000
+CONFIGURE_ENV+=	CFLAGS=-I${LOCALBASE}/include LDFLAGS=-L${LOCALBASE}/lib
+PLIST_SUB+=	GMP="@comment "
+.else
+PLIST_SUB+=	GMP=""
+.endif
 
 # override TMPDIR because /tmp often doesn't have enough space
 # to build some of the larger libraries.
@@ -64,10 +79,13 @@
 	@${ECHO_CMD} "Building GHC without profiling libraries."
 .endif
 
-.if defined(WITHOUT_PROFILE)
 post-extract:
+.if defined(WITHOUT_PROFILE)
 	@${ECHO} >>${WRKSRC}/mk/build.mk GhcLibWays=
 .endif
+.if ${OSVERSION} >= 500000
+	@${ECHO} >>${WRKSRC}/mk/build.mk SplitObjs=NO
+.endif
 
 post-patch:
 	@${PERL} -pi -e 's/DrIFT/DrIFT-ghc/g; \
@@ -77,6 +95,7 @@
 			${WRKSRC}/hslibs/tools/DrIFT/Makefile \
 			${WRKSRC}/hslibs/tools/DtdToHaskell/Makefile \
 			${WRKSRC}/hslibs/tools/Xtract/Makefile
+	@${REINPLACE_CMD} s+%%LOCALBASE%%+${LOCALBASE}+ ${WRKSRC}/ghc/rts/rts.conf.in
 
 pre-configure:
 	@(cd ${BOOT_DIR} && ${CONFIGURE_ENV} ./${CONFIGURE_SCRIPT} ${CONFIGURE_ARGS})
Index: pkg-plist
===================================================================
RCS file: /home/pcvs/ports/lang/ghc/pkg-plist,v
retrieving revision 1.10
diff -u -r1.10 pkg-plist
--- pkg-plist	17 Sep 2002 20:09:56 -0000	1.10
+++ pkg-plist	12 Dec 2003 15:35:56 -0000
@@ -819,7 +819,7 @@
 lib/ghc-%%GHC_VERSION%%/libHSutil.a
 lib/ghc-%%GHC_VERSION%%/libHSutil_cbits.a
 %%PROFILE%%lib/ghc-%%GHC_VERSION%%/libHSutil_p.a
-lib/ghc-%%GHC_VERSION%%/libgmp.a
+%%GMP%%lib/ghc-%%GHC_VERSION%%/libgmp.a
 lib/ghc-%%GHC_VERSION%%/package.conf
 lib/ghc-%%GHC_VERSION%%/parse-gcstats.prl
 lib/ghc-%%GHC_VERSION%%/process-gcstats.prl


-- 
Oliver Braun -- obraun @ { unsane.org | FreeBSD.org | haskell.org }
Comment 3 Oliver Braun freebsd_committer freebsd_triage 2003-12-12 16:31:01 UTC
State Changed
From-To: open->closed

Committed, thanks!