# -*- 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           makefile 1.0

name                twelf
version             1.7.1
revision            0
categories          lang math
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             BSD
description         Meta-logical framework for deductive systems
long_description    {*}${description}
homepage            http://twelf.org/wiki/Main_Page
master_sites        http://twelf.org/releases \
                    http://www.cs.cmu.edu/~twelf/dist
distname            ${name}-src-${version}
checksums           rmd160  97d395125154d0ec7f5ef4e9e7441cda1c2943c3 \
                    sha256  91b0d4d8c2e54452a042da0ff642f3b46b25efb36a84497aa8b96598f49a213a \
                    size    1147610
extract.rename      yes

depends_build-append \
                    port:smlnj
depends_run-append  port:smlnj

build.target        smlnj

destroot {
    set heapdir ${prefix}/libexec/${name}
    set datadir ${prefix}/share/${name}
    xinstall -d ${destroot}${heapdir}/bin
    xinstall -d ${destroot}${datadir}
    reinplace "s|${worksrcpath}|${heapdir}|" ${worksrcpath}/bin/${name}-server
    xinstall -m 0775 ${worksrcpath}/bin/${name}-server ${destroot}${prefix}/bin/
    copy ${worksrcpath}/bin/\.heap ${destroot}${heapdir}/bin/
    xinstall -m 0644 -W ${worksrcpath} LICENSE README ${destroot}${datadir}
    foreach dir {doc emacs examples examples-clp examples-delphin tex vim} {
        copy ${worksrcpath}/${dir} ${destroot}${datadir}/
    }
}

universal_variant   no
