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

name                class-dump
version             3.5
categories          devel
license             GPL-2+
platforms           {darwin >= 12}
maintainers         nomaintainer

description         Utility for examining the Objective-C segment of \
                    Mach-O files.
long_description    It generates declarations for the classes, \
                    categories and protocols. This is the same \
                    information provided by using 'otool -ov', \
                    but presented as normal Objective-C declarations.
homepage            http://stevenygard.com/projects/class-dump/

master_sites        http://stevenygard.com/download/
use_bzip2           yes
checksums           rmd160  408c0baf4d384007310761585caff5e9c31a331f \
                    sha256  eb9df1b697c02f66f84f93510772cdf434b63c6d79ee23528d24ac208c1a52f2 \
                    size    251500

# error: -fobjc-arc is not supported on platforms using the legacy runtime
supported_archs     x86_64 arm64

depends_lib         port:openssl

worksrcdir          ${distname}/src

xcode.target        class-dump deprotect

xcode.configuration Release
xcode.destroot.path ${prefix}/bin
xcode.build.settings    HEADER_SEARCH_PATHS=${prefix}/include \
                        LIBRARY_SEARCH_PATHS=${prefix}/lib
xcode.destroot.settings {*}${xcode.build.settings}

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 ${worksrcpath}/../README.md ${destroot}${docdir}

    delete ${destroot}${prefix}/bin/libMachObjC.a
}

livecheck.type  regex
livecheck.url   ${homepage}changes/
livecheck.regex {Version (\d+(?:\.\d+)*) -}
