app-editors/gummi: drop base.eclass and fix whitespace
[gentoo.git] / x11-wm / compiz / compiz-0.8.8-r3.ebuild
1 # Copyright 1999-2014 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 kde +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         kde? ( >=kde-base/kwin-4.2.0 )
55         svg? (
56                 >=gnome-base/librsvg-2.14.0:2
57                 >=x11-libs/cairo-1.0
58         )
59 "
60
61 DEPEND="${COMMONDEPEND}
62         virtual/pkgconfig
63         x11-proto/damageproto
64         x11-proto/xineramaproto
65 "
66
67 RDEPEND="${COMMONDEPEND}
68         x11-apps/mesa-progs
69         x11-apps/xdpyinfo
70         x11-apps/xset
71         x11-apps/xvinfo
72 "
73
74 DOCS=( AUTHORS ChangeLog NEWS README TODO )
75
76 src_prepare() {
77         echo gtk/gnome/compiz-wm.desktop.in >> po/POTFILES.skip
78         echo metadata/core.xml.in >> po/POTFILES.skip
79
80         # Patch for compatibility with gcc 4.7
81         epatch "${FILESDIR}"/${PN}-gcc-4.7.patch
82
83         if ! use gnome || ! use gconf; then
84                 epatch "${FILESDIR}"/${PN}-no-gconf.patch
85         fi
86         if use kde; then
87                 # patch for KDE 4.8 compatibility. Picked up from stuff overlay
88                 has_version ">=kde-base/kwin-4.8" && epatch "${FILESDIR}"/${PN}-kde-4.8.patch
89                 # patch for KDE 4.9 compatibility. Picked up from http://cgit.compiz.org
90                 has_version ">=kde-base/kwin-4.9" && epatch "${FILESDIR}"/${PN}-kde-4.9.patch
91                 # patch for KDE 4.10 compatibility. Picked up from stuff overlay
92                 has_version ">=kde-base/kwin-4.10" && epatch "${FILESDIR}"/${PN}-kde-4.10.patch
93         fi
94         eautoreconf
95 }
96
97 src_configure() {
98         local myconf
99
100         # We make gconf optional by itself, but only if gnome is also
101         # enabled, otherwise we simply disable it.
102         if use gnome; then
103                 myconf="${myconf} $(use_enable gconf)"
104         else
105                 myconf="${myconf} --disable-gconf"
106         fi
107
108         econf \
109                 --enable-fast-install \
110                 --disable-static \
111                 --disable-gnome-keybindings \
112                 --with-default-plugins \
113                 $(use_enable svg librsvg) \
114                 $(use_enable cairo annotate) \
115                 $(use_enable dbus) \
116                 $(use_enable dbus dbus-glib) \
117                 $(use_enable fuse) \
118                 $(use_enable gnome) \
119                 $(use_enable gnome metacity) \
120                 $(use_enable gtk) \
121                 $(use_enable kde kde4) \
122                 --disable-kde \
123                 ${myconf}
124 }
125
126 src_install() {
127         default
128         prune_libtool_files --all
129
130         # Install compiz-manager
131         dobin "${FILESDIR}"/compiz-manager
132
133         # Add the full-path to lspci
134         sed -i "s#lspci#/usr/sbin/lspci#" "${D}/usr/bin/compiz-manager" || die
135
136         # Fix the hardcoded lib paths
137         sed -i "s#/lib/#/$(get_libdir)/#g" "${D}/usr/bin/compiz-manager" || die
138
139         # Create gentoo's config file
140         dodir /etc/xdg/compiz
141
142         cat <<- EOF > "${D}/etc/xdg/compiz/compiz-manager"
143         COMPIZ_BIN_PATH="/usr/bin/"
144         PLUGIN_PATH="/usr/$(get_libdir)/compiz/"
145         LIBGL_NVIDIA="/usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.so.1.2"
146         LIBGL_FGLRX="/usr/$(get_libdir)/opengl/xorg-x11/lib/libGL.so.1.2"
147         KWIN="$(type -p kwin)"
148         METACITY="$(type -p metacity)"
149         SKIP_CHECKS="yes"
150         EOF
151
152         domenu "${FILESDIR}"/compiz.desktop
153 }
154
155 pkg_preinst() {
156         use gnome && use gconf && gnome2_gconf_savelist
157 }
158
159 pkg_postinst() {
160         use gnome && use gconf && gnome2_gconf_install
161
162         ewarn "If you update to x11-wm/metacity-2.24 after you install ${P},"
163         ewarn "gtk-window-decorator will crash until you reinstall ${PN} again."
164 }
165
166 pkg_prerm() {
167         use gnome && gnome2_gconf_uninstall
168 }