# -*- 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 83808 2011-09-11 11:10:53Z afb@macports.org $

PortSystem 1.0

name            xfce4-corner-plugin
version         1.0.1
revision        2
categories      xfce
platforms       darwin
license         LGPL-2+
maintainers     afb
description     Mac-style menubar corner plugin for xfce panel (4.4+)
long_description ${description}
homepage        http://aquila.deus.googlepages.com/
master_sites    http://aur.archlinux.org/packages/xfce4-corner-plugin/
distname        ${name}
checksums       md5 a0e26652ef7f2e8ca26fd007cc39d186 \
                sha1 d310b43e5a3c6891364e95b1195ba24f2c6ef2ae \
                rmd160 84e652dc6883bda0f04b032deb350753925a9db0

depends_build   path:bin/pkg-config:pkgconfig
depends_lib     port:xfce4-panel
use_configure   no

patchfiles      patch-xfce4-corner-plugin.c
post-patch {
    reinplace "s;/usr;${prefix};" ${worksrcpath}/${name}.desktop
}

build {
    # upstream really needs to learn about make
    system "gcc -std=c99 -Wall `pkg-config --cflags --libs libxfce4panel-1.0` -o ${worksrcpath}/${name} ${worksrcpath}/${name}.c"
}

destroot {
    xinstall -d ${destroot}${prefix}/libexec/xfce4/panel-plugins
    xinstall -d ${destroot}${prefix}/share/xfce4/panel-plugins
    copy ${worksrcpath}/${name} ${destroot}${prefix}/libexec/xfce4/panel-plugins/
    copy ${worksrcpath}/${name}.desktop ${destroot}${prefix}/share/xfce4/panel-plugins/
}
