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

openssl.branch      3

github.setup        cossacklabs themis 0.15.7
revision            0
categories          security devel crypto
license             Apache-2
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         General purpose cryptographic library for storage and messaging
long_description    {*}${description}
homepage            https://www.cossacklabs.com/themis
checksums           rmd160  609fc91bc2b56463d40b1a2a948d36a855eace00 \
                    sha256  f71121a7aa9b5c3dc30c5cae59ec1da684fa35c028be214ab0578c93e499fe09 \
                    size    12499137
github.tarball_from archive

# https://github.com/cossacklabs/themis/issues/1066
patchfiles          patch-build.diff

post-patch {
    reinplace "s|/usr/local|${prefix}|g" ${worksrcpath}/Makefile
}

depends_build-append \
                    path:libexec/gnubin/mktemp:coreutils \
                    path:bin/pkg-config:pkgconfig

compiler.blacklist-append \
                    *gcc-4.* {clang < 500}

configure.env-append \
                    OPENSSL_INSTALL_PATH=[openssl::install_area]
build.env-append    ENGINE=openssl \
                    OPENSSL_INSTALL_PATH=[openssl::install_area] \
                    PATH=${prefix}/libexec/gnubin:${prefix}/bin:${prefix}/sbin:/usr/bin:/usr/sbin:/bin:/sbin
build.cmd-prepend   CC=${configure.cc} CXX=${configure.cxx}
destroot.env        ENGINE=openssl \
                    OPENSSL_INSTALL_PATH=[openssl::install_area] \
                    PATH=${prefix}/libexec/gnubin:${prefix}/bin:${prefix}/sbin:/usr/bin:/usr/sbin:/bin:/sbin
