# -*- 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
# $Id: Portfile 117364 2014-02-24 14:06:05Z g5pw@macports.org $

PortSystem          1.0
PortGroup           github 1.0

github.setup        radare radare2 0.9.6
categories          devel
platforms           darwin
license             LGPL-3+
maintainers         g5pw openmaintainer
description         Opensource tools to disasm, debug, analyze and manipulate binary files.
long_description    ${name} provides ${description}.
homepage            http://radare.org

checksums           rmd160  644125784c46b0ab41a91d6c9c904cd3f3e72f0d \
                    sha256  a15827380a4a530810dbda8d7da026e774e5067c592b630143522fdc09470824

# Patch the fixed (and strangely disabled) arch flags. Will talk with the developers 
# to integrate this in the build process.
patchfiles          gcc.mk.patch

post-patch {
    reinplace "s/__ARCH__/${configure.build_arch}/" ${worksrcpath}/mk/gcc.mk
}

configure.args-append \
                    --without-ewf
                    # --with-sysmagic # For some strange reason, system's magic doesn't work.

variant ewf description {Use EWF library} {
    depends_lib-append \
                    port:libewf
    
    configure.args-delete \
                    --without-ewf
}

variant openssl description {Use OpenSSL library} {
    depends_lib-append \
                    port:openssl

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

default_variants    +ewf +openssl
