# -*- 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           ocaml 1.1

name                ocaml-cryptokit
set ck_version      1.21.1
github.setup        xavierleroy cryptokit [string map {. ""} $ck_version] release
version             $ck_version
revision            0
epoch               1

categories          ocaml devel security
license             LGPL-2
maintainers         {landonf @landonf} openmaintainer
description         OCaml interface to cryptographic functions.
long_description    The Cryptokit library for OCaml provides a variety \
                    of cryptographic primitives that can be used to implement \
                    cryptographic protocols in security-sensitive applications.
checksums           rmd160  b0fb9f7de8a42680f9fb6e47500861df5a44202e \
                    sha256  186fda8b2063882688e1c2621c8234c35acdf4e10cfdd3213ee04bef16902953 \
                    size    170096
github.tarball_from archive

if {${os.platform} eq "darwin" && ${os.major} < 16} {
    PortGroup       legacysupport 1.1

    patchfiles-append \
                    patch-stubs-rng.c.diff

    post-patch {
        reinplace "s,@PREFIX@,${prefix}," ${worksrcpath}/src/dune
    }
}

depends_build-append \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:gmp \
                    port:ocaml-dune-configurator \
                    port:ocaml-zarith \
                    port:zlib

ocaml.build_type    dune
