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

gitlab.setup        matrix-org olm 3.2.16
gitlab.instance     https://gitlab.matrix.org
categories          devel security
maintainers         nomaintainer
description         An implementation of the Double Ratchet cryptographic ratchet in C++
long_description    An implementation of the Double Ratchet cryptographic ratchet described by \
                    https://whispersystems.org/docs/specifications/doubleratchet/, written in C \
                    and C++11 and exposed as a C API.

license             Apache-2

checksums           rmd160  d7353d01ec77d810f5d8455f520b1b821f79492c \
                    sha256  327cfcb81ef0c42f4b1d5c24b25d56932b57d64ccd9f00ed919a893a43333411 \
                    size    2744360

patchfiles          patch-CMakeLists-enable-pkgconfig.diff

# https://github.com/matrix-org/olm/issues/96
patchfiles-append   patch-doctest.diff

compiler.cxx_standard 2011
# block compilers that do not support thread-local storage.
compiler.thread_local_storage yes

if {${name} eq ${subport}} {
    PortGroup       cmake 1.1

}

set python.versions {39 310 311 312}

foreach v ${python.versions} {
    subport py${v}-${name} {
        PortGroup       python 1.0

        categories      devel security python
        python.version  ${v}
        description     ${name} bindings for Python ${python.branch}
        long_description \
                        {*}${description}

        depends_lib-append \
                        port:${name}

        depends_build-append \
                        port:py${python.version}-setuptools

        depends_run-append \
                        port:py${python.version}-cffi \
                        port:py${python.version}-future

        build.dir       ${worksrcpath}/python
    }
}
