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

github.setup        arq5x bedtools2 2.31.0 v

name                bedtools
categories          science
platforms           darwin
maintainers         {gmail.com:vandervelde.ag @arjanvandervelde} openmaintainer
license             MIT

description         Utilities to perform basic operations on BED files

long_description    The BEDTools utilities allow one to address common genomics \
                    tasks such as finding feature overlaps and computing coverage. \
                    The utilities are largely based on four widely-used file formats: \
                    BED, GFF/GTF, VCF, and SAM/BAM.

checksums           rmd160  f684f45155f0b046712d394845265d9a1bc1ba53 \
                    sha256  e8c442acedd1706d64f7cc5e00d26692fbe0821871440972f8b5fa19ca1734c2 \
                    size    21086571

compiler.cxx_standard 2011

depends_build       port:py38-sphinx

depends_lib-append  port:zlib port:xz port:bzip2

use_configure       no

build.args-append   CC=${configure.cc} \
                    CXX=${configure.cxx}

use_parallel_build  yes

post-build {
    system -W ${worksrcpath}/docs "${build.cmd} SPHINXBUILD=${prefix}/bin/sphinx-build-3.8 html man"
}

destroot {
    xinstall -m 755 {*}[glob ${worksrcpath}/bin/*] ${destroot}${prefix}/bin/
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${destroot}${prefix}/share/${name}/genomes
    xinstall -m 644 -W ${worksrcpath} LICENSE README.md ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 {*}[glob ${worksrcpath}/genomes/*] ${destroot}${prefix}/share/${name}/genomes/
    copy ${worksrcpath}/docs/_build/html ${destroot}${prefix}/share/doc/${name}/html
    xinstall -m 644 ${worksrcpath}/docs/_build/man/bedtools.1 ${destroot}${prefix}/share/man/man1
}

test.run            yes