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

# memmem
legacysupport.newest_darwin_requires_legacy 10

name                ocaml-base_bigstring
github.setup        janestreet base_bigstring 0.16.0 v
revision            1
categories          ocaml devel
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             MIT
description         String type based on Bigarray, for use in I/O and C-bindings
long_description    ${description}

checksums           rmd160  ea1c1c3860888481185c3d2fd92f7892856a2de3 \
                    sha256  8a2d60fe0a544e2d69ed0a9eac8c2fbb9726f46578ff3c41ff34028ac812cb66 \
                    size    19275
github.tarball_from archive

# memmem is unavailable prior to 10.7:
# base_bigstring_stubs.c: warning: implicit declaration of function 'memmem'; did you mean 'memset'?
# Use legacysupport to provide it.
if {${os.platform} eq "darwin" && ${os.major} < 11} {
    patchfiles      patch-memmem.diff

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

depends_lib-append  port:ocaml-base \
                    port:ocaml-int_repr \
                    port:ocaml-ppx_jane

ocaml.build_type    dune
