| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/x11-misc/bumblebee/bumblebee-3.0-r2.ebuild,v 1.2 2012/06/05 08:45:24 pacho Exp $ |
| 4 |
|
| 5 |
EAPI="4" |
| 6 |
|
| 7 |
inherit multilib systemd user |
| 8 |
|
| 9 |
DESCRIPTION="Service providing elegant and stable means of managing Optimus graphics chipsets" |
| 10 |
HOMEPAGE="https://github.com/Bumblebee-Project/Bumblebee" |
| 11 |
SRC_URI="mirror://github/Bumblebee-Project/${PN/bu/Bu}/${P}.tar.gz" |
| 12 |
|
| 13 |
SLOT="0" |
| 14 |
LICENSE="GPL-3" |
| 15 |
KEYWORDS="~amd64 ~x86" |
| 16 |
|
| 17 |
IUSE="+bbswitch video_cards_nouveau video_cards_nvidia" |
| 18 |
|
| 19 |
RDEPEND="x11-misc/virtualgl |
| 20 |
bbswitch? ( sys-power/bbswitch ) |
| 21 |
virtual/opengl |
| 22 |
x11-base/xorg-drivers[video_cards_nvidia?,video_cards_nouveau?]" |
| 23 |
DEPEND=">=sys-devel/autoconf-2.68 |
| 24 |
sys-devel/automake |
| 25 |
sys-devel/gcc |
| 26 |
virtual/pkgconfig |
| 27 |
dev-libs/glib:2 |
| 28 |
x11-libs/libX11 |
| 29 |
dev-libs/libbsd |
| 30 |
sys-apps/help2man" |
| 31 |
|
| 32 |
REQUIRED_USE="|| ( video_cards_nouveau video_cards_nvidia )" |
| 33 |
|
| 34 |
src_configure() { |
| 35 |
if use video_cards_nvidia ; then |
| 36 |
# Get paths to GL libs for all ABIs |
| 37 |
local nvlib="" |
| 38 |
for i in $(get_all_libdirs) ; do |
| 39 |
nvlib="${nvlib}:/usr/${i}/opengl/nvidia/lib" |
| 40 |
done |
| 41 |
|
| 42 |
local nvpref="/usr/$(get_libdir)/opengl/nvidia" |
| 43 |
local xorgpref="/usr/$(get_libdir)/xorg/modules" |
| 44 |
ECONF_PARAMS="CONF_DRIVER=nvidia CONF_DRIVER_MODULE_NVIDIA=nvidia \ |
| 45 |
CONF_LDPATH_NVIDIA=${nvlib#:} \ |
| 46 |
CONF_MODPATH_NVIDIA=${nvpref}/lib,${nvpref}/extensions,${xorgpref}/drivers,${xorgpref}" |
| 47 |
fi |
| 48 |
|
| 49 |
econf ${ECONF_PARAMS} |
| 50 |
} |
| 51 |
|
| 52 |
src_install() { |
| 53 |
newconfd "${FILESDIR}"/bumblebee.confd bumblebee |
| 54 |
newinitd "${FILESDIR}"/bumblebee.initd bumblebee |
| 55 |
newenvd "${FILESDIR}"/bumblebee.envd 99bumblebee |
| 56 |
systemd_dounit scripts/systemd/bumblebeed.service |
| 57 |
default |
| 58 |
} |
| 59 |
|
| 60 |
pkg_preinst() { |
| 61 |
use video_cards_nvidia || rm "${ED}"/etc/bumblebee/xorg.conf.nvidia |
| 62 |
use video_cards_nouveau || rm "${ED}"/etc/bumblebee/xorg.conf.nouveau |
| 63 |
|
| 64 |
enewgroup bumblebee |
| 65 |
} |
| 66 |
|
| 67 |
pkg_postinst() { |
| 68 |
ewarn "In order to use Bumblebee, add your user to 'bumblebee' group." |
| 69 |
ewarn "You may need to setup your /etc/bumblebee/bumblebee.conf" |
| 70 |
} |