x11-wm/awesome: Drop CMAKE_MIN_VERSION
[gentoo.git] / x11-wm / awesome / awesome-3.4.15.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="3"
6 inherit cmake-utils eutils
7
8 DESCRIPTION="A dynamic floating and tiling window manager"
9 HOMEPAGE="http://awesome.naquadah.org/"
10 SRC_URI="http://awesome.naquadah.org/download/${P}.tar.bz2"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="amd64 arm ppc ppc64 x86 ~x86-fbsd"
15 IUSE="dbus doc elibc_FreeBSD gnome"
16
17 COMMON_DEPEND=">=dev-lang/lua-5.1
18         dev-libs/libev
19         >=dev-libs/libxdg-basedir-1
20         media-libs/imlib2[png]
21         x11-libs/cairo[xcb]
22         || ( <x11-libs/libX11-1.3.99.901[xcb] >=x11-libs/libX11-1.3.99.901 )
23         >=x11-libs/libxcb-1.6
24         x11-libs/libXcursor
25         >=x11-libs/pango-1.19.3
26         >=x11-libs/startup-notification-0.10_p20110426
27         >=x11-libs/xcb-util-0.3.8
28         dbus? ( >=sys-apps/dbus-1 )
29         elibc_FreeBSD? ( dev-libs/libexecinfo )"
30
31 # graphicsmagick's 'convert -channel' has no Alpha support, bug #352282
32 DEPEND="${COMMON_DEPEND}
33         >=app-text/asciidoc-8.4.5
34         app-text/xmlto
35         dev-util/gperf
36         virtual/pkgconfig
37         media-gfx/imagemagick[png]
38         >=x11-proto/xcb-proto-1.5
39         >=x11-proto/xproto-7.0.15
40         doc? (
41                 app-doc/doxygen
42                 dev-lua/luadoc
43                 media-gfx/graphviz
44         )"
45
46 RDEPEND="${COMMON_DEPEND}
47         || (
48                 x11-misc/gxmessage
49                 x11-apps/xmessage
50         )"
51
52 # bug #321433: Need one of these to for awsetbg.
53 # imagemagick provides 'display' and is further down the default list, but
54 # listed here for completeness.  'display' however is only usable with
55 # x11-apps/xwininfo also present.
56 RDEPEND="${RDEPEND}
57         || (
58         ( x11-apps/xwininfo
59           || ( media-gfx/imagemagick[X] media-gfx/graphicsmagick[imagemagick,X] )
60         )
61         x11-misc/habak
62         media-gfx/feh
63         x11-misc/hsetroot
64         media-gfx/qiv
65         media-gfx/xv
66         x11-misc/xsri
67         media-gfx/xli
68         x11-apps/xsetroot
69         )"
70
71 DOCS="AUTHORS BUGS PATCHES README STYLE"
72
73 src_prepare() {
74         epatch \
75                 "${FILESDIR}/${PN}-3.4.2-backtrace.patch"
76
77         # bug  #408025
78         epatch "${FILESDIR}/${PN}-3.4.11-convert-path.patch"
79
80         #bug #465288
81         sed -e '/NoDisplay/d' -i awesome.desktop || die
82 }
83
84 src_configure() {
85         mycmakeargs=(
86                 -DPREFIX="${EPREFIX}"/usr
87                 -DSYSCONFDIR="${EPREFIX}"/etc
88                 $(cmake-utils_use_with dbus DBUS)
89                 $(cmake-utils_use doc GENERATE_LUADOC)
90                 )
91
92         cmake-utils_src_configure
93 }
94
95 src_compile() {
96         local myargs="all"
97
98         if use doc ; then
99                 myargs="${myargs} doc"
100         fi
101         cmake-utils_src_make ${myargs}
102 }
103
104 src_install() {
105         cmake-utils_src_install
106
107         if use doc ; then
108                 (
109                         cd "${CMAKE_BUILD_DIR}"/doc
110                         mv html doxygen
111                         dohtml -r doxygen || die
112                 )
113                 mv "${ED}"/usr/share/doc/${PN}/luadoc "${ED}"/usr/share/doc/${PF}/html/luadoc || die
114         fi
115         rm -rf "${ED}"/usr/share/doc/${PN} || die
116
117         exeinto /etc/X11/Sessions
118         newexe "${FILESDIR}"/${PN}-session ${PN} || die
119
120         # GNOME-based awesome
121         if use gnome ; then
122                 # GNOME session
123                 insinto /usr/share/gnome-session/sessions
124                 doins "${FILESDIR}/${PN}-gnome.session" || die
125                 # Application launcher
126                 domenu "${FILESDIR}/${PN}-gnome.desktop" || die
127                 # X Session
128                 insinto /usr/share/xsessions/
129                 doins "${FILESDIR}/${PN}-gnome-xsession.desktop" || die
130         fi
131 }