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

github.setup        capstone-engine capstone 5.0.6
github.tarball_from archive
revision            0
categories          devel
maintainers         {gmail.com:aquynh @aquynh} \
                    openmaintainer
license             BSD

description         Capstone disassembly engine

long_description    Capstone is a multi-arch, multi-platform disassembly framework with advanced features

homepage            https://www.capstone-engine.org/

checksums           rmd160  a9b5974882d8ef9c2d91a627f8e5d1bfc3d295e2 \
                    sha256  240ebc834c51aae41ca9215d3190cc372fd132b9c5c8aa2d5f19ca0c325e28f9 \
                    size    7653660

compiler.blacklist-append \
                    *gcc-4.0 *gcc-4.2 {clang < 400}

patch.pre_args-replace  -p0 -p1
patchfiles          patch-Makefile.diff

use_configure       no

universal_variant   yes

build.env           CC=${configure.cc} \
                    CFLAGS=${configure.cflags} \
                    LDFLAGS=${configure.ldflags} \
                    PREFIX=${prefix} \
                    V=1

pre-build {
    build.args-append \
                    LIBARCHS="[get_canonical_archs]"
}

destroot.env        {*}${build.env}

github.livecheck.regex  {([0-9.]+)}
