# $Id: Portfile 87729 2011-12-02 19:15:14Z dports@macports.org $

PortSystem  1.0

name        coq
version     8.3pl2
platforms   darwin
categories  lang math
license     LGPL-2.1
maintainers loria.fr:reilles
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  f59ee288a35c1009f88f050362bee21311b459a8 \
                    sha256  b82b44ec585903b6bfadca02008eb5549cda46038c776ec115bc408c4e0f34f1

use_parallel_build yes
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
depends_lib        bin:ocamlc:ocaml port:camlp5
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
}
