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

name                zathura-plugin-pdf-mupdf
version             0.3.1
categories          office
platforms           darwin
license             zlib
maintainers         {gmail.com:starkhalo @harciga} \
                    openmaintainer
conflicts           zathura-plugin-pdf-poppler
description         The zathura-pdf-mupdf plugin adds PDF support to zathura.
long_description \
    The zathura-pdf-mupdf plugin adds PDF support to zathura by using the \
    mupdf rendering library.

homepage            http://pwmt.org/projects/zathura/plugins/

master_sites        http://pwmt.org/projects/zathura-pdf-mupdf/download/
distname            zathura-pdf-mupdf-${version}

checksums           rmd160  7497475ba55d2e7f96d23f378cbefeddd56089e4 \
                    sha256  d9b9edc0297b9eddb53020976f287b4e8db33edef8cfa047d70e02653eb2f81b

patch.pre_args      -p1
patchfiles          patch-Makefile.diff

depends_build       port:pkgconfig \
                    path:lib/libmupdfthird.a:mupdf

depends_lib         port:desktop-file-utils \
                    port:mupdf \
                    port:openjpeg \
                    port:freetype \
                    port:harfbuzz \
                    path:lib/libgirara-gtk3.dylib:girara \
                    path:bin/zathura:zathura

use_configure       no

variant universal   {}

build.args          PREFIX=${prefix}
build.env           CC=${configure.cc} \
                    CXX=${configure.cxx} \
                    CPP=${configure.cpp} \
                    CFLAGS="[get_canonical_archflags cc]" \
                    LDFLAGS="[get_canonical_archflags ld]" \
                    VERBOSE=1

destroot.env        {*}${build.env}
destroot.args       {*}${build.args}

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     (\\d\\.\\d\\.\\d)