# -*- 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        vmt udis86 1.7.2 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
categories          devel
maintainers         nomaintainer
supported_archs     i386 x86_64

description         Udis86 is a disassembler engine that interprets and decodes \
                    a stream of binary machine code bytes as opcodes defined in \
                    the x86 and x86-64 class of Instruction Set Architectures.

long_description    {*}${description} The core component of this project is \
                    libudis86 which provides a clean and simple interface \
                    to disassemble binary code, and to inspect the disassembly \
                    to various degrees of details. The library is designed to \
                    aid software projects that entail analysis and manipulation \
                    of all flavors of x86 binary code.

homepage            http://udis86.sourceforge.net/
license             BSD

checksums           rmd160  9a6e32651cb2ed36f2d6e0640b43c8cf6a3f9de5 \
                    sha256  e525c50207ab5fa57c0e176f676324b22bb5e4af6d07ddbe47e3c0c728290d45

universal_variant   no

use_autoreconf      yes

depends_lib         port:python27 \
                    port:yasm

patchfiles          patch-docdir.diff

configure.args      --with-yasm=${prefix}/bin/yasm \
                    --with-python=${frameworks_dir}/Python.framework/Versions/2.7/bin/python \
                    --enable-shared

post-destroot {
    if {[variant_isset docs]} {
        move ${worksrcpath}/docs/manual/html \
                ${workpath}/${destdir}${prefix}/share/doc/${name}/manual
    }
}

variant docs description {Compile HTML documentation (uses py27-sphinx)} {
    depends_build-append        port:py27-sphinx
    configure.args-append       --with-sphinx-build=${prefix}/bin/sphinx-build-2.7

    build.target-append         html

}
