[96883] trunk/dports/lang/ghc

cal at macports.org cal at macports.org
Mon Aug 20 14:42:48 PDT 2012


Revision: 96883
          https://trac.macports.org/changeset/96883
Author:   cal at macports.org
Date:     2012-08-20 14:42:48 -0700 (Mon, 20 Aug 2012)
Log Message:
-----------
ghc: update to 7.4.2, closes #25558

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

Added Paths:
-----------
    trunk/dports/lang/ghc/files/
    trunk/dports/lang/ghc/files/ghc7040.patch
    trunk/dports/lang/ghc/files/patch-configure-disable-docbook-ps-and-pdf.diff

Removed Paths:
-------------
    trunk/dports/lang/ghc/files/

Modified: trunk/dports/lang/ghc/Portfile
===================================================================
--- trunk/dports/lang/ghc/Portfile	2012-08-20 21:34:48 UTC (rev 96882)
+++ trunk/dports/lang/ghc/Portfile	2012-08-20 21:42:48 UTC (rev 96883)
@@ -1,565 +1,127 @@
-# -*- coding: utf-8; mode: tcl; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
 # $Id$
 
-PortSystem	1.0
+PortSystem          1.0
 
-name		ghc
-set canonicalname	ghc
-version		6.10.4
-revision	5
-categories	lang haskell
-maintainers	nomaintainer
-license		BSD
-platforms	darwin
-description	The Glorious Glasgow Haskell Compilation System
-long_description	\
-		The Glasgow Haskell Compiler is a robust,		\
-		fully-featured, optimising compiler and interactive	\
-		environment for Haskell 98, GHC compiles Haskell to	\
-		either native code or C.  It implements numerous	\
-		experimental language extensions to Haskell 98,		\
-		for example: concurrency, a foreign language interface,	\
-		multi-parameter type classes, scoped type variables,	\
-		existential and universal quantification, unboxed	\
-		types, exceptions, weak pointers, and so on.		\
-		GHC comes with a generational garbage collector,	\
-		and a space and time profiler.
+name                ghc
+conflicts           hs-platform-ghc
+set canonicalname   ghc
+version             7.4.2
+categories          lang haskell
+maintainers         gmail.com:kitchen.andy cal openmaintainer
+license             BSD
+platforms           darwin
 
-homepage	http://haskell.org/${canonicalname}
-master_sites	${homepage}/dist/${version}/
+description The Glorious Glasgow Haskell Compilation System
+long_description    \
+        The Glasgow Haskell Compiler is a robust,       \
+        fully-featured, optimising compiler and interactive \
+        environment for Haskell 98, GHC compiles Haskell to \
+        either native code or C.  It implements numerous    \
+        experimental language extensions to Haskell 98,     \
+        for example: concurrency, a foreign language interface, \
+        multi-parameter type classes, scoped type variables,    \
+        existential and universal quantification, unboxed   \
+        types, exceptions, weak pointers, and so on.        \
+        GHC comes with a generational garbage collector,    \
+        and a space and time profiler.
 
-use_bzip2	yes
+homepage        http://haskell.org/${canonicalname}
+master_sites    ${homepage}/dist/${version}/
+distname        ${canonicalname}-${version}-src
+worksrcdir      ${canonicalname}-${version}
 
-distfiles	${canonicalname}-${version}-src.tar.bz2			\
-		${canonicalname}-${version}-src-extralibs.tar.bz2	\
-		testsuite-${version}.tar.bz2
+use_bzip2       yes
 
-checksums       ${canonicalname}-${version}-src.tar.bz2 \
-                    md5     167687fa582ef6702aaac24e139ec982 \
-                    sha1    0566858b409066d98da70de5adb9a7030d0df5dc \
-                    rmd160  5f83baf2549f1f4bea140c6a80728c2a76f60ab6 \
-                ${canonicalname}-${version}-src-extralibs.tar.bz2 \
-                    md5     37ce285617d7cebabc3cf6805bdbca25 \
-                    sha1    b08b26070f2965122662d035c602536ae9aafbb8 \
-                    rmd160  78e6dba88a253095c79f94c5356918402810bd01 \
-                testsuite-${version}.tar.bz2 \
-                    md5     1973d7c1a24afbc58cebc7c574ebb56f \
-                    sha1    cfb327686398fba2c12a5cd1fdad56faa4fbf3c6 \
-                    rmd160  8952dda913a6363f60d3c4ad2d18ec6abcf33425
+distfiles       ${canonicalname}-${version}-src${extract.suffix} \
+                ${canonicalname}-${version}-testsuite${extract.suffix}
 
