# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           python 1.0

name                py-pybtex
epoch               1
version             0.24.0
revision            0

categories-append   textproc
platforms           darwin
supported_archs     noarch
license             MIT
maintainers         nomaintainer

description         A BibTeX-compatible bibliography processor in Python.
long_description    Pybtex reads citation information from a file and \
                    produces a formatted bibliography.  BibTeX style files \
                    are supported.  Alternatively it is possible to write \
                    styles in Python.

homepage            https://pybtex.org/

checksums           rmd160  a735bc1a36c3e229a686d0a9c648620b954fbccc \
                    sha256  818eae35b61733e5c007c3fcd2cfb75ed1bc8b4173c1f70b56cc4c0802d34755 \
                    size    402879

python.versions     27 36 37 38 39

if {${name} ne ${subport}} {
    depends_lib-append  port:py${python.version}-latexcodec \
                        port:py${python.version}-six \
                        port:py${python.version}-setuptools \
                        port:py${python.version}-yaml
    depends_test-append port:py${python.version}-nose

    test.run            yes
    test.env            PYTHONPATH=${worksrcpath}/build/lib

    post-destroot   {
        set docdir ${prefix}/share/doc/${subport}
        xinstall -d ${destroot}${docdir}
        xinstall -m 0644 -W ${worksrcpath} CHANGES COPYING \
            PKG-INFO README ${destroot}${docdir}

        # make sure the "tests" directory is inside the pybtex directory so that it
        # doesn't get installed into ${python.pkgd}
        file rename ${destroot}/${python.pkgd}/tests ${destroot}/${python.pkgd}/${python.rootname}/tests
    }
}
