# -*- 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           muniversal 1.0
PortGroup           compiler_blacklist_versions 1.0

name                libressl
version             3.8.2
revision            0
categories          security devel
platforms           darwin
license             OpenSSL SSLeay
maintainers         {@artkiver gmail.com:artkiver} {cal @neverpanic} openmaintainer

description         LibreSSL SSL/TLS cryptography library
long_description    LibreSSL is composed of four parts: \
                    The openssl(1) utility, which provides tools for managing keys, certificates, etc. \
                    libcrypto: a library of cryptography fundamentals \
                    libssl: a TLS library, backwards-compatible with OpenSSL \
                    libtls: a new TLS library, designed to make it easier to write foolproof applications \
                    This port tracks the stable releases, for development releases please use libressl-devel.
homepage            https://www.libressl.org

conflicts           openssl libressl-devel

master_sites        openbsd:LibreSSL
checksums           rmd160  997d7f3cbe696e8fe55fd88fdcaf06a32b594f76 \
                    sha256  6d4b8d5bbb25a1f8336639e56ec5088052d43a95256697a85c4ce91323c25954 \
                    size   4473978

patchfiles          patch-openssldir-cert.pem.diff

configure.args \
    --disable-silent-rules \
    --with-openssldir=${prefix}/etc/ssl

post-patch {
    reinplace "s|@OPENSSLDIR@|${prefix}/etc/ssl|" ${worksrcpath}/include/openssl/opensslconf.h
}

compiler.blacklist {clang < 100}

# HOST_ASM_MACOSX_X86_64 gets set when building i386 on x86_64
set merger_configure_args(i386)     --disable-asm

platform darwin {
    if {${os.major} < 10} {
        configure.cppflags-append -DIPV6_TCLASS=36
    }
}

livecheck.type      regex
livecheck.url       https://www.libressl.org/
livecheck.regex     "The latest stable release is (\\d+\\.\\d+\\.\\d+)"
