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

PortSystem          1.0

name                coq
version             8.5pl2
platforms           darwin
categories          lang math
license             LGPL-2.1
maintainers         piermont.com:perry openmaintainer

description         Proof assistant for higher-order logic
long_description    Coq is a proof assistant for higher-order logic, \
                    which allows the development of computer programs \
                    consistent with their formal specification. It is \
                    developed using Objective Caml and Camlp4.
homepage            http://coq.inria.fr/

depends_lib         port:ocaml \
                    port:camlp5

master_sites        http://coq.inria.fr/distrib/V${version}/files/
checksums           rmd160  55ddf2e77b42677c227fd9954789bf12410c63e7 \
                    sha256  83239d1251bf6c54a9ca5045d738e469019b93ca601756bf982aab0654e4de73

configure.pre_args  -prefix ${prefix}
configure.args      -emacslib ${prefix}/share/emacs/site-lisp/ \
                    -mandir ${prefix}/share/man \
                    -coqdocdir ${prefix}/share/coq/latex \
                    -coqide no \
                    -with-doc no
build.target        world

destroot.target     install
destroot.destdir    COQINSTALLPREFIX=${destroot}

# ocaml is not universal
universal_variant   no

notes "
The style file for LaTeX documentation,\
coqdoc.sty, is in ${prefix}/share/coq/latex.\
Add this to your TEXINPUTS if you wish to\
use it.
"

variant doc description {Build documentation} {
    depends_build-append    port:hevea \
                            port:netpbm \
                            port:texlive \
                            port:texlive-latex-extra
    configure.args-delete   -with-doc no
    configure.args-append   -with-doc yes
    use_parallel_build      no
}

variant coqide description {Install CoqIDE} {
    depends_lib-append      port:lablgtk2
    configure.args-delete   -coqide none
    configure.args-append   -coqide opt
}

livecheck.type      regex
livecheck.url       ${homepage}/download/
livecheck.regex     "<a href=\"distrib/V(\\d+(?:\\.\\w+)*)/files/coq-\\1\\.tar\\.gz\">"