# $Id$ PortSystem 1.0 name ghc version 6.8.3 categories lang maintainers gwright@macports.org 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. homepage http://haskell.org/ master_sites ${homepage}${name}/dist/${version}/ use_bzip2 yes distfiles ${name}-${version}-src.tar.bz2 \ ${name}-${version}-src-extralibs.tar.bz2 checksums ${name}-${version}-src.tar.bz2 \ md5 dfa31028b4d06d1d226f55fe3a2ab7b3 \ sha1 f908b0e0293014dde587abd8c7912eb490f9b3d2 \ rmd160 415cd144f0641a0c5887ad7325e2e775e93044f0 \ ${name}-${version}-src-extralibs.tar.bz2 \ md5 5ac72f5d5433151cf6b718dc6601dc41 \ sha1 800258df7d86f5538fd2cc54829e29e90183b882 \ rmd160 f701da7129075ae62dfb6c524efd39103f944ad3 \ patchfiles patch-configure.ac.diff \ patch-libraries-Makefile.diff \ patch-libraries-base-base.cabal.diff \ patch-libraries-base-base.buildinfo.in.diff \ patch-libraries-base-configure.ac.diff \ patch-libraries-base-aclocal.m4.diff \ patch-libraries-hpc-Setup.hs.diff \ patch-libraries-hpc-hpc.cabal.diff \ patch-libraries-hpc-hpc.buildinfo.in.diff \ patch-libraries-hpc-configure.ac.diff \ patch-libraries-hpc-aclocal.m4.diff depends_lib port:readline \ port:gmp # 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". # depends_run port:perl5.8 platform darwin 6 { pre-fetch { return -code error "${name} is not supported on Mac OS X 10.2.x (Jaguar)" } } platform darwin 7 { pre-fetch { return -code error "${name} is not supported on Mac OS X 10.3.x (Panther)" } } platform darwin 8 powerpc { global ghc_bootversion set ghc_bootversion 6.6.1 master_sites-append ${homepage}${name}/dist/${ghc_bootversion}/:bootstrap distfiles-append ${name}-${ghc_bootversion}-darwin-ppc-tiger-bootstrap.tar.bz2:bootstrap checksums-append ${name}-${ghc_bootversion}-darwin-ppc-tiger-bootstrap.tar.bz2 md5 0842380935d4ce3a2150976eff0f09a0 extract.only ${name}-${version}-src.tar.bz2 \ ${name}-${version}-src-extralibs.tar.bz2 \ ${name}-${ghc_bootversion}-darwin-ppc-tiger-bootstrap.tar.bz2 } platform darwin 8 i386 { global ghc_bootversion set ghc_bootversion 6.6 master_sites-append ${homepage}${name}/dist/${ghc_bootversion}/:bootstrap distfiles-append ${name}-${ghc_bootversion}-darwin-i386-tiger-bootstrap.tar.bz2:bootstrap checksums-append ${name}-${ghc_bootversion}-darwin-i386-tiger-bootstrap.tar.bz2 md5 f86c72775f1b1d07867c1e7be46af680 extract.only ${name}-${version}-src.tar.bz2 \ ${name}-${version}-src-extralibs.tar.bz2 \ ${name}-${ghc_bootversion}-darwin-i386-tiger-bootstrap.tar.bz2 } platform darwin 9 powerpc { global ghc_bootversion set ghc_bootversion 6.8.2 master_sites-append ${homepage}${name}/dist/${ghc_bootversion}/:bootstrap distfiles-append ${name}-${ghc_bootversion}-darwin-ppc-leopard-bootstrap.tar.bz2:bootstrap checksums-append ${name}-${ghc_bootversion}-darwin-ppc-leopard-bootstrap.tar.bz2 md5 2b24f840b8b1b6cb69b524aaa885aa59 patchfiles-append patch-PprMach.hs.diff extract.only ${name}-${version}-src.tar.bz2 \ ${name}-${version}-src-extralibs.tar.bz2 \ ${name}-${ghc_bootversion}-darwin-ppc-leopard-bootstrap.tar.bz2 } platform darwin 9 i386 { global ghc_bootversion set ghc_bootversion 6.8.2 master_sites-append ${homepage}${name}/dist/${ghc_bootversion}/:bootstrap distfiles-append ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2:bootstrap checksums-append ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2 md5 f263cedef8bcbaa7e9014b3e06923583 extract.only ${name}-${version}-src.tar.bz2 \ ${name}-${version}-src-extralibs.tar.bz2 \ ${name}-${ghc_bootversion}-darwin-i386-leopard-bootstrap.tar.bz2 } post-patch { reinplace "s|/opt/local|${workpath}/ghc-bootstrap|g" ${workpath}/ghc-bootstrap/lib/ghc-${ghc_bootversion}/package.conf reinplace "s|GHCBIN=/opt/local|GHCBIN=${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc reinplace "s|TOPDIROPT=-B/opt/local|TOPDIROPT=-B${workpath}/${name}-bootstrap|" ${workpath}/${name}-bootstrap/bin/ghc reinplace "s|-L/opt/local|-L${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc reinplace "s|-I/opt/local|-I${prefix}|" ${workpath}/${name}-bootstrap/bin/ghc reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-asm reinplace "s|/opt/local|${prefix}|" ${workpath}/${name}-bootstrap/lib/ghc-${ghc_bootversion}/ghc-split } pre-configure { system "autoreconf ${worksrcpath}" system "autoreconf ${worksrcpath}/libraries/base" system "autoreconf ${worksrcpath}/libraries/hpc" set cfg [open "${worksrcpath}/mk/build.mk" w] puts $cfg "#" puts $cfg "# Local configuration overrides for MacPorts" puts $cfg "#" puts $cfg "SRC_CC_OPTS += -I${prefix}/include" puts $cfg "SRC_HC_OPTS += -I${prefix}/include -L${prefix}/lib" puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include" puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib" 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. configure.ldflags-append "-L/usr/lib" configure.cflags-append "-I${prefix}/include" configure.env DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib configure.args --prefix=${destroot}${prefix} \ --mandir=${destroot}${prefix}/share/man/ \ --with-gmp-includes=${prefix}/include \ --with-gmp-libraries=${prefix}/lib \ --with-readline-includes=${prefix}/include \ --with-readline-libraries=${prefix}/lib \ --with-ghc='${workpath}/${name}-bootstrap/bin/ghc' variant no_opengl description {omit OpenGL support} { configure.args-append --disable-opengl configure.args-append --disable-glut } # The OpenAL variant does not work yet (see http://hackage.haskell.org/trac/ghc/ticket/2067) #variant openal description {include OpenAL support} { # configure.args-append --enable-openal # configure.args-append --enable-alut #} build { system "env DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib ${build.cmd}" } # This should not be necessary, but it seems to work around a bug # that exist at least in MP 1.600. destroot { system "cd ${worksrcpath} && ${destroot.cmd} ${destroot.target}" } post-destroot { reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghc reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghci reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghc-pkg reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/ghcprof reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/bin/hsc2hs reinplace "s|\\\$@\"\}|\\\$@\"\} -L${prefix}/lib -I${prefix}/include |" ${destroot}${prefix}/bin/ghc reinplace s|${destroot}${prefix}|${prefix}|g ${destroot}${prefix}/lib/${name}-${version}/package.conf system "ranlib ${destroot}${prefix}/lib/ghc-${version}/*.a" }