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

github.setup        coccinelle coccinelle 1.3.1
github.tarball_from archive
revision            0

license             GPL-2
maintainers         nomaintainer

categories          devel textproc ocaml
description         ${name} is a semantic diff.
long_description    ${name} is a program matching and transformation engine which\
                    provides the language SmPL (Semantic Patch Language) for\
                    specifying desired matches and transformations in C code.

use_autoreconf      yes
autoreconf.cmd      ./autogen

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:ocaml \
                    port:ocaml-camlp4 \
                    port:ocaml-findlib \
                    port:ocaml-menhir \
                    port:ocaml-sexplib \
                    port:ocaml-stdcompat \
                    port:ocaml-parmap

checksums           rmd160  8b87f53e89b3c5e7f1a3bd97440b4f0e2e62e028 \
                    sha256  85989b37a2b37c37f62ae9576042c0c812908f97dac76ecbbdc9707225aced79 \
                    size    3115706

configure.args-append \
                    --disable-dependency-tracking \
                    --disable-silent-rules \
                    --enable-dynlink \
                    --enable-ocaml \
                    --enable-opt \
                    --disable-pcre \
                    --disable-python \
                    --with-menhir=${prefix}/bin/menhir

use_parallel_build  no

variant python312 conflicts description {Build with python 3.12 support} {
    set mypydir ${frameworks_dir}/Python.framework/Versions/3.12
    configure.args-replace  --disable-python --enable-python
    configure.args-append   --with-python=${mypydir}/bin/python3

    depends_lib-append      port:python312
}

variant pcre description {Enable PCRE support} {
    configure.args-replace  --disable-pcre --enable-pcre

    depends_lib-append      port:ocaml-pcre
}
