1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools multilib readme.gentoo-r1 systemd user
8 if [[ ${PV} == 9999 ]]; then
10 EGIT_REPO_URI="https://github.com/Bumblebee-Project/Bumblebee.git"
14 COMMIT="d469a32fc0dfef5b3725c7a5331be2d04b870594"
15 SRC_URI="https://github.com/Bumblebee-Project/Bumblebee/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
16 KEYWORDS="~amd64 ~x86"
18 S="${WORKDIR}/Bumblebee-${COMMIT}"
21 DESCRIPTION="Service providing elegant and stable means of managing Optimus graphics chipsets"
22 HOMEPAGE="https://bumblebee-project.org https://github.com/Bumblebee-Project/Bumblebee"
27 IUSE="+bbswitch video_cards_nouveau video_cards_nvidia"
36 RDEPEND="${COMMON_DEPEND}
38 x11-base/xorg-drivers[video_cards_nvidia?,video_cards_nouveau?]
39 bbswitch? ( sys-power/bbswitch )
42 DEPEND="${COMMON_DEPEND}
54 REQUIRED_USE="|| ( video_cards_nouveau video_cards_nvidia )"
66 if use video_cards_nvidia ; then
67 # Get paths to GL libs for all ABIs
69 for i in $(get_all_libdirs) ; do
70 nvlib="${nvlib}:/usr/${i}/opengl/nvidia/lib"
73 local nvpref="/usr/$(get_libdir)/opengl/nvidia"
74 local xorgpref="/usr/$(get_libdir)/xorg/modules"
75 ECONF_PARAMS="CONF_DRIVER=nvidia CONF_DRIVER_MODULE_NVIDIA=nvidia \
76 CONF_LDPATH_NVIDIA=${nvlib#:} \
77 CONF_MODPATH_NVIDIA=${nvpref}/lib,${nvpref}/extensions,${xorgpref}/drivers,${xorgpref}"
87 newconfd "${FILESDIR}"/${PN}.confd ${PN}
88 newinitd "${FILESDIR}"/${PN}.initd ${PN}
89 newenvd "${FILESDIR}"/${PN}.envd 99${PN}
90 systemd_dounit scripts/systemd/bumblebeed.service
92 local DOC_CONTENTS="In order to use Bumblebee, add your user to 'bumblebee' group.
93 You may need to setup your /etc/bumblebee/bumblebee.conf"
94 readme.gentoo_create_doc