# -*- 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-ocaml_intrinsics
github.setup        janestreet ocaml_intrinsics 0.17.0 v
revision            0
categories          ocaml devel
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             MIT
description         Library of intrinsics for OCaml
long_description    The ocaml_intrinsics library provides an OCaml interface to operations \
                    that have dedicated hardware instructions on some micro-architectures.

checksums           rmd160  5b9cfbb64e8d4cf4d043a2a33d04ad02a04e5f66 \
                    sha256  d42b21dc49a05be658391e63fe64c055d52ec67c0812cf6801f1de0f22733ce2 \
                    size    32720
github.tarball_from archive

# FIXME: add an implementation for these.
# See also: https://github.com/janestreet/ocaml_intrinsics/issues/9
patchfiles          0001-crc_stubs.c-abort-instead-of-error-on-unsupported-pl.patch

# https://github.com/janestreet/ocaml_intrinsics/issues/12
if {[string match *gcc* ${configure.compiler}] && ${configure.build_arch} in [list arm i386 ppc]} {
    patchfiles-append \
                    0002-atomics-32.patch
}

depends_build-append \
                    port:ocaml-dune-configurator

depends_lib-append  port:ocaml-ocaml_intrinsics_kernel

ocaml.build_type    dune
