# $Id: Portfile 92209 2012-04-22 00:12:06Z jeremyhu@macports.org $

PortSystem              1.0
name                    cctools-headers
version                 822
revision                2
set xnu_headers_version 1699.24.8
categories              devel
platforms               darwin
maintainers             mfeiri jeremyhu openmaintainer
license                 APSL-2.0
description             Headers for compiler on Mac OS X and Darwin
long_description        A set of essential headers for compiler on Mac OS X \
                        and Darwin. Similar to binutils on other platforms.

homepage                http://opensource.apple.com/source/cctools/
master_sites            http://opensource.apple.com/tarballs/cctools/:cctools \
                        http://opensource.apple.com/tarballs/xnu/:xnu

distname                cctools-${version}
distfiles               cctools-${version}.tar.gz:cctools xnu-${xnu_headers_version}.tar.gz:xnu

checksums               cctools-${version}.tar.gz \
                        rmd160  1caf207acbf421cdc975926a392fc75dc1d2594c \
                        sha256  dfaa9bdbd023524d47429674f64d2d5ea393123dabf90868be0aa17f61f45289 \
                        xnu-${xnu_headers_version}.tar.gz \
                        rmd160  18051c3cb9fca5cecc966306d76b91310bf1e9ff \
                        sha256  4268ce69799db51f1b48e400b6fa6a7041b266a1a5404034398aa51b7084b269

supported_archs         noarch
universal_variant       no
use_configure           no
build {}

destroot.args           DSTROOT=${destroot}${prefix} RC_ProjectSourceVersion=${version}
destroot.target         installhdrs

post-destroot {
    file rename -force ${destroot}${prefix}/usr/include ${destroot}${prefix}/
    file delete -force ${destroot}${prefix}/usr

    # cctools has older versions of the mach headers, so we get more recent
    # versions from xnu.  Note that machine/vm_types.h is still obtained
    # from the HOST SDK.  This just provides updated macros for new
    # architecture types.
    xinstall -d -m 755 ${destroot}${prefix}/include/mach
    xinstall -m 644 ${workpath}/xnu-${xnu_headers_version}/osfmk/mach/machine.h ${destroot}${prefix}/include/mach
}

livecheck.type          regex
livecheck.regex         "cctools-(\[\\d.\]+)"
