# -*- 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
PortGroup               python 1.0
PortGroup               github 1.0

github.setup            trolldbois ctypeslib 2.2.2
name                    py-ctypeslib2
python.versions         27 37 38 39
python.default_version  39
platforms               darwin
license                 MIT
maintainers             {eborisch @eborisch} \
                        openmaintainer
supported_archs         noarch

description             Generate python ctypes classes from C headers.

long_description        This fork of ctypeslib is mainly about using the \
                        libclang >= 3.7 python bindings to generate python \
                        code from C source code, instead of gccxml.

checksums \
    rmd160  f99e20769f606d44ddb34aff6e20183fd186aaa2 \
    sha256  e968d0c60101fdebbd51f392bd6402e5bad415fa62dff23de79cc467d24c1eee \
    size    76273

if {${name} ne ${subport}} {
    depends_build-append    port:py${python.version}-setuptools
    depends_lib-append      port:py${python.version}-clang

    post-destroot {
        set DOCDIR ${destroot}${prefix}/share/doc/${subport}
        xinstall -d ${DOCDIR}
        foreach dfile {CHANGES.md LICENSE.txt README.md docs} {
            file copy ${worksrcpath}/${dfile} ${DOCDIR}
        }
    }
}

foreach {old} {34 35 36} {
    subport py${old}-${python.rootname} "
        replaced_by py${python.default_version}-${python.rootname}
        PortGroup obsolete 1.0

    "
}
