# $Id: Portfile,v 1.6 2004/01/06 07:18:01 jkh Exp $ PortSystem 1.0 name ghc version 6.2 categories lang maintainers gwright@comcast.net 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://www.haskell.org/ghc/ master_sites ${homepage}/dist/${version}/:source \ ${homepage}/dist/6.0.1/MacOSX/:bootstrap \ http://distfiles.opendarwin.org/:bootstrap use_bzip2 yes distfiles ${name}-${version}-src.tar.bz2:source \ ${name}-6.0.1-darwin-bootstrap.tar.bz2:bootstrap checksums ghc-${version}-src.tar.bz2 md5 cc495e263f4384e1d6b38e851bf6eca0 \ ghc-6.0.1-darwin-bootstrap.tar.bz2 md5 280afe385405fa437ae274bfab2c3250 patchfiles patch-configure.ac depends_lib lib:libreadline.4:readline lib:libgmp.3:gmp \ lib:libdl:dlcompat #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. pre-configure { set cfg [open "${worksrcpath}/mk/build.mk" w] puts $cfg "#" puts $cfg "# Local configuration overrides for DarwinPorts" puts $cfg "#" puts $cfg "ReadlineIncludePath=${prefix}/include" puts $cfg "SRC_CC_OPTS += -I${prefix}/include" puts $cfg "SRC_HC_OPTS += -I${prefix}/include -L${prefix}/lib" puts $cfg "SRC_HC_OPTS += -pgmP \"gcc3 -E -traditional\"" puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include" puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib" close $cfg cd ${workpath}/${name}-bootstrap/bin reinplace "s|/usr/local|${workpath}/${name}-bootstrap|" ghc } use_autoconf yes configure.env LDFLAGS="-L${prefix}/lib" CPPFLAGS="-I${prefix}/include" \ CFLAGS="-I${prefix}/include" configure.args --prefix=${destroot}/${prefix} \ --mandir=${destroot}/${prefix}/share/man/ \ --with-ghc='${workpath}/${name}-bootstrap/bin/ghc -pgmP \"gcc3 -E -traditional\"' \ --with-gcc=gcc3 \ variant opengl { configure.args-append --enable-hopengl } 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|" ${destroot}/${prefix}/bin/ghc }