# -*- 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 87913 2011-12-12 02:27:22Z devans@macports.org $

PortSystem 1.0

name            gimp-gap-devel
conflicts       gimp-gap
set git_name    gimp-gap
version         2.7.0
revision        7
license         GPL-2+
categories      graphics
maintainers     devans

description     The Gimp Animation Package.

long_description \
                GIMP-GAP, the GIMP Animation Package, is a collection of plug-ins to \
                extend GIMP with capabilities to edit and create animations as \
                sequences of single frames. This is the unstable development branch \
                leading up to a stable version 2.8.

universal_variant  no
use_parallel_build no
configure.ccache   no

homepage        http://www.gimp.org/
platforms       darwin

fetch.type      git
git.url         git://git.gnome.org/${git_name}
git.branch      1f273f01c461651c474a67d14af01b92f1078b85

pre-patch       {
                    system "cd ${worksrcpath}/extern_libs && gzip -dc ffmpeg.tar.gz | gnutar -xf -"
                }

patchfiles      patch-extern_libs-configure_options_ffmpeg.txt.diff

post-patch     {
                   set ffmpeg_extras "--cc=${configure.cc} --arch=${build_arch}"
                   reinplace "s|MP_FFMPEG_EXTRAS|${ffmpeg_extras}|" ${worksrcpath}/extern_libs/configure_options_ffmpeg.txt
               }

depends_build   port:git-core \
                port:pkgconfig \
                port:autoconf \
                port:automake \
                port:intltool \
                port:gmake \
                port:yasm

depends_lib     path:lib/pkgconfig/gimp-2.0.pc:gimp2 \
                port:lame \
                port:XviD \
                port:bzip2 \
                port:zlib

#
# make mplayer-devel the default as MPlayer doesn't build on Snow Leopard
#

depends_run     path:bin/mplayer:mplayer-devel

configure.cmd    ./autogen.sh

configure.args  --disable-audio-support \
                --disable-libmpeg3 \
                --disable-ff-libfaac \
                --disable-ff-libfaad \
                --disable-ff-libx264 \
                --enable-gdkpixbuf-pview \
                --with-ffmpegsrcdir=${worksrcpath}/extern_libs/ffmpeg \
                --with-ff-extra-cflags=-I${prefix}/include \
                --with-ff-extra-ldflags=-L${prefix}/lib

post-destroot {
    foreach dir {howto reference} {
        xinstall -d ${destroot}${prefix}/share/${name}/$dir
        foreach txt [glob -d ${worksrcpath}/docs/$dir/txt *.txt] {
            xinstall -m 644 $txt ${destroot}${prefix}/share/${name}/$dir
        }
    }
}

livecheck.type  none
