# -*- 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
# $Id: Portfile 90391 2012-03-04 05:39:24Z ryandesign@macports.org $

PortSystem          1.0

name                mupdf
conflicts           poppler xpdf-tools
version             0.9
categories          graphics
platforms           darwin
maintainers         nomaintainer
license             GPL-3+

description         lightweight PDF and XPS viewer and parser/rendering library

long_description    MuPDF is a lightweight PDF and XPS viewer and \
                    parser/rendering library. \
                    \
                    The renderer in MuPDF is tailored for high-quality \
                    anti-aliased graphics. It renders text with metrics and \
                    spacing accurate to within fractions of a pixel for the \
                    highest fidelity in reproducing the look of a printed \
                    page on screen. \
                    \
                    MuPDF is also small, fast, and yet complete. It supports \
                    PDF 1.7 with transparency, encryption, hyperlinks, \
                    annotations, search and many other bells and whistles. \
                    MuPDF can also read XPS documents (OpenXPS ECMA-388).

homepage            http://www.mupdf.com/

master_sites        googlecode
distfiles           [suffix ${name}-${version}-source]

checksums           rmd160  9ba1df205f9f95c7ff4b0a3be224786ad5a65d99 \
                    sha256  abed825cb1d73e0e28f0a7ee72b5d7a451ba41d21b0c55837ed2a212f3b16b2d

depends_build       port:pkgconfig

depends_lib         port:freetype \
                    port:jbig2dec \
                    port:jpeg \
                    port:openjpeg \
                    port:xorg-libXext \
                    port:zlib

patchfiles          patch-Makerules.diff

use_configure       no

build.env           CC="${configure.cc}" \
                    CFLAGS="${configure.cflags} ${configure.cppflags} [get_canonical_archflags]" \
                    LDFLAGS="${configure.ldflags} [get_canonical_archflags]" \
                    verbose=1

destroot.destdir    prefix=${destroot}${prefix}

platform darwin 8 {
    depends_build-append port:gmake
    build.cmd ${prefix}/bin/gmake
}
