# -*- 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
PortGroup           legacysupport 1.1
PortGroup           openssl 1.0

# clock_gettime
legacysupport.newest_darwin_requires_legacy 15

github.setup        stefanberger libtpms 0.10.2 v
revision            0
categories          devel
maintainers         nomaintainer
license             IBM Corporation
description         Emulation of a Trusted Platform Module Library
long_description    The libtpms library provides software emulation of a Trusted Platform Module (TPM 1.2 and TPM 2.0)
github.tarball_from archive
checksums           rmd160  21c3efc868077d6b108eb38193a4a4c179f982b1 \
                    sha256  edac03680f8a4a1c5c1d609a10e3f41e1a129e38ff5158f0c8deaedc719fb127 \
                    size    1399529

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    path:bin/pkg-config:pkgconfig

configure.pre_args-append \
                    --with-openssl \
                    --with-tpm2

configure.args-append \
                    --disable-silent-rules

configure.cmd       ./autogen.sh

# VerifyConfiguration.h:72: error: expected declaration specifiers or '...' before '(' token
compiler.blacklist-append \
                    *gcc-4.*

# RunCommand.c:105:1: error: 'noreturn' function does return [-Werror]
# cc1: note: unrecognized command-line option '-Wno-self-assign' may have been intended to silence earlier diagnostics
if {[string match *gcc* ${configure.compiler}]} {
    patchfiles-append \
                    patch-gcc.diff
}

build.target
