# -*- 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        camlp5 camlp5 8.03.01
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
categories          lang ocaml
license             BSD
maintainers         {pmetzger @pmetzger} openmaintainer

description         Camlp5 is a preprocessor-pretty-printer of OCaml.
long_description    Camlp5 is a preprocessor and pretty-printer for \
        OCaml programs. It also provides parsing and printing tools. \
        As a preprocessor, it allows to: extend the syntax of OCaml, \
        redefine the whole syntax of the language. As a pretty printer, \
        it allows to: display OCaml programs in an elegant way, convert \
        from one syntax to another, check the results of syntax \
        extensions. Camlp5 also provides some parsing and pretty \
        printing tools: extensible grammars, extensible printers, \
        stream parsers and lexers pretty print module.  It works as a \
        shell command and can also be used in the OCaml toplevel.

homepage            https://camlp5.github.io/

checksums           rmd160  43d149580fbb01f677eea73e191712191067fbda \
                    sha256  b1b69824ff072f64674fc0d5db1b56fbf4dc898b07ea52e864401b05b395f373 \
                    size    1308170

depends_build       bin:perl:perl5
depends_lib         port:ocaml \
    port:ocaml-bos \
    port:ocaml-camlp-streams \
    port:ocaml-camlp5-buildscripts \
    port:ocaml-findlib \
    port:ocaml-fmt \
    port:ocaml-re \
    port:ocaml-rresult

extract.suffix      .tgz

configure.pre_args  --prefix "${prefix}"
configure.args      --mandir "${prefix}/share/man"

if {${build_arch} eq "ppc" || ${build_arch} eq "ppc64"} {
    build.target    world
    } else {
    build.target    world.opt
}

use_parallel_build  no

# ocaml is not universal
universal_variant   no

post-destroot {
    # Install META file not installed by the Makefile
    xinstall -m 755 -d ${destroot}${prefix}/lib/ocaml/site-lib/${name}
    xinstall -m 644 ${worksrcpath}/etc/META \
        ${destroot}${prefix}/lib/ocaml/site-lib/${name}
}
