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

name                ufraw
version             0.22
revision            15
license             GPL-2+
categories          graphics
maintainers         {mascguy @mascguy} openmaintainer
description         Unidentified Flying Raw (UFRaw)

long_description    The Unidentified Flying Raw (UFRaw) is a utility to read and \
                    manipulate raw images from digital cameras. It can be used on \
                    its own or as a Gimp plug-in. It reads raw images using Dave Coffin's \
                    raw conversion utility - DCRaw. UFRaw supports basic color management \
                    using Little CMS, allowing the user to apply color profiles.

homepage            http://ufraw.sourceforge.net
master_sites        sourceforge:project/ufraw/ufraw/${distname}

checksums           rmd160  2588acde88dda8c30310b967e7185862072c124c \
                    sha256  f7abd28ce587db2a74b4c54149bd8a2523a7ddc09bedf4f923246ff0ae09a25e

depends_build       port:pkgconfig \
                    path:bin/perl:perl5
                    
depends_lib         port:cfitsio \
                    port:dcraw \
                    port:exiv2 \
                    path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \
                    port:gtkimageview \
                    path:lib/pkgconfig/gimpui-2.0.pc:gimp2 \
                    port:jasper \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:lcms2 \
                    port:libpng \
                    port:lensfun \
                    port:tiff

patchfiles          patch-dcraw.cc.diff \
                    patch-ufraw_exiv2.cc.diff \
                    patch-ufraw-gimp.c.diff \
                    patch-uf_gtk.cc.diff

platform darwin {
    if {${os.major} < 11} {
        patchfiles-append snowleopard-strnlen.patch
    }
}

# GIMP plugin is incompatible with new raw file API in gimp 2.10+, disable
# https://sourceforge.net/p/ufraw/feature-requests/323/

configure.args      --enable-contras \
                    --without-gimp

#
# the following dummy variants are used
# to identify this port's binary dependencies
# based on which variant of gtk2 is used for the build
#

variant x11 conflicts quartz {}
variant quartz conflicts x11 {}

if {[variant_isset quartz]} {
    require_active_variants path:lib/pkgconfig/gtk+-2.0.pc:gtk2 quartz
} else {
    default_variants +x11
    require_active_variants path:lib/pkgconfig/gtk+-2.0.pc:gtk2 x11
}

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        COPYING \
        MANIFEST \
        README \
        TODO \
        ${docdir}
}

# This looks like a bug in llvm-gcc-4.2 compilation being incompatible with llvm-g++-4.2 linking
#   Undefined symbols for architecture x86_64:
#   "___builtin_object_size", referenced from:
#   "_alloca", referenced from:
compiler.blacklist-append llvm-gcc-4.2 macports-llvm-gcc-4.2

livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)"
