# -*- 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 91943 2012-04-13 18:40:44Z jeremyhu@macports.org $

PortSystem 1.0

name            icns-gimp
version         0.1
revision        1
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       md5 e491775279b973db3cab06c7359855e8

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}
