# -*- 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 118913 2014-04-14 00:58:05Z devans@macports.org $

PortSystem      1.0

name            gnome-panel
version         3.8.0
revision        5
set branch      [join [lrange [split ${version} .] 0 1] .]
maintainers     devans openmaintainer
categories      gnome
license         GPL-2+ LGPL-2+
platforms       darwin
description     Panel component for the GNOME 2 Desktop.

long_description \
                ${description}

homepage        https://wiki.gnome.org/Projects/GnomePanel
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  b6bd10681666b0aece2e47ce81cf2f0297dc0004 \
                sha256  d1cda458a38cb4f7d2a50c61b1a72f4bf4c39cab65ae0e6cfdc4e0c122252e7a

depends_build   port:pkgconfig \
                port:intltool \
                port:itstool \
                port:yelp-tools \
                port:gnome-common \
                port:gtk-doc

depends_lib     port:desktop-file-utils \
                port:gtk3 \
                port:gconf \
                port:dconf \
                port:gnome-desktop \
                port:gnome-menus \
                port:telepathy-glib \
                port:policykit \
                port:libgweather \
                port:librsvg \
                port:libwnck3 \
                port:xorg-libX11 \
                port:xorg-libXau \
                port:xorg-libice \
                port:xorg-libsm \
                port:xorg-libXrandr

depends_run     port:gnome-settings-daemon \
                port:yelp

patchfiles      patch-thru-d1b93b8-20131216.diff \
                patch-session-disable-gnome-screensaver.diff

# update m4/intltool.m4 and autoreconf

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

use_autoreconf  yes
autoreconf.args -fvi

configure.cflags-append \
                -Wno-format-nonliteral

configure.args  --with-in-process-applets=all \
                --enable-introspection=yes \
                --enable-telepathy-glib \
                --x-includes=${prefix}/include \
                --x-libraries=${prefix}/lib \
                --disable-silent-rules \
                --disable-network-manager \
                --disable-eds \
                --disable-schemas-install \
                --disable-schemas-compile

# gobject-introspection uses g-ir-scanner, which uses $CC from env

build.args-append       CC="${configure.cc} ${configure.cc_archflags}"

variant python26 conflicts python27 description {Build using Python 2.6} {
    configure.python          ${prefix}/bin/python2.6
    depends_build-append      port:py26-gnome
}

variant python27 conflicts python26 description {Build using Python 2.7} {
    configure.python          ${prefix}/bin/python2.7
    depends_build-append      port:py27-gnome
}

if {![variant_isset python26]} {
    default_variants +python27
}

variant eds description {Enable evolution data server support} {
    depends_lib-append      port:evolution-data-server
    configure.args-delete   --disable-eds
}

if {[variant_isset eds]} {
    universal_variant no
}

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/gtk-update-icon-cache-3.0 -f -t ${prefix}/share/icons/hicolor"
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type  gnome