-# ghc does not support a universal build:
-universal_variant	no
+checksums       ghc-7.4.2-src.tar.bz2 \
+                rmd160  c1caf17de353d3f805966ea64235a8341a8e071e \
+                sha256  f2ee1289a33cc70539287129841acc7eaf16112bb60c59b5a6ee91887bfd836d \
+                ghc-7.4.2-testsuite.tar.bz2 \
+                rmd160  6ff2a50d2165baa540da8a486d30fab47dfdbd0d \
+                sha256  227fee370e84892e4316f611c8cae0ad24d58d594d0b49f7960caf05b4f85332
 
-patchfiles	patch-configure.ac.diff			\
-		patch-aclocal.m4.diff			\
-		patch-compiler-ghc.cabal.in.diff	\
-		patch-compiler-Makefile.diff		\
-		patch-compiler-Makefile.local.diff	\
-		patch-ghc-Makefile.diff			\
-		patch-libraries-Makefile.diff		\
-		patch-libraries-cabal-bin.hs.diff	\
-		patch-libraries-terminfo-configure.ac.diff	\
-		patch-mk-cabal.mk.diff			\
-		patch-mk-target.mk.diff			\
-		patch-utils-genapply-Makefile.diff	\
-		patch-utils-genprimopcode-Makefile.diff
+depends_build   port:ghc-bootstrap \
+                port:libxslt
 
-depends_build	port:autoconf263
-depends_lib	port:gmp	\
-		port:ncurses	\
-		port:libiconv
+depends_lib     port:gmp           \
+                port:ncurses       \
+                port:libiconv
 
-variant maintainer_debug requires cabal_configure_debug description {Verbose logging and save all temporary files} { }
+patchfiles      patch-configure-disable-docbook-ps-and-pdf.diff \
+                ghc7040.patch
+                # see http://hackage.haskell.org/trac/ghc/ticket/7040
 
