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

# Need strndup()
PortGroup           legacysupport 1.0
legacysupport.newest_darwin_requires_legacy 10

name                uboot-tools
github.setup        u-boot u-boot 2020.10 v
revision            1
github.tarball_from archive
license             GPL-2
categories          devel
platforms           darwin
maintainers         {@rdbisme gmail.com:rubendibattista} openmaintainer
description         Binary tools for U-Boot.
long_description    U-Boot is a boot loader for Embedded boards based on \
                    PowerPC, ARM, MIPS and several other processors. This \
                    port compiles some binary tools that can be used to \
                    deploy u-boot on embedded devices.

checksums           rmd160  25357e70695de9aac1cee2a752cb4fd82def66ed \
                    sha256  0c022ca6796aa8c0689faae8b515eb62ac84519c31de3153257a9ee0f446618f \
                    size    20176030

depends_build       port:gmake

depends_lib         path:lib/libssl.dylib:openssl

compiler.c_standard 2011

configure.cmd       gmake defconfig
configure.pre_args

build.target        tools
build.cmd           gmake
build.args-append   KBUILD_HOSTCFLAGS=-I${prefix}/include

destroot {
    set bindir ${destroot}${prefix}/bin
    set mandir ${destroot}${prefix}/share/man/man1

    xinstall -m 755 -W ${worksrcpath}/tools mkimage dumpimage ${bindir}
    
    xinstall -m 644 -W ${worksrcpath}/doc mkimage.1 ${mandir}
}
