# -*- 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 106695 2013-06-05 16:32:33Z devans@macports.org $

PortSystem 1.0

name            gimp-gap-devel
conflicts       gimp-gap
set git_name    gimp-gap
version         2.7.0
revision        13
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      3985b4c16c7da95cc5c76967d105483a2e59ebb2

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

patchfiles      patch-extern_libs-configure_options_ffmpeg.txt.diff \
                patch-autogen.sh.diff \
                patch-automake-1.13.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:libsdl \
                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

compiler.blacklist clang

configure.cmd    ./autogen.sh

configure.args  --enable-audio-support-sdl \
                --disable-audio-support-wavplay \
                --disable-libmpeg3 \
                --disable-ff-libfaac \
                --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