-variant cabal_configure_debug description {Add verbose debugging to cabal configure commands} {
+use_parallel_build yes
+test.run yes
 
-		patchfiles-delete	patch-compiler-Makefile.diff	\
-					patch-ghc-Makefile.diff		\
-					patch-libraries-Makefile.diff	\
-					patch-mk-cabal.mk.diff
+# -- BEGIN gcc variants
 
-		if { ${configure.build_arch} == "i386" && ${os.platform} == "darwin" && ${os.major} == 10 } {
-			patchfiles-append	patch-snowleopard-i386-compiler-Makefile-debug.diff	\
-						patch-snowleopard-i386-ghc-Makefile-debug.diff		\
-						patch-snowleopard-i386-libraries-Makefile-debug.diff	\
-						patch-snowleopard-i386-mk-cabal.mk-debug.diff
-		} else {
-			patchfiles-append	patch-compiler-Makefile-debug.diff	\
-						patch-ghc-Makefile-debug.diff		\
-						patch-libraries-Makefile-debug.diff	\
-						patch-mk-cabal.mk-debug.diff
-		}
+variant gcc43 conflicts gcc44 gcc45 gcc46 gcc47 description {Compile with gcc 4.3} {
+    configure.compiler macports-gcc-4.3
+    depends_lib-append port:gcc43
 }
 
-# Yes, it some situations (-fvia-C) we really need perl
-# to _run_ ghc, since the mangler (an assembly to assembly transformation)
-# is a perl script. That's why it called the "Evil Mangler".
-#
-# Not only that, but since correctly handling whitespace is critical,
-# only perl 5.8 is known to work reliably.
-#
-depends_lib-append	port:perl5.8
-configure.env-append	PerlCmd=${prefix}/bin/perl5.8
-
-worksrcdir	${canonicalname}-${version}
-
-platform darwin 8 powerpc {
-		global ghc_bootversion
-		set ghc_bootversion	6.10.1
-
-		master_sites-append	${homepage}/dist/${ghc_bootversion}/:bootstrap
-
-		distfiles-append	${canonicalname}-${ghc_bootversion}-darwin-ppc-tiger-bootstrap.tar.bz2:bootstrap
-
-                checksums-append	${canonicalname}-${ghc_bootversion}-darwin-ppc-tiger-bootstrap.tar.bz2 \
-					md5     511f4bec375b51aaa82de999529916ae		\
-                      			sha1    cb6974a680168246c6e13a92818b39c559d7a2b4	\
-                      			rmd160  be60cfffc0ed223fb39ce2fe40ad501486564f0e
-
-		extract.only		${canonicalname}-${version}-src.tar.bz2 \
-					${canonicalname}-${version}-src-extralibs.tar.bz2 \
-					${canonicalname}-${ghc_bootversion}-darwin-ppc-tiger-bootstrap.tar.bz2
-
-		pre-fetch {
-			set minimum_xcodeversion 2.5
-        		set current_xcodeversion [exec defaults read /Developer/Applications/Xcode.app/Contents/Info CFBundleShortVersionString]
-        		if {[vercmp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
-            			ui_msg "On Mac OS X ${macosx_version}, ${name} ${version} requires Xcode ${minimum_xcodeversion} but you have Xcode ${current_xcodeversion}."
-            			return -code error "incompatible Xcode version"
-        		}
-		}
+variant gcc44 conflicts gcc43 gcc45 gcc46 gcc47 description {Compile with gcc 4.4} {
+    configure.compiler macports-gcc-4.4
+    depends_lib-append port:gcc44
 }
 
-
-platform darwin 8 i386 {
-		global ghc_bootversion
-		set ghc_bootversion	6.6
-
-		master_sites-append	${homepage}/dist/${ghc_bootversion}/:bootstrap
-
-		distfiles-append	${canonicalname}-${ghc_bootversion}-darwin-i386-tiger-bootstrap-rev1.tar.bz2:bootstrap
-
-		checksums-append	${canonicalname}-${ghc_bootversion}-darwin-i386-tiger-bootstrap-rev1.tar.bz2 \
-					md5 f01663cecefd50b5f1e1f524f49cd6df
-
-		extract.only		${canonicalname}-${version}-src.tar.bz2 \
-					${canonicalname}-${version}-src-extralibs.tar.bz2 \
-					${canonicalname}-${ghc_bootversion}-darwin-i386-tiger-bootstrap-rev1.tar.bz2
-
-		pre-fetch {
-			set minimum_xcodeversion 2.5
-        		set current_xcodeversion [exec defaults read /Developer/Applications/Xcode.app/Contents/Info CFBundleShortVersionString]
-        		if {[vercmp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
-            			ui_msg "On Mac OS X ${macosx_version}, ${name} ${version} requires Xcode ${minimum_xcodeversion} but you have Xcode ${current_xcodeversion}."
-            			return -code error "incompatible Xcode version"
-        		}
-		}
+variant gcc45 conflicts gcc43 gcc44 gcc46 gcc47 description {Compile with gcc 4.5} {
+    configure.compiler macports-gcc-4.5
+    depends_lib-append port:gcc45
 }
 
-
-platform darwin 9 powerpc {
-		global ghc_bootversion
-		set ghc_bootversion	6.10.1
-
-		master_sites-append	${homepage}/dist/${ghc_bootversion}/:bootstrap
-
-		distfiles-append	${canonicalname}-${ghc_bootversion}-darwin-ppc-leopard-bootstrap.tar.bz2:bootstrap
-
-                checksums-append	${canonicalname}-${ghc_bootversion}-darwin-ppc-leopard-bootstrap.tar.bz2 \
-					md5     511f4bec375b51aaa82de999529916ae	\
-                        		sha1    cb6974a680168246c6e13a92818b39c559d7a2b4\
-                        		rmd160  be60cfffc0ed223fb39ce2fe40ad501486564f0e
-
-		extract.only		${canonicalname}-${version}-src.tar.bz2 \
-					${canonicalname}-${version}-src-extralibs.tar.bz2 \
-					${canonicalname}-${ghc_bootversion}-darwin-ppc-leopard-bootstrap.tar.bz2
-
-		pre-fetch {
-			set minimum_xcodeversion 3.1.2
-        		set current_xcodeversion [exec defaults read /Developer/Applications/Xcode.app/Contents/Info CFBundleShortVersionString]
-        		if {[vercmp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
-            			ui_msg "On Mac OS X ${macosx_version}, ${name} ${version} requires Xcode ${minimum_xcodeversion} but you have Xcode ${current_xcodeversion}."
-            			return -code error "incompatible Xcode version"
-        		}
-		}
+variant gcc46 conflicts gcc43 gcc44 gcc45 gcc47 description {Compile with gcc 4.6} {
+    configure.compiler macports-gcc-4.6
+    depends_lib-append port:gcc46
 }
 
-
-platform darwin 9 i386 {
-		global ghc_bootversion
-		set ghc_bootversion	6.8.2
-
-		master_sites-append	${homepage}/dist/${ghc_bootversion}/:bootstrap
-
-		distfiles-append	${canonicalname}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2:bootstrap
-
-		checksums-append	${canonicalname}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2 \
-					md5 f263cedef8bcbaa7e9014b3e06923583
-
-		extract.only		${canonicalname}-${version}-src.tar.bz2 \
-					${canonicalname}-${version}-src-extralibs.tar.bz2 \
-					${canonicalname}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2
-
-		pre-fetch {
-			set minimum_xcodeversion 3.1
-        		set current_xcodeversion [exec defaults read /Developer/Applications/Xcode.app/Contents/Info CFBundleShortVersionString]
-        		if {[vercmp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
-            			ui_msg "On Mac OS X ${macosx_version}, ${name} ${version} requires Xcode ${minimum_xcodeversion} but you have Xcode ${current_xcodeversion}."
-            			return -code error "incompatible Xcode version"
-        		}
-		}
+variant gcc47 conflicts gcc43 gcc44 gcc45 gcc46  description {Compile with gcc 4.7} {
+    configure.compiler macports-gcc-4.7
+    depends_lib-append port:gcc47
 }
 
-
-platform darwin 10 {
-		global ghc_bootversion
-		set ghc_bootversion	6.10.4
-
-		master_sites-append	${homepage}/dist/${ghc_bootversion}/:bootstrap
-
-		if { ${configure.build_arch} == "x86_64" } {
-			distfiles-append	${canonicalname}-${ghc_bootversion}-darwin-x86_64-snowleopard-macports-bootstrap.tar.bz2:bootstrap
-
-			checksums-append	${canonicalname}-${ghc_bootversion}-darwin-x86_64-snowleopard-macports-bootstrap.tar.bz2 \
-						md5     70c8743dc4d606904426146e0e6d7cdf \
-						sha1    bd6830318c522527b2c35a84724832d983054416 \
-						rmd160  bc67c499417e009428fe6bf90b86fda4f1ec3e9e
-
-			extract.only		${canonicalname}-${version}-src.tar.bz2 \
-						${canonicalname}-${version}-src-extralibs.tar.bz2 \
-						${canonicalname}-${ghc_bootversion}-darwin-x86_64-snowleopard-macports-bootstrap.tar.bz2
-
-		} elseif { ${configure.build_arch} == "i386" } {
-			distfiles-append	${canonicalname}-${ghc_bootversion}-darwin-i386-snowleopard-bootstrap.tar.bz2:bootstrap
-
-			checksums-append	${canonicalname}-${ghc_bootversion}-darwin-i386-snowleopard-bootstrap.tar.bz2 \
-						md5     fba9493ef1a1cb3f54274ab59f007725 \
-						sha1    cd30029d0c32b8e97ef31c81f0a9613586628c0f \
-						rmd160  d32bc2006ff9d56da1dfecce0eb8be780e81b8b9
-
-			patchfiles-delete	patch-compiler-Makefile.local.diff		\
-						patch-libraries-cabal-bin.hs.diff		\
-						patch-mk-target.mk.diff
-
-			patchfiles-append	patch-snowleopard-i386-includes-Makefile.diff           	\
-						patch-snowleopard-i386-compiler-Makefile.local.diff             \
-						patch-snowleopard-i386-compiler-main-DriverPipeline.hs.diff     \
-						patch-snowleopard-i386-ghc-ghc.wrapper.diff                     \
-						patch-snowleopard-i386-libraries-cabal-bin.hs.diff              \
-						patch-snowleopard-i386-libraries-haskeline-haskeline.cabal.diff \
-						patch-snowleopard-i386-libffi-Makefile.diff                     \
-						patch-snowleopard-i386-mk-target.mk.diff                        \
-						patch-snowleopard-i386-utils-genapply-Makefile.diff             \
-						patch-snowleopard-i386-utils-genprimopcode-Makefile.diff        \
-						patch-snowleopard-i386-utils-hsc2hs-hsc2hs.wrapper.diff
-
-			if { !([variant_isset maintainer_debug] || [variant_isset cabal_configure_debug]) } {
-				patchfiles-delete	patch-compiler-Makefile.diff	\
-							patch-ghc-Makefile.diff		\
-							patch-libraries-Makefile.diff	\
-							patch-mk-cabal.mk.diff
-
-				patchfiles-append	patch-snowleopard-i386-compiler-Makefile.diff	\
-							patch-snowleopard-i386-ghc-Makefile.diff	\
-							patch-snowleopard-i386-libraries-Makefile.diff	\
-							patch-snowleopard-i386-mk-cabal.mk.diff
-			}
-
-			extract.only		${canonicalname}-${version}-src.tar.bz2 \
-						${canonicalname}-${version}-src-extralibs.tar.bz2 \
-						${canonicalname}-${ghc_bootversion}-darwin-i386-snowleopard-bootstrap.tar.bz2
-
-		} else {
-		        pre-fetch {
-			        # belt and braces approach:
-			        return -code error "Unrecognized build architecture on Snow Leopard"
-			}
-		}
-
-		patchfiles-append	patch-snowleopard-compiler-cmm-CLabel.hs.diff		\
-					patch-snowleopard-compiler-main-DynFlags.hs.diff	\
-					patch-snowleopard-ghc-ghc-bin.cabal.in.diff		\
-					patch-snowleopard-rts-Linker.c.diff			\
-					patch-snowleopard-rts-Makefile.diff			\
-					patch-snowleopard-rts-package.conf.in.diff
-
+if {![variant_isset gcc43] && ![variant_isset gcc44] &&
+    ![variant_isset gcc45] && ![variant_isset gcc46] &&
+    ![variant_isset gcc47]} {
+    default_variants +gcc47
 }
 
-platform darwin 11 {
-		global ghc_bootversion
-		set ghc_bootversion	6.10.4
+# -- END gcc variants
 
-		master_sites-append	${homepage}/dist/${ghc_bootversion}/:bootstrap
+set bootstraproot ${prefix}/share/ghc-bootstrap
+configure.args  --with-ghc=${bootstraproot}/bin/ghc     \
+                --with-iconv-includes=${prefix}/include \
+                --with-iconv-libraries=${prefix}/lib    \
+                --with-gmp-includes=${prefix}/include   \
+                --with-gmp-libraries=${prefix}/lib
 
-		if { ${configure.build_arch} == "x86_64" } {
-			distfiles-append	${canonicalname}-${ghc_bootversion}-darwin-x86_64-snowleopard-macports-bootstrap.tar.bz2:bootstrap
+# OK so because the bootstrap binary has been prebuilt for libraries
+# in /usr/lib we search these before macports stuff to prevent
+# link errors, ghc _should_ actually compile itself in stage2
+# using paths from the command line arguments
+compiler.cpath /usr/include
+compiler.library_path /usr/lib
 
-			checksums-append	${canonicalname}-${ghc_bootversion}-darwin-x86_64-snowleopard-macports-bootstrap.tar.bz2 \
-						md5     70c8743dc4d606904426146e0e6d7cdf \
-						sha1    bd6830318c522527b2c35a84724832d983054416 \
-						rmd160  bc67c499417e009428fe6bf90b86fda4f1ec3e9e
 
-			extract.only		${canonicalname}-${version}-src.tar.bz2 \
-						${canonicalname}-${version}-src-extralibs.tar.bz2 \
-						${canonicalname}-${ghc_bootversion}-darwin-x86_64-snowleopard-macports-bootstrap.tar.bz2
+post-destroot {
+    set prefixlib ${prefix}/lib/${worksrcdir}
+    set destlib   ${destroot}/${prefixlib}
+    set libver    ${canonicalname}${version}
 
-		} elseif { ${configure.build_arch} == "i386" } {
-			distfiles-append	${canonicalname}-${ghc_bootversion}-darwin-i386-snowleopard-bootstrap.tar.bz2:bootstrap
+    variable libs [ list                               \
+                    libHSrts-${libver}.dylib           \
+                    libHSrts_debug-${libver}.dylib     \
+                    libHSrts_thr-${libver}.dylib       \
+                    libHSrts_thr_debug-${libver}.dylib ]
 
-			checksums-append	${canonicalname}-${ghc_bootversion}-darwin-i386-snowleopard-bootstrap.tar.bz2 \
-						md5     fba9493ef1a1cb3f54274ab59f007725 \
-						sha1    cd30029d0c32b8e97ef31c81f0a9613586628c0f \
-						rmd160  d32bc2006ff9d56da1dfecce0eb8be780e81b8b9
+    system "install_name_tool -id ${prefixlib}/libffi.dylib ${destlib}/libffi.dylib"
 
-			patchfiles-delete	patch-compiler-Makefile.local.diff		\
-						patch-libraries-cabal-bin.hs.diff		\
-						patch-mk-target.mk.diff
-
-			patchfiles-append	patch-snowleopard-i386-includes-Makefile.diff           	\
-						patch-snowleopard-i386-compiler-Makefile.local.diff             \
-						patch-snowleopard-i386-compiler-main-DriverPipeline.hs.diff     \
-						patch-snowleopard-i386-ghc-ghc.wrapper.diff                     \
-						patch-snowleopard-i386-libraries-cabal-bin.hs.diff              \
-						patch-snowleopard-i386-libraries-haskeline-haskeline.cabal.diff \
-						patch-snowleopard-i386-libffi-Makefile.diff                     \
-						patch-snowleopard-i386-mk-target.mk.diff                        \
-						patch-snowleopard-i386-utils-genapply-Makefile.diff             \
-						patch-snowleopard-i386-utils-genprimopcode-Makefile.diff        \
-						patch-snowleopard-i386-utils-hsc2hs-hsc2hs.wrapper.diff
-
-			if { !([variant_isset maintainer_debug] || [variant_isset cabal_configure_debug]) } {
-				patchfiles-delete	patch-compiler-Makefile.diff	\
-							patch-ghc-Makefile.diff		\
-							patch-libraries-Makefile.diff	\
-							patch-mk-cabal.mk.diff
-
-				patchfiles-append	patch-snowleopard-i386-compiler-Makefile.diff	\
-							patch-snowleopard-i386-ghc-Makefile.diff	\
-							patch-snowleopard-i386-libraries-Makefile.diff	\
-							patch-snowleopard-i386-mk-cabal.mk.diff
-			}
-
-			extract.only		${canonicalname}-${version}-src.tar.bz2 \
-						${canonicalname}-${version}-src-extralibs.tar.bz2 \
-						${canonicalname}-${ghc_bootversion}-darwin-i386-snowleopard-bootstrap.tar.bz2
-
-		} else {
-		        pre-fetch {
-			        # belt and braces approach:
-			        return -code error "Unrecognized build architecture on Snow Leopard"
-			}
-		}
-
-		patchfiles-append	patch-snowleopard-compiler-cmm-CLabel.hs.diff		\
-					patch-snowleopard-compiler-main-DynFlags.hs.diff	\
-					patch-snowleopard-ghc-ghc-bin.cabal.in.diff		\
-					patch-snowleopard-rts-Linker.c.diff			\
-					patch-snowleopard-rts-Makefile.diff			\
-					patch-snowleopard-rts-package.conf.in.diff
-
+    foreach lib $libs {
+      regexp -line {[^[:space:]]*/libffi.*\.dylib} [exec otool -L ${destlib}/${lib}] oldlib
+      system "install_name_tool -change ${oldlib} ${prefixlib}/libffi.dylib ${destlib}/$lib"
+    }
 }
-
-
-if {${configure.compiler} == "llvm-gcc-4.2"} {
-    configure.compiler gcc-4.2
-} elseif {${configure.compiler} == "clang"} {
-    depends_build-append port:apple-gcc42
-    configure.compiler apple-gcc-4.2
-    # base (as of 2.0.3) doesn't set cxx for apple-gcc-4.2
-    configure.cxx ${prefix}/bin/g++-apple-4.2
-}
-
-
-post-extract {
-     system "tar jxf ${distpath}/testsuite-${version}.tar.bz2 -C ${worksrcpath}" 
-}
-
-
-post-patch	{
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/ghc/Makefile
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/compiler/Makefile
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/compiler/Makefile.local
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/libraries/Makefile
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/libraries/cabal-bin.hs
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/aclocal.m4
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/mk/cabal.mk
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/mk/target.mk
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/utils/genapply/Makefile
-		reinplace "s|XXPATH_TO_GCCXX|${configure.cc}|g" ${worksrcpath}/utils/genprimopcode/Makefile
-
-		reinplace "s|XXPATH_TO_HSC2HSXX|${workpath}/ghc-bootstrap/bin/hsc2hs|" ${worksrcpath}/libraries/Makefile
-
-		reinplace "s|XXMACPORTS_PREFIXXX|${prefix}|" ${worksrcpath}/compiler/ghc.cabal.in
-
-		reinplace "s|/opt/local/lib/ghc-${ghc_bootversion}|${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}|g" ${workpath}/${canonicalname}-bootstrap/lib/ghc-${ghc_bootversion}/package.conf
-
-		reinplace "s|GHCBIN=/opt/local|GHCBIN=${workpath}/${canonicalname}-bootstrap|" ${workpath}/${canonicalname}-bootstrap/bin/ghc
-
-		reinplace "s|TOPDIROPT=-B/opt/local|TOPDIROPT=-B${workpath}/${canonicalname}-bootstrap|" ${workpath}/${canonicalname}-bootstrap/bin/ghc
-
-		if {"/opt/local" != ${prefix}} {
-			reinplace "s|-L/opt/local|-L${prefix}|" ${workpath}/${canonicalname}-bootstrap/bin/ghc
-			reinplace "s|-I/opt/local|-I${prefix}|" ${workpath}/${canonicalname}-bootstrap/bin/ghc
-			reinplace "s|/opt/local|${prefix}|g" \
-				${workpath}/${canonicalname}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm \
-				${workpath}/${canonicalname}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split \
-		}
-}
-
-
-pre-configure	{
-		system "${prefix}/bin/autoreconf263 ${worksrcpath}"
-
-		set cfg [open "${workpath}/ghc-bootstrap/bin/ghc-pkg" w]
-		puts $cfg "#!/bin/sh"
-		if {${ghc_bootversion} eq "6.10.4"} {
-			puts $cfg "GHCPKGBIN=${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/ghc-pkg"
-		} else {
-			puts $cfg "GHCPKGBIN=${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/ghc-pkg.bin"
-		}
-		puts $cfg "PKGCONF=${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf"
-		puts $cfg "exec \$GHCPKGBIN --global-conf \$PKGCONF \${1+\"\$@\"}"
-		close $cfg
-
-		system "chmod +x ${workpath}/ghc-bootstrap/bin/ghc-pkg"
-
-		set cfg [open "${workpath}/ghc-bootstrap/bin/hsc2hs" w]
-		puts $cfg "#!/bin/sh"
-		if {${ghc_bootversion} eq "6.10.4"} {
-			puts $cfg "HSC2HSBIN=${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/hsc2hs"
-		} else {
-			puts $cfg "HSC2HSBIN=${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/hsc2hs-bin"
-		}
-		if {${ghc_bootversion} eq "6.10.1" || ${ghc_bootversion} eq "6.10.4"} {
-			puts $cfg "tflag=\"--template=${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/hsc2hs-0.67/template-hsc.h\""
-		} else {
-			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"
-		if { ${configure.build_arch} == "i386" && ${os.platform} == "darwin" && ${os.major} == 10 } {
-			puts $cfg "exec \$HSC2HSBIN --cflag=\"-m32\" --lflag=\"-m32\" \$tflag \$HSC2HS_EXTRA -I${prefix}/include --lflag=\"-L${prefix}/lib\" \${1+\"\$@\"}"
-		} else {
-			puts $cfg "exec \$HSC2HSBIN \$tflag \$HSC2HS_EXTRA -I${prefix}/include --lflag=\"-L${prefix}/lib\" \${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"
-	  	puts $cfg "#"
-	  	puts $cfg "SRC_HC_OPTS += -L${worksrcpath}/libffi"
-	  	puts $cfg "SRC_HC_OPTS += -I${prefix}/include -L${prefix}/lib"
-
-		if {[variant_isset maintainer_debug]} {
-			puts $cfg "SRC_HC_OPTS += -v -keep-tmp-files"
-		}
-
-	  	puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include --lflag=\"-L${prefix}/lib\""
-	  	puts $cfg "EXTRA_LD_OPTS += -L${worksrcpath}/libffi"
-	  	puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"
-		puts $cfg "EXTRA_CABAL_CONFIGURE_FLAGS += --extra-include-dirs=${prefix}/include"
-		puts $cfg "EXTRA_CABAL_CONFIGURE_FLAGS += --extra-lib-dirs=${prefix}/lib"
-
-		if {[variant_isset cabal_configure_debug]} then {
-			puts $cfg "EXTRA_CABAL_CONFIGURE_FLAGS += --verbose=3"
-		}
-
-		if { ${configure.build_arch} == "i386" && ${os.platform} == "darwin" && ${os.major} == 10 } {
-			puts $cfg "SRC_HC_OPTS += -optP-m32 -optc-m32 -opta-m32 -optl-m32"
-			puts $cfg "GHC_CC_OPTS += -optP-m32 -optc-m32 -opta-m32 -optl-m32"
-
-			puts $cfg "EXTRA_HSC2HC_OPTS += -optc-m32 -opta-m32 -optl-m32"
-
-			puts $cfg "EXTRA_CABAL_CONFIGURE_FLAGS += --ghc-option=-optP-m32"
-			puts $cfg "EXTRA_CABAL_CONFIGURE_FLAGS += --ghc-option=-optc-m32"
-			puts $cfg "EXTRA_CABAL_CONFIGURE_FLAGS += --ghc-option=-opta-m32"
-			puts $cfg "EXTRA_CABAL_CONFIGURE_FLAGS += --ghc-option=-optl-m32"
-		}
-
-	  	close $cfg
-}
-
-#bugs		GHC does not support DESTDIR. Instead, we install	\
-#		everything into ${destroot}${prefix}, and then fix up	\
-#		the five scripts which actually have the installation	\
-#		path hard coded.					\
-#									\
-#		The odd "ac_cv_lib_elf_nlist" environment variable	\
-#		is required to avoid including the wrong nlist.h	\
-#		header if libelf is installed on the system.
-
-configure.ldflags-append	"-L/usr/lib"
-configure.cflags-append		"-I${prefix}/include"
-configure.env-append	DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib	\
-			ac_cv_lib_elf_nlist=no
-
-configure.pre_args	--prefix=${destroot}${prefix}
-configure.args  --datadir=${destroot}${prefix}/share/${canonicalname}-${version}	\
-		--with-gmp-includes=${prefix}/include					\
-		--with-gmp-libraries=${prefix}/lib					\
-		--with-ghc='${workpath}/${canonicalname}-bootstrap/bin/ghc' 		\
-		--with-gcc=${configure.cc}
-
-# The configure script needs to be told the platform explicitly if we're on x86_64:
-if { ${configure.build_arch} == "x86_64" } {
-	configure.args-append	--build=x86_64-apple-darwin	\
-				--host=x86_64-apple-darwin	\
-				--target=x86_64-apple-darwin
-}
-
-build.env DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib
-
-destroot.destdir
-
-# Note that we catch the results of the tests, since usually at least
-# one of the tests unexpectedly fails.
-
-set testlog ${canonicalname}-${version}-tests.log
-
-test {
-     set testpath    ${worksrcpath}/testsuite-${version}
-     catch {system "cd ${testpath} && make stage=2 2>&1 | tee ${workpath}/${testlog}"}
-}
-
-
-post-destroot	{
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghc
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghc-${version}
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghci
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghci-${version}
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghc-pkg
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghc-pkg-${version}
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/haddock
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/hsc2hs
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/runghc
-
-	reinplace "s|\\\$@\"\}|\\\$@\"\} -L${prefix}/lib -I${prefix}/include |" ${destroot}${prefix}/bin/ghc
-	reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/lib/${canonicalname}-${version}/package.conf
-
-	file rename ${destroot}${prefix}/lib/${canonicalname}-${version}/libffi.a ${destroot}${prefix}/lib/${canonicalname}-${version}/libHsLocalFfi.a
-	reinplace s|"ffi"|"HsLocalFfi"| ${destroot}${prefix}/lib/${canonicalname}-${version}/package.conf
-
-        system "ranlib ${destroot}${prefix}/lib/ghc-${version}/*.a"
-
-	if {[file exists ${workpath}/${testlog}]} {
-		set testsavepath ${prefix}/share/${canonicalname}-${version}/tests
-		file mkdir  ${destroot}${testsavepath}
-		file rename ${workpath}/${testlog} ${destroot}${testsavepath}/${testlog}
-		ui_msg "Test results are saved in ${testsavepath}"
-	}
-}
-
-livecheck.type	regex
-livecheck.url	${homepage}
-livecheck.regex	"GHC (\[0-9\\.\]+) Released"
-

Added: trunk/dports/lang/ghc/files/ghc7040.patch
===================================================================
--- trunk/dports/lang/ghc/files/ghc7040.patch	                        (rev 0)
+++ trunk/dports/lang/ghc/files/ghc7040.patch	2012-08-20 21:42:48 UTC (rev 96883)
@@ -0,0 +1,18 @@
+diff --git rts/Linker.c rts/Linker.c
+index 171fbac..7e139dd 100644
+--- rts/Linker.c
++++ rts/Linker.c
+@@ -5765,8 +5765,13 @@ ocGetNames_MachO(ObjectCode* oc)
+ 
+         if((sections[i].flags & SECTION_TYPE) == S_ZEROFILL)
+         {
++#ifdef USE_MMAP
++            char * zeroFillArea = mmapForLinker(sections[i].size, MAP_ANONYMOUS, -1);
++            memset(zeroFillArea, 0, sections[i].size);
++#else
+             char * zeroFillArea = stgCallocBytes(1,sections[i].size,
+                                       "ocGetNames_MachO(common symbols)");
++#endif
+             sections[i].offset = zeroFillArea - image;
+         }
+ 

Added: trunk/dports/lang/ghc/files/patch-configure-disable-docbook-ps-and-pdf.diff
===================================================================
--- trunk/dports/lang/ghc/files/patch-configure-disable-docbook-ps-and-pdf.diff	                        (rev 0)
+++ trunk/dports/lang/ghc/files/patch-configure-disable-docbook-ps-and-pdf.diff	2012-08-20 21:42:48 UTC (rev 96883)
@@ -0,0 +1,11 @@
+--- configure.orig	2012-06-30 00:18:22.000000000 +0200
++++ configure	2012-06-30 00:19:19.000000000 +0200
+@@ -10401,6 +10401,8 @@
+     BUILD_DOCBOOK_PS=YES
+     BUILD_DOCBOOK_PDF=YES
+ fi
++BUILD_DOCBOOK_PS=NO
++BUILD_DOCBOOK_PDF=NO
+ 
+ 
+ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120820/24fe2c0e/attachment-0001.html>


More information about the macports-changes mailing list