# -*- 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 perl5 1.0
PortGroup texlive 1.0

# Note: biber is not backwards-compatible, so be sure to check for
# compatibility with the version of biblatex in texlive-bibtex-extra
# before updating this port.
name            biblatex-biber
epoch           3

perl5.branches  5.34

perl5.setup     Biber 2.20
version         ${perl5.moduleversion}


categories      tex
license         {Artistic-2 GPL}
maintainers     {dports @drkp}
description     a BibTeX replacement for users of biblatex
long_description \
  Biblatex relies on the venerable BibTeX program only for sorting and \
  generating a very generic bbl file without any formatting            \
  instruction. Everything else is taken care of by biblatex, which     \
  provides a powerful and flexible macro interface for authors of      \
  citation styles.  With Biber it is no longer necessary to rely on    \
  BibTeX, allowing full Unicode support, no memory limitations,        \
  extensibility, etc.

platforms       {darwin any}
supported_archs noarch

homepage        http://biblatex-biber.sourceforge.net/
master_sites    https://github.com/plk/biber/archive/
distname        v${version}
worksrcdir      biber-${version}

checksums           rmd160  9e05892d27774ab5c7bd3423ee645869ceba7e81 \
                    sha256  19f0312e59bf2f5711b8d69b3585a0ca894c36574f086fbb8d53ccd5c0a45ff9 \
                    size    1632745
#patchfiles      patch-use-encode.pm

depends_build-append    port:p${perl5.major}-config-autoconf \
                        port:p${perl5.major}-extutils-libbuilder \
                        port:p${perl5.major}-test-differences

depends_lib-append      port:p${perl5.major}-autovivification \
                        port:p${perl5.major}-business-isbn \
                        port:p${perl5.major}-business-ismn \
                        port:p${perl5.major}-business-issn \
                        port:p${perl5.major}-class-accessor \
                        port:p${perl5.major}-data-compare \
                        port:p${perl5.major}-data-dump \
                        port:p${perl5.major}-data-uniqid \
                        port:p${perl5.major}-date-simple \
                        port:p${perl5.major}-datetime-calendar-julian \
                        port:p${perl5.major}-datetime-format-builder \
                        port:p${perl5.major}-encode-eucjpascii \
                        port:p${perl5.major}-encode-hanextra \
                        port:p${perl5.major}-encode-jis2k \
                        port:p${perl5.major}-encode-locale \
                        port:p${perl5.major}-file-slurper \
                        port:p${perl5.major}-file-which \
                        port:p${perl5.major}-ipc-cmd \
                        port:p${perl5.major}-ipc-run3 \
                        port:p${perl5.major}-io-string \
                        port:p${perl5.major}-libwww-perl \
                        port:p${perl5.major}-lingua-translit \
                        port:p${perl5.major}-list-allutils \
                        port:p${perl5.major}-list-moreutils \
                        port:p${perl5.major}-log-log4perl \
                        port:p${perl5.major}-mozilla-ca \
                        port:p${perl5.major}-parse-recdescent \
                        port:p${perl5.major}-perlio-utf8_strict \
                        port:p${perl5.major}-readonly \
                        port:p${perl5.major}-readonly-xs \
                        port:p${perl5.major}-regexp-common \
                        port:p${perl5.major}-sort-key \
                        port:p${perl5.major}-storable \
                        port:p${perl5.major}-text-balanced \
                        port:p${perl5.major}-text-bibtex \
                        port:p${perl5.major}-text-csv \
                        port:p${perl5.major}-text-csv_xs \
                        port:p${perl5.major}-text-roman \
                        port:p${perl5.major}-unicode-collate \
                        port:p${perl5.major}-unicode-linebreak \
                        port:p${perl5.major}-unicode-normalize \
                        port:p${perl5.major}-uri \
                        port:p${perl5.major}-xml-libxml-simple \
                        port:p${perl5.major}-xml-libxslt \
                        port:p${perl5.major}-xml-writer \
                        bin:mktexlsr:texlive-basic

perl5.use_module_build
perl5.link_binaries_suffix

post-patch {
    reinplace -W ${worksrcpath}/bin \
        "s|#!/usr/bin/env perl|#!${perl5.bin}|g" biber
}

# post-destroot {
#     xinstall -d ${destroot}${texlive_texmfports}/doc/bibtex/biber
#     xinstall -m 644 ${worksrcpath}/doc/biber.pdf \
#                     ${destroot}${texlive_texmfports}/doc/bibtex/biber
# }

post-activate {
    texlive.mktexlsr
}

post-deactivate {
    texlive.mktexlsr
}

livecheck.type  regex
livecheck.url   https://github.com/plk/biber/tags
livecheck.regex {/v([^"]+).tar.gz}
