# $Id: Portfile 106340 2013-05-23 00:54:08Z larryv@macports.org $

PortSystem  1.0

name        coq
version     8.4pl2
platforms   darwin
categories  lang math
license     LGPL-2.1
maintainers nomaintainer
homepage    http://coq.inria.fr/
master_sites ${homepage}V${version}/files/

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.  For more information, see <${homepage}>.

checksums           rmd160  4860eaff4c8f0a235d3fcf162199eaa5fe1db2da \
                    sha256  fb719a38f613b01861e3b251e745a5c8ef395a26ce7029668e85ac75fcbca2d8

depends_lib        port:ocaml port:camlp5

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

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

# ocaml is not universal
universal_variant  no

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

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:texlive \
                                       port:hevea \
                                       port:netpbm
                  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
}
