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

github.setup        DeVaukz MachO-Explorer e82b6e6136f4312422c276762e837fe853030547
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version             20200905
revision            0
categories          sysutils
maintainers         nomaintainer
license             MIT

description         A graphical Mach-O viewer for macOS. Powered by Mach-O Kit.

long_description    {*}${description}

# Has a submodule that isn't included in the release tarballs.
fetch.type          git

depends_build-append \
                    port:git

if {${os.platform} eq "darwin" && ${os.major} < 18} {
    pre-fetch {
        ui_error "${name} requires at least macOS 10.15 Catalina"
        return -code error "incompatible macOS version"
    }
    known_fail  yes
}

post-fetch {
    system -W ${worksrcpath} "git submodule update --init --recursive"
}

patchfiles          MachOKit-miscapitalization.diff \
                    no-code-sign.diff

destroot {
    copy ${worksrcpath}/build/Release/MachOExplorer.app ${destroot}${applications_dir}

    xinstall -d -m 0755 ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 -W ${worksrcpath} ReadMe.md LICENSE ${destroot}${prefix}/share/doc/${name}
}
