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

name                advi
version             1.10.2
revision            4
categories          x11 graphics
license             LGPL
maintainers         nomaintainer
platforms           darwin
description         TeX DVI previewer
long_description    Active-DVI is an O'Caml Unix-platform DVI previewer and a \
                    programmable presenter for slides written in LaTeX.

homepage            http://advi.inria.fr/

master_sites        ${homepage}

checksums           rmd160  7609b68e1a05b1057bb8f5c9e5c413c5d8111263 \
                    sha256  01556d20896db57c1d05961b2dd48a44d2fbca2adb10d4a9ded732bcf6cb0cc6 \
                    size    9772060

# you can install hevea if you want additional functionality
depends_run         path:bin/kpsewhich:texlive-basic

depends_build       port:ocaml-findlib \
                    port:ImageMagick

depends_lib         port:ocaml \
                    port:camlimages \
                    port:xorg-libXinerama \
                    port:xpm \
                    port:freetype

# see https://trac.macports.org/ticket/43747
build.env-append    LANG=C

# avoid:
#    Error: This expression has type bytes but an expression was expected of type
#             string
build.env-append    OCAMLPARAM="safe-string=0,_"

require_active_variants camlimages graph

post-activate {
    system "${prefix}/bin/mktexlsr"
}
post-deactivate {
    system "${prefix}/bin/mktexlsr"
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     ">Version (\[0-9.\]+)"
