# -*- 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 105777 2013-05-05 21:02:20Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           active_variants 1.1

name                awesome
version             3.4.15
categories          x11 x11-wm
platforms           darwin
maintainers         nomaintainer
license             GPL-2+

description         awesome is a tiling window manager

long_description    awesome is a tiling window manager initially based on a \
                    dwm code rewriting. It is extremely fast, small, dynamic \
                    and awesome. Windows can be managed in several layouts: \
                    tiled, maximized and floating. Each layout can be applied \
                    on the fly, optimizing the environment for the application \
                    in use and the task performed. awesome has the following \
                    features: very stable, no mouse needed, multihead support, \
                    some real transparency support, some xrandr support, no \
                    lua integration, no 9P support, no editable tagbars, no \
                    limits on its source size, key, script and mouse bindings, \
                    etc.

homepage            http://awesome.naquadah.org/
master_sites        ${homepage}download/
use_xz              yes

checksums           rmd160  d8a91d4e0f2161a99a4d3e60fabd1c8acf7cf015 \
                    sha256  6b053e18113bb21883a0c5b8c618845c3baddaf9dbe558ff6b824f7e320521d5

depends_build       port:cmake \
                    port:ImageMagick \
                    port:pkgconfig

depends_lib         path:bin/dbus-daemon:dbus \
                    port:lua \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/pango.pc:pango \
                    path:lib/pkgconfig/cairo.pc:cairo \
                    port:xorg-libxcb \
                    port:xorg-libXcursor \
                    port:xorg-xcb-util-image \
                    port:xorg-xcb-util-keysyms \
                    port:xorg-xcb-util-wm \
                    port:xorg-randrproto \
                    port:startup-notification \
                    port:libxdg-basedir \
                    port:imlib2 \
                    port:libev

require_active_variants path:lib/pkgconfig/cairo.pc:cairo x11

build.target-append CC=${configure.cc} \
                    CXX=${configure.cxx} \
                    CMAKE_ARGS="\
                    -DCMAKE_INSTALL_PREFIX=${prefix} \
                    -DPREFIX=${prefix} \
                    -DAWESOME_DOC_PATH=${prefix}/share/doc/awesome \
                    -DAWESOME_MAN_PATH=${prefix}/share/man \
                    -DAWESOME_XSESSION_PATH=${prefix}/share/xsessions \
                    -DSYSCONFDIR=${prefix}/etc \
                    -DXDG_CONFIG_HOME=${prefix}/etc/xdg"

patchfiles          patch-CMakeLists.txt.diff \
                    patch-Makefile.diff

use_configure       no

variant doc description {Build man pages} {
    depends_build-append \
                    port:asciidoc \
                    port:xmlto \
                    port:doxygen \
                    path:bin/dot:graphviz
}

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
