# -*- 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                djvulibre
version             3.5.30
revision            0

categories          graphics www
license             GPL-2+
maintainers         {nicos @NicosPavlov} openmaintainer

description         Web centric format and software platform for distributing \
                    documents and images.
long_description    DjVu can advantageously replace PDF, PS, TIFF, JPEG, and GIF for \
                    distributing scanned documents, digital documents, or high-\
                    resolution pictures. DjVu content downloads faster, displays \
                    and renders faster, looks nicer onscreen and consumes fewer \
                    client resources than competing formats.

homepage            http://djvu.sourceforge.net/
master_sites        sourceforge:project/djvu/DjVuLibre/${version}

checksums           rmd160  3214e6f1695cd64902880d29fbba432f53382e04 \
                    sha256  ee5e457d4cfebe566f94b99e5e3d3cc7f5c79ddb741c2ac2ba2e456f00329644 \
                    size    3721274

# Temporary workaround for "tar: Ignoring malformed pax extended attribute"
# on older systems (macos <= 10.14)
# Unknown xattrs make older BSD tar fail
# Reference: https://trac.macports.org/ticket/73560 ... etc.
# Currently affecting djvulibre-3.5.30.tar.gz, file date 2026 May 5
#---------------------
if {${os.platform} eq "darwin" && ${os.major} <= 18} {
    depends_extract port:libarchive
    extract.post_args | ${prefix}/bin/bsdtar -xf -
}

depends_lib         port:libiconv \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:tiff

patchfiles          patch-noconvert.diff

# Teach glibtool about -stdlib=libc++
use_autoreconf      yes
autoreconf.args     -fvi

configure.args      --mandir=${prefix}/share/man \
                    --enable-threads \
                    --enable-shared \
                    --enable-xmltools \
                    --disable-desktopfiles \
                    --disable-silent-rules

livecheck.regex      /${name}-(\[0-9.\]+)${extract.suffix}
