# -*- 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

PortSystem          1.0

name                ghc-ppc-bootstrap
set canonicalname   ghc
version             7.0.1
revision            1
categories          lang haskell
maintainers         
license             BSD
platforms           darwin
supported_archs     ppc
universal_variant   no
installs_libs       no

description         The Glorious Glasgow Haskell Compilation System
long_description    \
                    This is a package that installs a binary \
                    bootstrap ghc compiler.

homepage            http://haskell.org/${canonicalname}
master_sites        https://downloads.haskell.org/~ghc/7.0.1/maeder/
distname            ${canonicalname}-${version}-powerpc-apple-darwin
worksrcdir          ${canonicalname}-${version}
use_bzip2           yes

checksums           rmd160  6ab2d286214b2ce94684e0cdb1a78395861e76e6 \
                    sha256  6ca12ddec727f0a65d912ddd729517431867beac336241f376dd6305b158da94 \
                    size    151804757

default_variants    +gcc42

compiler.blacklist  *clang*

configure.pre_args    --prefix=${prefix}/share/ghc-ppc-bootstrap

variant gcc42 {
		configure.compiler gcc-4.2
}

variant gcc7 {
		configure.compiler macports-gcc-7
}

platform darwin 9 powerpc {
		configure.args-append --with-macosx-deployment-target=10.5
}

platform darwin 10 powerpc {
		configure.args-append --with-macosx-deployment-target=10.5
}

pre-configure {
    # OK so because this binary has been prebuilt for libraries
    # in /usr/lib we search these before macports stuff so (hopefully)
    # weird things don't happen
    configure.ldflags  -L/usr/lib
    configure.cppflags -I/usr/include
}

build {}

post-destroot {
    # Delete dylibs; they aren't used by the bootstrap ghc and are incorrectly
    # linked against /usr/local, causing rev-upgrade to complain.
    fs-traverse f ${destroot}${prefix} {
        if {[file isfile ${f}]} {
            if {[file extension ${f}] == ".dylib"} {
                delete ${f}
            }
        }
    }
}

livecheck.type      none