1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit autotools eutils gnome2-utils
9 DESCRIPTION="OpenGL window and compositing manager"
10 HOMEPAGE="http://www.compiz.org/"
11 SRC_URI="http://releases.compiz.org/${PV}/${P}.tar.bz2"
13 LICENSE="GPL-2 LGPL-2.1 MIT"
15 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
16 IUSE="+cairo dbus fuse gnome gconf gtk kde +svg"
23 >=media-libs/mesa-6.5.1-r1
24 >=x11-base/xorg-server-1.1.1-r1
27 x11-libs/libXcomposite
33 >=x11-libs/libXrender-0.8.4
34 >=x11-libs/startup-notification-0.7
45 >=gnome-base/gnome-control-center-2.16.1:2
46 gnome-base/gnome-desktop:2
47 gconf? ( gnome-base/gconf:2 )
50 >=x11-libs/gtk+-2.8.0:2
51 >=x11-libs/libwnck-2.18.3:1
54 kde? ( >=kde-base/kwin-4.2.0 )
56 >=gnome-base/librsvg-2.14.0:2
61 DEPEND="${COMMONDEPEND}
64 x11-proto/xineramaproto
67 RDEPEND="${COMMONDEPEND}
74 DOCS=( AUTHORS ChangeLog NEWS README TODO )
77 echo gtk/gnome/compiz-wm.desktop.in >> po/POTFILES.skip
78 echo metadata/core.xml.in >> po/POTFILES.skip
80 # Patch for compatibility with gcc 4.7
81 epatch "${FILESDIR}"/${PN}-gcc-4.7.patch
83 if ! use gnome || ! use gconf; then
84 epatch "${FILESDIR}"/${PN}-no-gconf.patch
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
100 # We make gconf optional by itself, but only if gnome is also
101 # enabled, otherwise we simply disable it.
103 myconf="${myconf} $(use_enable gconf)"
105 myconf="${myconf} --disable-gconf"
109 --enable-fast-install \
111 --disable-gnome-keybindings \
112 --with-default-plugins \
113 $(use_enable svg librsvg) \
114 $(use_enable cairo annotate) \
116 $(use_enable dbus dbus-glib) \
118 $(use_enable gnome) \
119 $(use_enable gnome metacity) \
121 $(use_enable kde kde4) \
128 prune_libtool_files --all
130 # Install compiz-manager
131 dobin "${FILESDIR}"/compiz-manager
133 # Add the full-path to lspci
134 sed -i "s#lspci#/usr/sbin/lspci#" "${D}/usr/bin/compiz-manager" || die
136 # Fix the hardcoded lib paths
137 sed -i "s#/lib/#/$(get_libdir)/#g" "${D}/usr/bin/compiz-manager" || die
139 # Create gentoo's config file
140 dodir /etc/xdg/compiz
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)"
152 domenu "${FILESDIR}"/compiz.desktop
156 use gnome && use gconf && gnome2_gconf_savelist
160 use gnome && use gconf && gnome2_gconf_install
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."
167 use gnome && gnome2_gconf_uninstall