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

# Minimum requirement:
openssl.branch      3

github.setup        open-quantum-safe oqs-provider 0.11.0
revision            0
categories          security
license             MIT
maintainers         nomaintainer
description         OpenSSL 3 provider containing post-quantum algorithms
long_description    {*}${description}
homepage            https://openquantumsafe.org
# Normal fetch via PG does not work for some reason.
master_sites        https://github.com/open-quantum-safe/oqs-provider/archive/refs/tags/
distname            ${version}
checksums           rmd160  d845fa3a6ca464e07536192236871408aea99500 \
                    sha256  08b675c184042fc9c13d4fcee3476f07c86b5062a6d72d4e0fc8c8af2801232c \
                    size    234903
github.tarball_from archive

depends_lib-append  port:liboqs

compiler.c_standard 2011

configure.args-append \
                    -DBUILD_TESTING=ON

configure.pre_args-replace \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF

# Incompatible with dynamic library build.
variant static description "Build statically" {
    configure.args-append \
                    -DOQS_PROVIDER_BUILD_STATIC=ON
}

# FIXME: tests do not work atm, to be investigated.
test.env-append     OPENSSL_INSTALL=[openssl::install_area]
test.run            yes

# Some port-install set-up is needed. See, for example:
# https://www.netmeister.org/blog/netbsd-pqc.html
