# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=portfile:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           conflicts_build 1.0
PortGroup           github 1.0

github.setup        radareorg radare2 6.1.6
github.tarball_from archive
revision            0
categories          devel
license             LGPL-3+
maintainers         {i0ntempest @i0ntempest} openmaintainer
description         Opensource tools to disasm, debug, analyze and manipulate binary files.
long_description    ${name} provides {*}${description}.
homepage            https://www.radare.org/

depends_build       port:pkgconfig \
                    port:git

depends_lib         port:capstone \
                    port:zlib \
                    port:libzip

conflicts_build     ${name}

checksums           rmd160  3546d301eaf1580750a691730f17fa627e5b6239 \
                    sha256  7370c52cb22cba3ab02ee77970fd258a8ecdbf3fd3282f2647ff12393c6ae8ac \
                    size    11915420

configure.args-append \
                    --with-syscapstone \
                    --with-syszip

if {[string match *clang* ${configure.compiler}]} {
    configure.args-append \
                    --with-compiler=clang
} elseif {[string match *gcc* ${configure.compiler}]} {
    configure.args-append \
                    --with-compiler=gcc
}

build.env-append    HOST_CC=${configure.cc}


variant openssl description {Use OpenSSL library} {
    depends_lib-append \
                    path:lib/libssl.dylib:openssl

    configure.args-append \
                    --with-openssl
}

default_variants    +openssl
