[41873] trunk/dports/lang/ghc

gwright at macports.org gwright at macports.org
Tue Nov 11 12:03:20 PST 2008


Revision: 41873
          http://trac.macports.org/changeset/41873
Author:   gwright at macports.org
Date:     2008-11-11 12:03:20 -0800 (Tue, 11 Nov 2008)
Log Message:
-----------
Fix for bug 17123.

Modified Paths:
--------------
    trunk/dports/lang/ghc/Portfile

Added Paths:
-----------
    trunk/dports/lang/ghc/files/patch-libraries-Makefile.diff

Modified: trunk/dports/lang/ghc/Portfile
===================================================================
--- trunk/dports/lang/ghc/Portfile	2008-11-11 19:51:33 UTC (rev 41872)
+++ trunk/dports/lang/ghc/Portfile	2008-11-11 20:03:20 UTC (rev 41873)
@@ -4,6 +4,7 @@
 
 name		ghc
 version		6.10.1
+revision	1
 categories	lang haskell
 maintainers	gwright
 platforms	darwin
@@ -39,8 +40,13 @@
                     sha1    279072813e265bb143c7e612d5900bb324c72f6c	\
                     rmd160  34fe542788284c1e2167a955c3219e7e539eff4e
 
-patchfiles	patch-configure.ac.diff
+patchfiles	patch-configure.ac.diff		\
+		patch-libraries-Makefile.diff
 
+post-patch	{
+		reinplace "s|XXPATH_TO_HSC2HSXX|${workpath}/ghc-bootstrap/bin/hsc2hs|" ${worksrcpath}/libraries/Makefile
+}
+
 depends_lib	port:libedit \
 		port:gmp
 
@@ -160,6 +166,24 @@
 
 		system "chmod +x ${workpath}/ghc-bootstrap/bin/ghc-pkg"
 
+		set cfg [open "${workpath}/ghc-bootstrap/bin/hsc2hs" w]
+		puts $cfg "#!/bin/sh"
+		puts $cfg "HSC2HSBIN=${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/hsc2hs-bin"
+		puts $cfg "tflag=\"--template=${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/template-hsc.h\""
+		puts $cfg "for arg do"
+		puts $cfg "    case \"\$arg\" in"
+		puts $cfg "        -c*)	         HSC2HS_EXTRA=;;"
+		puts $cfg "        --cc=*)       HSC2HS_EXTRA=;;"
+		puts $cfg "	   -t*)	         tflag=;;"
+		puts $cfg "        --template=*) tflag=;;"
+		puts $cfg "        --)           break;;"
+		puts $cfg "    esac"
+		puts $cfg "done"
+		puts $cfg "exec \$HSC2HSBIN \$tflag \$HSC2HS_EXTRA \${1+\"\$@\"}"
+		close $cfg
+
+		system "chmod +x ${workpath}/ghc-bootstrap/bin/hsc2hs"
+
 		set cfg [open "${worksrcpath}/mk/build.mk" w]
 	  	puts $cfg "#"
 	  	puts $cfg "# Local configuration overrides for MacPorts"

Added: trunk/dports/lang/ghc/files/patch-libraries-Makefile.diff
===================================================================
--- trunk/dports/lang/ghc/files/patch-libraries-Makefile.diff	                        (rev 0)
+++ trunk/dports/lang/ghc/files/patch-libraries-Makefile.diff	2008-11-11 20:03:20 UTC (rev 41873)
@@ -0,0 +1,11 @@
+--- libraries/Makefile.sav	2008-11-11 13:35:39.000000000 -0500
++++ libraries/Makefile	2008-11-11 13:39:03.000000000 -0500
+@@ -145,7 +145,7 @@
+ 	cd Cabal    && $(CABAL) build     --distpref=dist-bootstrapping
+ 	cd Cabal    && $(CABAL) install   --distpref=dist-bootstrapping --inplace
+ 	-cd hpc    && $(CABAL) clean     --distpref=dist-bootstrapping
+-	cd hpc    && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --package-db=$(HERE_ABS)/$@.tmp
++	cd hpc    && $(CABAL) configure --distpref=dist-bootstrapping --with-compiler=$(GHC) --with-hc-pkg=$(GHC_PKG) --with-hsc2hs=XXPATH_TO_HSC2HSXX --package-db=$(HERE_ABS)/$@.tmp
+ 	cd hpc    && $(CABAL) build     --distpref=dist-bootstrapping
+ 	cd hpc    && $(CABAL) install   --distpref=dist-bootstrapping --inplace
+ 	mv $@.tmp $@
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20081111/45276680/attachment.html>


More information about the macports-changes mailing list