# -*- 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.1 v
github.tarball_from archive
revision            0

name                bedtools
categories          science
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  bb1bb677b6306da1b5cfbb8ef3ad585f681143c9 \
                    sha256  79a1ba318d309f4e74bfa74258b73ef578dccb1045e270998d7fe9da9f43a50e \
                    size    21085970

compiler.cxx_standard 2011

depends_build       port:py314-sphinx

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

use_configure       no

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

post-build {
    system -W ${worksrcpath}/docs "${build.cmd} SPHINXBUILD=${prefix}/bin/sphinx-build-3.14 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
