ghc version 6.6.1 for Mac OS X 10.5 Leopard
Friday the 16th of May, 2008

    ghc  most recent diff


      View the most recent changes for the ghc port at: ghc.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for ghc.
      The raw portfile for ghc 6.6.1 is located here:
      http://ghc.darwinports.com/dports/lang/ghc/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/ghc
      Google
      Web Darwinports.com



      # $Id: Portfile 33042 2008-01-17 04:57:58Z ryandesign macports.org $

      PortSystem 1.0
      Name: ghc
      Version: 6.6.1
      Category: lang
      Maintainers: gwright macports.org
      Platform: 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}/

      use_bzip2 yes

      distfiles ${name}-${version}-src.tar.bz2 ${name}-${version}-src-extralibs.tar.bz2

      checksums ${name}-${version}-src.tar.bz2 md5 ba9f4aec2fde5ff1e1548ae69b78aeb0 ${name}-${version}-src-extralibs.tar.bz2 md5 43a26b81608b206c056adc3032f7da2a

      patchfiles patch-configure.ac patch-GHC.hs patch-package.conf.in

      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 {
      return -code error "${name} is not supported on Mac OS X 10.2.x (Jaguar)"
      }


      platform darwin 7 powerpc {
      global ghc_bootversion
      set ghc_bootversion 6.4

      master_sites-append ${homepage}/dist/${ghc_bootversion}/MacOSX/:bootstrap

      distfiles-append ${name}-${ghc_bootversion}-darwin-bootstrap-v01.tar.bz2:bootstrap

      checksums-append ${name}-${ghc_bootversion}-darwin-bootstrap-v01.tar.bz2 md5 3a0a79ed656cb619dd69a24cab32ba97

      extract.only ${name}-${version}-src.tar.bz2 ${name}-${version}-src-extralibs.tar.bz2 ${name}-${ghc_bootversion}-darwin-bootstrap-v01.tar.bz2

      # The following is required because ghc triggers a long-standing bug
      # in make 3.79 and earlier. (3.79 is standard on Panther.) The bug causes
      # make to fall into an infinite loop. (Not required on Tiger.)

      depends_build port:gmake

      # The bootstrap compiler requires version 5.0 of readline. Ugh.

      depends_lib-append port:readline-5

      pre-configure {
      system "cd ${worksrcpath} && autoreconf"

      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 -I/usr/include -L${prefix}/lib -L/usr/lib"
      puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"
      puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"
      puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"
      close $cfg

      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
      }

      configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc'
      build.cmd gmake
      }


      platform darwin 8 powerpc {
      global ghc_bootversion
      set ghc_bootversion 6.4

      master_sites-append ${homepage}/dist/${ghc_bootversion}/MacOSX/:bootstrap

      distfiles-append ${name}-${ghc_bootversion}-darwin-bootstrap-tiger.tar.bz2:bootstrap

      checksums-append ${name}-${ghc_bootversion}-darwin-bootstrap-tiger.tar.bz2 md5 1665720d4d35cf89b9efa7865d0228f6

      extract.only ${name}-${version}-src.tar.bz2 ${name}-${version}-src-extralibs.tar.bz2 ${name}-${ghc_bootversion}-darwin-bootstrap-tiger.tar.bz2

      pre-configure {
      system "cd ${worksrcpath} && autoreconf"

      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 -I/usr/include -L${prefix}/lib -L/usr/lib"
      puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"
      puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"
      puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"
      close $cfg

      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
      }

      configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc'
      }


      platform darwin 8 i386 {
      global ghc_bootversion
      set ghc_bootversion 6.6

      master_sites-append ${homepage}/dist/${ghc_bootversion}/:bootstrap

      distfiles-append ${name}-${ghc_bootversion}-i386-apple-darwin-bootstrap.tar.bz2:bootstrap

      checksums-append ${name}-${ghc_bootversion}-i386-apple-darwin-bootstrap.tar.bz2 md5 0cb6d89efb0694a28b34bec0f04d8c62

      extract.only ${name}-${version}-src.tar.bz2 ${name}-${version}-src-extralibs.tar.bz2 ${name}-${ghc_bootversion}-i386-apple-darwin-bootstrap.tar.bz2

      pre-configure {
      system "cd ${worksrcpath} && autoreconf"

      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 -I/usr/include -L${prefix}/lib -L/usr/lib"
      puts $cfg "EXTRA_HSC2HS_OPTS += -I${prefix}/include"
      puts $cfg "EXTRA_LD_OPTS += -L${prefix}/lib"
      puts $cfg "EXTRA_LD_OPTS += -L/usr/lib"
      close $cfg

      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
      }

      configure.args-append --with-ghc='${workpath}/${name}-bootstrap/bin/ghc'
      }


      #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-readline-includes=${prefix}/include --with-readline-libraries=${prefix}/lib --disable-openal --disable-alut

      Variant: noopengl { configure.args-append --disable-hopengl }

      build {
      system "env DYLD_FALLBACK_LIBRARY_PATH=${prefix}/lib ${build.cmd} ${build.target}"
      }



      # Note the middle "/" in the ${destroot}/${prefix} pattern. It is required,
      # because the actual text we are trying to match has a "//" between the
      # destroot and the prefix pieces.

      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 "cd ${destroot}${prefix}/lib/ghc-${version} && ranlib *.a"
      }

    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/ghc
      % sudo port install ghc
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching ghc
      ---> Verifying checksum for ghc
      ---> Extracting ghc
      ---> Configuring ghc
      ---> Building ghc with target all
      ---> Staging ghc into destroot
      ---> Installing ghc
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using ghc with these commands:
      %  man ghc
      % apropos ghc
      % which ghc
      % locate ghc

     Where to find more information:

    Darwin Ports



    image test