# Copyright 2011-2012 Quentin "Sardem FF7" Glidic <sardemff7+exherbo@sardemff7.net>
# Distributed under the terms of the GNU General Public License v2

require freedesktop-desktop

export_exlib_phases src_install

SUMMARY="A tiling window manager, completely written from scratch"
DESCRIPTION="
i3 was created because wmii, our favorite window manager at the time, didn’t provide some features
we wanted (multi-monitor done right, for example), had some bugs, didn’t progress since quite
some time and wasn’t easy to hack at all (source code comments/documentation completely lacking).
Still, we think the wmii developers and contributors did a great job. Thank you for inspiring us
to create i3.

Please be aware that i3 is primarily targeted at advanced users and developers.
"
HOMEPAGE="http://i3wm.org/"

LICENCES="BSD-3"
SLOT="0"

MYOPTIONS=""


DEPENDENCIES="
    build:
        dev-lang/perl:*
        virtual/pkg-config
        x11-proto/xcb-proto[>=1.3]
    build+run:
        dev-libs/libev
        dev-libs/yajl[>=2.0.1]
        x11-libs/cairo[X]
        x11-libs/libxcb[>=1.1.93]
        x11-libs/libxkbcommon[X][>=0.4.0]
        x11-libs/pango
        x11-libs/startup-notification
        x11-utils/xcb-util
        x11-utils/xcb-util-cursor
        x11-utils/xcb-util-keysyms
        x11-utils/xcb-util-wm
    recommendation:
        x11-plugins/i3status [[
            description = [ Default source for i3bar ]
        ]]
    suggestion:
        x11-misc/dmenu [[
            description = [ Default program launcher ]
        ]]
        (
            dev-perl/AnyEvent-I3
            dev-perl/JSON-XS
        ) [[
            *description = [ Used by the tree saving utility ]
            *group-name = [ i3-save-tree ]
        ]]
"

DEFAULT_SRC_COMPILE_PARAMS=(
    CC=${CC}
    AR=${AR}
    PKG_CONFIG=$(exhost --tool-prefix)pkg-config
    PREFIX=/usr
    EXEC_PREFIX=/usr/$(exhost --target)
    SYSCONFDIR=/etc
    V=1
)

DEFAULT_SRC_INSTALL_PARAMS=(
    PKG_CONFIG=$(exhost --tool-prefix)pkg-config
    PREFIX=/usr
    EXEC_PREFIX=/usr/$(exhost --target)
    SYSCONFDIR=/etc
    V=1
)

i3_src_install() {
    default

    doman man/*.1
}