x11-wm/compiz: Drop deprecated Plasma 4 support
[gentoo.git] / x11-wm / compiz / compiz-0.8.8-r3.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
7 inherit autotools eutils gnome2-utils
8
9 DESCRIPTION="OpenGL window and compositing manager"
10 HOMEPAGE="http://www.compiz.org/"
11 SRC_URI="http://releases.compiz.org/${PV}/${P}.tar.bz2"
12
13 LICENSE="GPL-2 LGPL-2.1 MIT"
14 SLOT="0"
15 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
16 IUSE="+cairo dbus fuse gnome gconf gtk +svg"
17
18 COMMONDEPEND="
19         >=dev-libs/glib-2
20         dev-libs/libxml2
21         dev-libs/libxslt
22         media-libs/libpng:0=
23         >=media-libs/mesa-6.5.1-r1
24         >=x11-base/xorg-server-1.1.1-r1
25         >=x11-libs/libX11-1.4
26         x11-libs/libxcb
27         x11-libs/libXcomposite
28         x11-libs/libXdamage
29         x11-libs/libXinerama
30         x11-libs/libXrandr
31         x11-libs/libICE
32         x11-libs/libSM
33         >=x11-libs/libXrender-0.8.4
34         >=x11-libs/startup-notification-0.7
35         virtual/glu
36         cairo? (
37                 x11-libs/cairo[X]
38         )
39         dbus? (
40                 >=sys-apps/dbus-1.0
41                 dev-libs/dbus-glib
42         )
43         fuse? ( sys-fs/fuse )
44         gnome? (
45                 >=gnome-base/gnome-control-center-2.16.1:2
46                 gnome-base/gnome-desktop:2
47                 gconf? ( gnome-base/gconf:2 )
48         )
49         gtk? (
50                 >=x11-libs/gtk+-2.8.0:2
51                 >=x11-libs/libwnck-2.18.3:1
52                 x11-libs/pango
53         )
54         svg? (
55                 >=gnome-base/librsvg-2.14.0:2
56                 >=x11-libs/cairo-1.0
57         )
58 "
59
60 DEPEND="${COMMONDEPEND}
61         virtual/pkgconfig
62         x11-proto/damageproto
63         x11-proto/xineramaproto
64 "
65
66 RDEPEND="${COMMONDEPEND}
67         x11-apps/mesa-progs
68         x11-apps/xdpyinfo
69         x11-apps/xset
70         x11-apps/xvinfo
71 "
72
73 DOCS=( AUTHORS ChangeLog NEWS README TODO )
74
75 src_prepare() {
76         echo gtk/gnome/compiz-wm.desktop.in >> po/POTFILES.skip
77         echo metadata/core.xml.in >> po/POTFILES.skip
78
79         # Patch for compatibility with gcc 4.7
80         epatch "${FILESDIR}"/${PN}-gcc-4.7.patch
81
82         if ! use gnome || ! use gconf; then
83                 epatch "${FILESDIR}"/${PN}-no-gconf.patch
84         fi
85         eautoreconf
86 }
87
88 src_configure() {
89         local myconf
90
91         # We make gconf optional by itself, but only if gnome is also
92         # enabled, otherwise we simply disable it.
93         if use gnome; then
94                 myconf="${myconf} $(use_enable gconf)"
95         else
96                 myconf="${myconf} --disable-gconf"
97         fi
98
99         econf \
100                 --enable-fast-install \
101                 --disable-static \
102                 --disable-gnome-keybindings \
103                 --with-default-plugins \
104                 $(use_enable svg librsvg) \
105                 $(use_enable cairo annotate) \
106                 $(use_enable dbus) \
107                 $(use_enable dbus dbus-glib) \
108                 $(use_enable fuse) \
109                 $(use_enable gnome) \
110                 $(use_enable gnome metacity) \
111                 $(use_enable gtk) \
112                 --disable-kde4 \
113                 --disable-kde \
114                 ${myconf}
115 }
116
117 src_install() {
118         default
119         prune_libtool_files --all
120
121         # Install compiz-manager
122         dobin "${FILESDIR}"/compiz-manager
123
124         # Add the full-path to lspci
125         sed -i "s#lspci#/usr/sbin/lspci#" "${D}/usr/bin/compiz-manager" || die
126
127         # Fix the hardcoded lib paths
128         sed -i "s#/lib/#/$(get_libdir)/#g" "${D}/usr/bin/compiz-manager" || die
129
130         # Create gentoo's config file
131         dodir /etc/xdg/compiz
132
133         cat <<- EOF > "${D}/etc/xdg/compiz/compiz-manager"
134         COMPIZ_BIN_PATH="/usr/bin/"
135         PLUGIN_PATH="/usr/$(get_libdir)/compiz/"
136         LIBGL_NVIDIA="/usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.so.1.2"
137         LIBGL_FGLRX="/usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.so.1.2"
138         KWIN="$(type -p kwin)"
139         METACITY="$(type -p metacity)"
140         SKIP_CHECKS="yes"
141         EOF
142
143         domenu "${FILESDIR}"/compiz.desktop
144 }
145
146 pkg_preinst() {
147         use gnome && use gconf && gnome2_gconf_savelist
148 }
149
150 pkg_postinst() {
151         use gnome && use gconf && gnome2_gconf_install
152
153         ewarn "If you update to x11-wm/metacity-2.24 after you install ${P},"
154         ewarn "gtk-window-decorator will crash until you reinstall ${PN} again."
155 }
156
157 pkg_prerm() {
158         use gnome && gnome2_gconf_uninstall
159 }