Merge remote-tracking branch 'remotes/sbraz/jaraco'
[gentoo.git] / x11-wm / awesome / awesome-3.5.6-r2.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6 CMAKE_MIN_VERSION="2.8"
7 inherit cmake-utils eutils
8
9 DESCRIPTION="A dynamic floating and tiling window manager"
10 HOMEPAGE="http://awesome.naquadah.org/"
11 SRC_URI="http://awesome.naquadah.org/download/${P}.tar.xz"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~x86-fbsd"
16 IUSE="dbus doc elibc_FreeBSD gnome"
17
18 COMMON_DEPEND="
19         >=dev-lang/lua-5.1:0
20         dev-libs/glib:2
21         >=dev-libs/libxdg-basedir-1
22         >=dev-lua/lgi-0.7
23         x11-libs/cairo[xcb]
24         x11-libs/gdk-pixbuf:2
25         >=x11-libs/libxcb-1.6
26         >=x11-libs/pango-1.19.3[introspection]
27         >=x11-libs/startup-notification-0.10_p20110426
28         >=x11-libs/xcb-util-0.3.8
29         x11-libs/xcb-util-cursor
30         x11-libs/libXcursor
31         >=x11-libs/libX11-1.3.99.901
32         dbus? ( >=sys-apps/dbus-1 )
33         elibc_FreeBSD? ( dev-libs/libexecinfo )"
34
35 # graphicsmagick's 'convert -channel' has no Alpha support, bug #352282
36 DEPEND="${COMMON_DEPEND}
37         >=app-text/asciidoc-8.4.5
38         app-text/xmlto
39         dev-util/gperf
40         virtual/pkgconfig
41         media-gfx/imagemagick[png]
42         >=x11-proto/xcb-proto-1.5
43         >=x11-proto/xproto-7.0.15
44         doc? (
45                 app-doc/doxygen
46                 media-gfx/graphviz
47         )"
48
49 RDEPEND="${COMMON_DEPEND}"
50
51 DOCS="AUTHORS BUGS PATCHES README STYLE"
52
53 src_prepare() {
54         # bug #408025
55         epatch "${FILESDIR}/${PN}-3.5_rc1-convert-path.patch"
56         epatch "${FILESDIR}/${PN}-xsession.patch"
57
58         # bug #507604
59         epatch "${FILESDIR}/${PN}-3.5.5-util.lua-xdg-icons-fix.patch"
60         # bug #509658
61         epatch "${FILESDIR}/${PN}-3.5.5-cflag-cleanup.patch"
62
63         # bug #571544
64         epatch "${FILESDIR}/${P}-fix-multi-instances-focus.patch"
65
66         epatch_user
67 }
68
69 src_configure() {
70         mycmakeargs=(
71                 -DPREFIX="${EPREFIX}"/usr
72                 -DSYSCONFDIR="${EPREFIX}"/etc
73                 $(cmake-utils_use_with dbus DBUS)
74                 $(cmake-utils_use doc GENERATE_DOC)
75                 )
76
77         cmake-utils_src_configure
78 }
79
80 src_compile() {
81         local myargs="all"
82
83         if use doc ; then
84                 myargs="${myargs} doc"
85         fi
86         cmake-utils_src_make ${myargs}
87 }
88
89 src_install() {
90         cmake-utils_src_install
91
92         if use doc ; then
93                 (
94                         cd "${CMAKE_BUILD_DIR}"/doc
95                         mv html doxygen
96                         dohtml -r doxygen || die
97                 )
98         fi
99         rm -rf "${ED}"/usr/share/doc/${PN} || die "Cleanup of dupe docs failed"
100
101         exeinto /etc/X11/Sessions
102         newexe "${FILESDIR}"/${PN}-session ${PN} || die
103
104         # GNOME-based awesome
105         if use gnome ; then
106                 # GNOME session
107                 insinto /usr/share/gnome-session/sessions
108                 newins "${FILESDIR}/${PN}-gnome-3.session" "${PN}-gnome.session" || die
109                 # Application launcher
110                 domenu "${FILESDIR}/${PN}-gnome.desktop" || die
111                 # X Session
112                 insinto /usr/share/xsessions/
113                 doins "${FILESDIR}/${PN}-gnome-xsession.desktop" || die
114         fi
115 }
116
117 pkg_postinst() {
118         # bug #447308
119         if use gnome; then
120                 elog
121                 elog "You have enabled the gnome USE flag."
122                 elog "Please note that quitting awesome won't kill your gnome session."
123                 elog "To really quit the session, you should bind your quit key"
124                 elog "to the following command:"
125                 elog "  gnome-session-quit --logout"
126                 elog "For more info visit"
127                 elog "  https://bugs.gentoo.org/show_bug.cgi?id=447308"
128         fi
129
130         # bug #440724
131         elog
132         elog "If you are having issues with Java application windows being"
133         elog "completely blank, try installing"
134         elog "  x11-misc/wmname"
135         elog "and setting the WM name to LG3D."
136         elog "For more info visit"
137         elog "  https://bugs.gentoo.org/show_bug.cgi?id=440724"
138         elog
139 }