# $Id: Portfile 116228 2014-01-21 22:07:14Z mfeiri@macports.org $

PortSystem              1.0
name                    CarbonHeaders
version                 18.1
set xnu_headers_version 2422.1.72
revision                1
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  6471a5a0ec5bf48ebba2630dbcb034f9f628210c \
                        sha256  fbefe23943d0c4c12b3d7abd3f304224176f269b19ef6ad801314bc69cf773db

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 "TargetConditionals" {
        xinstall -m 644 ${worksrcpath}/${x}.h ${destroot}${prefix}/include/
    }

    foreach y "AssertMacros 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.\]+)"
