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

gitlab.setup        git-latexdiff git-latexdiff 1.6.0

categories          devel tex
platforms           any
supported_archs     noarch
maintainers         {gmail.com:jjstickel @jjstickel} openmaintainer
license             BSD

description         Tool for using latexdiff on latex documents in git \
                    repositories
long_description    Tool to graphically visualize differences between \
                    different versions of LaTeX files between commits in a \
                    git repository. Technically, it is a wrapper around git \
                    and latexdiff.

checksums           rmd160  af2a746971aaafb2b7b0cfaa603a654d5500de16 \
                    sha256  4267f18a8605557de82af072f77e57efdeebb31a00d057f9e50bbd99013d0830 \
                    size    11906

depends_build-append \
                    port:asciidoc

depends_lib-append  port:git \
                    port:texlive-bin-extra

patchfiles          patch-makefile.diff

post-patch  {
    reinplace "s|(prefix)|${prefix}|g" ${worksrcpath}/Makefile
    reinplace "s|(destroot)|${destroot}|g" ${worksrcpath}/Makefile
    reinplace "s|(version)|${version}|g" ${worksrcpath}/Makefile
}

use_configure       no

build   {
    # create dummy git repository so that git-latexdiff command in Makefile (to
    # create man page) works correctly
    system -W ${worksrcpath} "${prefix}/bin/git init ."
}
