# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 119001 2014-04-14 22:04:12Z devans@macports.org $

PortSystem      1.0

name            eog-plugins
version         3.12.1
license         GPL-2+
set branch      [join [lrange [split ${version} .] 0 1] .]
description     Extra plugins for the Eye of GNOME image viewer
long_description \
                $description
maintainers     devans openmaintainer
categories      gnome
platforms       darwin
homepage        https://wiki.gnome.org/Apps/EyeOfGnome
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  ed9c79b8035b6210535095bec90f124d155a858a \
                sha256  5b9a6854d5411e75aadb9d44694bbe02a35f5a79a23da5c1bb4feb6bacf56f1c

depends_build   port:pkgconfig \
                port:intltool

depends_lib     port:eog \
                port:gtk3 \
                port:libpeas \
                port:libgdata \
                port:libchamplain \
                port:clutter \
                port:clutter-gtk \
                port:libexif \
                port:gsettings-desktop-schemas

# update m4/intltool.m4 and autoreconf

pre-configure {
    copy -force ${prefix}/share/aclocal/intltool.m4 ${worksrcpath}/m4
}

use_autoreconf  yes
autoreconf.args -fvi

configure.args  --disable-python \
                --disable-schemas-compile \
                --disable-silent-rules

# requires python32 or later

variant python32 conflicts python33 python34 description {Use python 3.2} {
    depends_build-append      port:python32
    configure.python          ${prefix}/bin/python3.2
    set python_framework      ${frameworks_dir}/Python.framework/Versions/3.2
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
    configure.args-replace    --disable-python --enable-python
}

variant python33 conflicts python32 python34 description {Use python 3.3} {
    depends_build-append      port:python33
    configure.python          ${prefix}/bin/python3.3
    set python_framework      ${frameworks_dir}/Python.framework/Versions/3.3
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
    configure.args-replace    --disable-python --enable-python
}

variant python34 conflicts python32 python33 description {Use python 3.4} {
    depends_build-append      port:python34
    configure.python          ${prefix}/bin/python3.4
    set python_framework      ${frameworks_dir}/Python.framework/Versions/3.4
    configure.pkg_config_path ${python_framework}/lib/pkgconfig
    configure.args-replace    --disable-python --enable-python
}

if {![variant_isset python32] && ![variant_isset python34]} {
    default_variants +python33
}

post-activate {
   system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type  gnome
