# $Id: Portfile 61257 2009-12-07 08:17:56Z mww@macports.org $

PortSystem        1.0

name              isabelle
version           2009-1
categories        math lang ml
platforms         darwin
maintainers       mww
license           BSD
description       Isabelle is a popular generic theorem proving environment.
long_description  Isabelle is a generic proof assistant. It allows mathematical \
                  formulas to be expressed in a formal language and provides \
                  tools for proving those formulas in a logical calculus. The \
                  main application is the formalization of mathematical proofs \
                  and in particular formal verification, which includes proving \
                  the correctness of computer hardware or software and proving \
                  properties of computer languages and protocols.

homepage          http://www.cl.cam.ac.uk/Research/HVG/Isabelle/
master_sites      http://isabelle.in.tum.de/dist/ \
                  http://www.cl.cam.ac.uk/research/hvg/Isabelle/dist/ \
                  http://mirror.cse.unsw.edu.au/pub/isabelle/dist/

distname          Isabelle${version}
checksums           md5     d6c4b6f26b6ceba21a1950470436a450 \
                    sha1    224949d1241b68a91222fcddf41ed5334f39e6dc \
                    rmd160  040a754afca1528f017cd7191a9bff6d548aa2cb
patchfiles        patch-etc-settings.diff

depends_lib       port:polyml

post-extract {
    file rename ${worksrcpath}/doc ${workpath}/doc
    system "cd ${worksrcpath} && mv ANNOUNCE CONTRIBUTORS COPYRIGHT NEWS README ${workpath}/doc"
}

configure {
    reinplace "s|@prefix@|${prefix}|g" ${worksrcpath}/etc/settings
}

build {
    system "cd ${workpath}/${worksrcdir} && ./build -a -b"
}

destroot {
    file copy ${worksrcpath} ${destroot}${prefix}/lib/${name}
    system "${destroot}${prefix}/lib/${name}/bin/isabelle install -p ${destroot}${prefix}/bin -d ${prefix}/lib/${name}"
    xinstall -d ${destroot}${prefix}/share/doc/
    file copy ${workpath}/doc ${destroot}${prefix}/share/doc/${name}-${version}
}

livecheck.type  regex
livecheck.url   http://www.cl.cam.ac.uk/research/hvg/Isabelle/download.html
livecheck.regex Isabelle(\[0-9\]+).tar.gz

