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

name                  libpano13
version               2.9.21
revision              1
categories            graphics
platforms             darwin
maintainers           {gmail.com:freespace @freespace}
license               GPL-2+

description           The cross-platform library behind Panorama Tools

long_description      The panorama tools are mainly used to build panoramic images from a set of overlapping images. The usability extends beyond "just" building panoramas by far though. You can, for instance, use them to render an average of multiple images to broaden the dynamic range of the images or average out noise. You can also build object movies with them, morph between images and much more.

homepage              http://panotools.sourceforge.net/
master_sites          sourceforge:project/panotools/libpano13/libpano13-${version}/

checksums             rmd160  a2e4529112f09f24a2ff6bacee5031261965f279 \
                      sha256  79e5a1452199305e2961462720ef5941152779c127c5b96fc340d2492e633590 \
                      size    2801535

cmake.generator       Ninja
configure.args-append -DJPEG_INCLUDE_DIR=${prefix}/include \
                      -DJPEG_LIBRARY=${prefix}/lib/libjpeg.dylib \
                      -DPNG_INCLUDE_DIR=${prefix}/include \
                      -DPNG_LIBRARY=${prefix}/lib/libpng.dylib \
                      -DSUPPORT_JAVA_PROGRAMS=OFF \
                      -DTIFF_INCLUDE_DIR=${prefix}/include \
                      -DZLIB_ROOT=${prefix}
patchfiles-append     patch-endian-detection.diff

depends_build-append  port:pkgconfig

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

test.run              yes
test.cmd              ctest --output-on-failure

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