# $Id: Portfile 104661 2013-03-30 23:56:42Z mfeiri@macports.org $

PortSystem              1.0
name                    CarbonHeaders
version                 18.1
set xnu_headers_version 2050.18.24
categories              devel
platforms               darwin
maintainers             mfeiri openmaintainer
license                 APSL-2
description             Essential preprocessor definitions for OS X and Darwin
long_description        A set of headers with essential preprocessor \
                        definitions for Mac OS X and Darwin.

homepage                http://opensource.apple.com/source/${name}/
master_sites            http://opensource.apple.com/tarballs/CarbonHeaders/:CarbonHeaders \
                        http://opensource.apple.com/tarballs/xnu/:xnu

distfiles               ${distname}.tar.gz:CarbonHeaders \
                        xnu-${xnu_headers_version}.tar.gz:xnu

checksums               ${distname}.tar.gz \
                        rmd160  b9bb7659da27a90cc469a89cd82d88b3b7e6774d \
                        sha256  5961f9b951c9905b78aab87e0dba1d85a9352bfee6509b9337b9b343501255fd \
                        xnu-${xnu_headers_version}.tar.gz \
                        rmd160  e54a424b8b0dfe7d3a6f1305b64659d7b9e1ecbf \
                        sha256  5d018b33efd9eebb05142958432b9a5058febe04a3b92ba5a16a285490a83445

supported_archs         noarch
universal_variant       no
use_configure           no

build {
    foreach s "@CONFIG_EMBEDDED@ @CONFIG_IPHONE@ @CONFIG_IPHONE_SIMULATOR@" {
        reinplace "s|${s}|0|g" ${worksrcpath}/TargetConditionals.h
    }
}

destroot {
    foreach x "AssertMacros TargetConditionals" {
        xinstall -m 644 ${worksrcpath}/${x}.h ${destroot}${prefix}/include/
    }

    foreach y "Availability AvailabilityInternal AvailabilityMacros" {
        xinstall -m 644 \
            ${workpath}/xnu-${xnu_headers_version}/EXTERNAL_HEADERS/${y}.h \
            ${destroot}${prefix}/include/
    }
}

livecheck.type          regex
livecheck.regex         "${name}-(\[\\d.\]+)"
