# -*- 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            icns-gimp
version         0.1
revision        3
license         GPL-2+
maintainers     nomaintainer
description     Gimp file format plug-in for Macintosh icon files (.icns)
long_description \
    Gimp file format plug-in for Macintosh icon files (.icns) \
    Currently read-only. \
    Can load true color, 8-bit, 4-bit, and 1-bit icons at 128x128, \
    48x48, 32x32, and 16x16 sizes. \
    Multiple images are loaded as separate layers.

universal_variant no

categories      graphics
homepage        http://leuksman.com/pages/icns
platforms       darwin
master_sites    sourceforge:gimp-mac-helper

checksums       rmd160  5bad3e5bdbb37c0fc0bbab1f13586e98dba5e427 \
                sha256  33916ff2fc12a65d369f0e06ad9aec9950cc3b924d923bc2aebcb464923ffc7c \
                size    16785

depends_build   port:pkgconfig
depends_lib     path:lib/pkgconfig/gimp-2.0.pc:gimp2

patchfiles      patch-Makefile.diff

post-patch {
    reinplace "s|#define ICO_DBG||g" \
        ${worksrcpath}/icnsload.c
}

use_configure   no

build.target    icns
build.args-append \
    CC="${configure.cc} [get_canonical_archflags cc]" \
    CFLAGS="${configure.cppflags} ${configure.cflags}"

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/lib/gimp/2.0/plug-ins
    xinstall -m 755 ${worksrcpath}/icns \
        ${destroot}${prefix}/lib/gimp/2.0/plug-ins
}

livecheck.type  moddate
livecheck.url   http://sourceforge.net/project/downloading.php?groupname=gimp-mac-helper&filename=${name}-${version}${extract.suffix}
