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

PortSystem          1.0
PortGroup           github 1.0

github.setup        dlbeer mspdebug 0.25 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            3
maintainers         {@edilmedeiros gmail.com:jose.edil+macports} \
                    openmaintainer

categories          devel cross
description         MSPDebug is a free debugger for use with MSP430 MCUs.
long_description    MSPDebug is a free debugger for use with MSP430 MCUs. \
                    It supports FET430UIF, eZ430, RF2500, Launchpad and Olimex \
                    MSP-JTAG-TINY programmers. It can be used as a proxy for gdb \
                    or as an independent debugger with support for programming, \
                    disassembly and reverse engineering.

license             GPL-2+

homepage            https://dlbeer.co.nz/mspdebug/

checksums           ${distname}${extract.suffix} \
                    rmd160  18cfcf737205ab78119a12ebad27ec051487ac5f \
                    sha256  a1a3620de6a86128ad03938ef2eda6d57e7b320b2361cd35aec10ad5d3080215 \
                    size    333977

depends_build       port:pkgconfig
depends_lib         port:hidapi \
                    port:libusb-compat \
                    port:readline \
                    port:libmsp430

patchfiles          patch-Makefile.diff \
                    patch-Makefile-define_flag.diff \
                    fix-dynlib-load.diff

use_configure       no

variant universal   {}

build.args-append   CC="${configure.cc} [get_canonical_archflags]" PREFIX=${prefix}

destroot.env-append PREFIX=${prefix}

platform darwin 8 {
    depends_build-append \
                    port:gmake
    build.cmd       ${prefix}/bin/gmake
}
