Browse files

moved bumblebee files to x11-misc category.re-digested

  • Loading branch information...
1 parent 50513e5 commit b10c572f7d1465b63212717ad2212f799c807cbf @iegor committed Aug 3, 2011
View
58 x11-misc/bumblebee/README
@@ -0,0 +1,58 @@
+This is ebuild for installing bumblebee on your gentoo machine.
+It was written for version 1.6.40.
+
+PLEASE READ INSTALL FILES VERY CAREFULLY BEFORE APPLYING CHANGES TO YOUR MACHINE.
+
+It might, and in fact as practise is showing contains errors.
+
+It will now be in testing stage for x64 and x86.
+
+Unchanged:
+- Still use unpacked VirtualGL files from a deb package
+- Still, probably, need some manual work with files.
+- Still doesn't use start and stop mechanisms with acpi_call.
+
+what is new:
+- It will try to recognise your laptop while installing.
+ If it doesn't know your laptop, it will ask what type of
+ connection (CRT-0, DFP-0) you are using.
+
+- Doesn't need to store backups.
+
+- Added simple script to get rid of previous installation. (uninstall_bumblebee.sh)
+ Use verry carefully !!!
+ Just removes all files that were installed by previous version install
+
+- Have a dependency, acpi_call ebuild, it is now in main tree
+ so there should be no problems.
+
+- X nvidia instance now uses own libglx.so, so if I understand
+ everything correctly then the second X instance has hw acceleration
+ too.
+
+- x86 support.
+
+Problems:
+- some documentation files are automatically packaged while installing.
+ Don't know how to fix that yet :(
+
+
+plans for future:
+- A cup of tea (or coffee)
+- Arrange usage of VirtualGL ebuild from https://github.com/speckins/usr-local-portage
+- Rearrange of git repo to make an overlay.
+- Testing.
+- Moving bumblebee install into rainyday overlay.
+
+INSTALLATION:
+"sudo layman -S"
+"sudo layman -add rainyday"
+"sudo emerge -avt bumblebee"
+
+That will make possible to do next
+sudo layman -a(--add) bumblebee
+from your terminal.
+
+Good luck.
+iegor
+
View
705 x11-misc/bumblebee/bumblebee-0.0.2.ebuild
@@ -0,0 +1,705 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="4"
+
+inherit git rpm
+
+# EGIT_REPO_URI="git://github.com/MrMEEE/bumblebee.git"
+# https://github.com/MrMEEE/bumblebee.git
+
+DESCRIPTION="This project is containing bumblebee (Formerly known as prime-ng).\
+Bumblebee is Optimus support for Linux, with real offloading, and not\
+switchable graphics.. More important.. it works on Optimus Laptops without a\
+graphical multiplexer..\
+Bumblebee Supports: Ubuntu, Linux Mint, OpenSuSE and Fedora. More\
+are coming."
+HOMEPAGE="https://github.com/MrMEEE/bumblebee"
+SRC_URI=""
+
+#EGIT_REPO_URI=git://github.com/iegor/bumblebee-Gentoo-support.git
+EGIT_REPO_URI="git://github.com/MrMEEE/bumblebee.git"
+EGIT_BRANCH=master
+
+LICENSE="BEER-WARE"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="nvidia"
+PROPERTIES="interactive"
+FEATURES="sandbox collision-protect strict"
+
+CATEGORY="app-misc"
+
+MERGE_TYPE="binary"
+
+# Current project depends on some libraries and other packages
+# 1. Captain obvious is warns you that you will have to install nvidia-drivers package
+# 2. Bumblebee using acpi_call module to switch nvidia graphics on|off
+# home page of acpi_call project is https://github.com/mkottman/acpi_call
+# bugs.gentoo.org contains info about existing ebuild.
+# http://bugs.gentoo.org/356605
+# Written by Maxim Koltsov
+# When I contacted him he said that he commited acpi_call abuild into tree, so
+# hopefully it will appear there soon.
+# But for now I will use sunrise overlay ebuild called sys-power/acpi_call-9999
+# 3. Bumblebee is also using VirtualGL to be able to render with nvidia card
+# home page for that is till unknown to me.
+# bugs.gentoo.org contains info on VirtualGL existing ebuild.
+# http://bugs.gentoo.org/313305
+# I plan to use VirtualGL ebuild written by Steven Peckins
+# I have wrote a letter to author and I will include ebuild as soon as I receive any
+# answer from him, hopefully with home page :)
+
+DEPEND="x11-drivers/nvidia-drivers
+sys-power/acpi_call
+x11-apps/mesa-progs
+sys-apps/dmidecode
+app-arch/rpm"
+# We needed libselinux only for launching xdm-optimus binary executable
+# Now when it is completely removed from bumblebee it is not used by us
+# "sys-libs/libselinux"
+RDEPEND="${DEPEND}"
+
+# What version of bumblebee do we use ?
+BUMBLEBEEVERSION=1.6.40
+
+#DISTRO="gentoo"
+#BUMBLEBEEPWD=${PWD}
+
+# Setting monitor connection type
+CONNECTEDMONITOR="UNDEFINED"
+
+# "The Image Transport is how the images are transferred from the"
+# "nVidia card to the Intel card, people has different experiences of"
+# "performance, but just select the default if you are in doubt."
+#
+# "I recently found out that yuv and jpeg both has some lagging"
+# "this is only noticable in fast moving games, such as 1st person"
+# "shooters and for me, its only good enough with xv, even though"
+# "xv sets down performance a little bit."
+#
+# "1) YUV"
+# "2) JPEG"
+# "3) PROXY"
+# "4) XV (default)"
+# "5) RGB"
+#IMAGETRANSPORT="xv"
+
+POWERON="UNDEFINED"
+POWEROFF="UNDEFINED"
+INTELBUSID="UNDEFINED"
+NVIDIABUSID="UNDEFINED"
+
+# Determine Arch x86_64 or i686
+ARCH=$(uname -m)
+
+# We need to know what laptop we are running
+MACHINE_PRODUCT_NAME="UNDEFINED"
+
+small_debug_foo() {
+ echo ROOT_UID "[ ${ROOT_UID} ]"
+ echo HOME "[ ${HOME} ]"
+ echo ARCH "[ ${ARCH} ]"
+ echo PORTAGE_TMPDIR "[ ${PORTAGE_TMPDIR} ]"
+ echo M "[ ${M} ]"
+ echo S "[ ${S} ]"
+ echo D "[ ${D} ]"
+ # should be /var/tmp/portage/app-misc/bumblebee-1.1.2-r42/work
+ echo WORKDIR "[ ${WORKDIR} ]"
+}
+
+# Probably will need to specify EGIT_STORE_DIR manually
+# EGIT_STORE_DIR
+
+# Directory to store default config for bumblebee
+BUMBLEBEE_DEFAULT_CONFIG_DIR=/etc/default/bumblebee
+
+# Directory to store our backup so we stop poluting in etc
+CONF_BACKUP_DIR=${BUMBLEBEE_DEFAULT_CONFIG_DIR}/configs_backup
+
+# Creating my own path variable containing path to current version of bumblebee
+# and modifying S path
+MY_P=bumblebee-${BUMBLEBEEVERSION}
+S="${WORKDIR}/${MY_P}"
+
+check_rights() {
+ ebegin "Checking user rights"
+ ROOT_UID=0
+ if [ ${UID} != ${ROOT_UID} ]; then
+ eerror "You don't have sufficient privileges to run this script."
+ eend 1
+ return 1
+ fi
+
+ if [ ${HOME} = /root ]; then
+ eerror "Do not run this script as the root user"
+ eend 1
+ return 1
+ fi
+
+ eend 0
+ return 0
+}
+
+check_machine() {
+ ebegin "Determining laptop model"
+# einfo "For now laptop model is set to default N61Jv, that will be changed when"
+# einfo "I will have a way to parse dmidecode output like \"Product Name: N61Jv\""
+ MACHINE_PRODUCT_NAME=$(dmidecode --string system-product-name)
+ eend 0
+
+ echo "Detected Poduct Name: [ ${MACHINE_PRODUCT_NAME} ]"
+
+ # We need to set arch name here before installation of VGL began
+ # Little hack to work around i686 <-> i386 package names.
+ if [ "${ARCH}" = "i686" ]; then
+ ARCH="i386"
+ fi
+}
+
+# Manual selection of connection type for users monitor
+# Try to determine a monitor connection type that used
+manual_set_connection_type() {
+ echo
+ echo "Select your Laptop:"
+ echo "0) Alienware M11X R1/R2"
+ echo "1) Dell XPS 15/17 L502x/L702x"
+ echo "2) Dell XPS 15/17 L501x/L701x"
+ echo "3) CLEVO W150HNQ"
+ echo "4) Asus EeePC 1215N"
+ echo "5) Acer Aspire 5745PG/5742G/8951G"
+ echo "6) Dell Vostro 3300"
+ echo "7) Dell Vostro 3400/3500/3700"
+ echo "8) Samsung RF511/RF711/QX410-J01/QX310"
+ echo "9) Toshiba Satellite M645-SP4132L"
+ echo "10) Asus U30J/UL30VT/U30JC/U31JG/P31JG/U35J/U36JC/U43JC/U35JC/U43JC/U53JC/P52JC/K52JC/X52JC/N53SV/X53SV/N61Jv/X64JV/N73JN"
+ echo "11) Dell Latitude E6420"
+ echo "12) MSI FX700"
+ echo "13) Lenovo T410"
+ echo
+ echo "97) Manually Set Output to CRT-0"
+ echo "98) Manually Set Output to DFP-0"
+ echo "99) Manually Enter Output"
+
+ echo
+ read machine
+ echo
+
+ case "${machine}" in
+
+ 0)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 1)
+ CONNECTEDMONITOR="DFP-0"
+ ;;
+
+ 2)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 3)
+ CONNECTEDMONITOR="DFP-0"
+ ;;
+
+ 4)
+ CONNECTEDMONITOR="DFP-0"
+ ;;
+
+ 5)
+ CONNECTEDMONITOR="DFP-0"
+ ;;
+
+ 6)
+ CONNECTEDMONITOR="DFP-0"
+ ;;
+
+ 7)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 8)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 9)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 10)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 11)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 12)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 13)
+ CONNECTEDMONITOR="DFP-0"
+ ;;
+
+
+ 97)
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ 98)
+ CONNECTEDMONITOR="DFP-0"
+ ;;
+
+ 99)
+ echo
+ echo "Enter output device for nVidia Card"
+ echo
+ read manualinput
+ CONNECTEDMONITOR=`echo ${manualinput}`
+ ;;
+
+
+ *)
+ echo
+ ewarn "You did not entered your laptop model, Default will be used (CTR-0)"
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ esac
+}
+
+# Conducting "installation" of VGL, probably will be replaced in future by some
+# existent ebuilds
+virtual_gl_ala_install_improvisation() {
+
+ # ebegin "Creating a directory tree for VGL"
+ # mkdir -p /opt/VirtualGL/fakelib/64
+ # mkdir -p /opt/VirtualGL/bin
+ # mkdir -p /opt/VirtualGL/include
+ # eend 0
+
+ # Install
+ vglver=2.2.2
+ ebegin "Installing VGL files into your ${ARCH} system"
+ exeinto /opt/VirtualGL/bin
+ doexe ${S}/install-files/VirtualGL.${ARCH}/opt/VirtualGL/bin/cpustat || ( eend 1 && return 1 )
+ doexe ${S}/install-files/VirtualGL.${ARCH}/opt/VirtualGL/bin/glxinfo || ( eend 1 && return 1 )
+ doexe ${S}/install-files/VirtualGL.${ARCH}/opt/VirtualGL/bin/glxspheres || ( eend 1 && return 1 )
+ doexe ${S}/install-files/VirtualGL.${ARCH}/opt/VirtualGL/bin/nettest || ( eend 1 && return 1 )
+ doexe ${S}/install-files/VirtualGL.${ARCH}/opt/VirtualGL/bin/tcbench || ( eend 1 && return 1 )
+
+ exeinto /usr/bin
+ doexe ${S}/install-files/VirtualGL.${ARCH}/usr/bin/vglclient || ( eend 1 && return 1 )
+ dosym /usr/bin/vglclient /opt/VirtualGL/bin/vglclient || ( eend 1 && return 1 )
+
+ doexe ${S}/install-files/VirtualGL.${ARCH}/usr/bin/vglconfig || ( eend 1 && return 1 )
+ dosym /usr/bin/vglconfig /opt/VirtualGL/bin/vglconfig || ( eend 1 && return 1 )
+
+ doexe ${S}/install-files/VirtualGL.${ARCH}/usr/bin/vglconnect || ( eend 1 && return 1 )
+ dosym /usr/bin/vglconnect /opt/VirtualGL/bin/vglconnect || ( eend 1 && return 1 )
+
+ doexe ${S}/install-files/VirtualGL.${ARCH}/usr/bin/vglgenkey || ( eend 1 && return 1 )
+ dosym /usr/bin/vglgenkey /opt/VirtualGL/bin/vglgenkey || ( eend 1 && return 1 )
+
+ doexe ${S}/install-files/VirtualGL.${ARCH}/usr/bin/vgllogin || ( eend 1 && return 1 )
+ dosym /usr/bin/vgllogin /opt/VirtualGL/bin/vgllogin || ( eend 1 && return 1 )
+
+ doexe ${S}/install-files/VirtualGL.${ARCH}/usr/bin/vglrun || ( eend 1 && return 1 )
+ dosym /usr/bin/vglrun /opt/VirtualGL/bin/vglrun || ( eend 1 && return 1 )
+
+ doexe ${S}/install-files/VirtualGL.${ARCH}/usr/bin/vglserver_config || ( eend 1 && return 1 )
+ dosym /usr/bin/vglserver_config /opt/VirtualGL/bin/vglserver_config || ( eend 1 && return 1 )
+
+ if [ "${ARCH}" = "x86_64" ]; then
+ exeinto /opt/VirtualGL/bin
+ doexe ${S}/install-files/VirtualGL.${ARCH}/opt/VirtualGL/bin/glxspheres64 || ( eend 1 && return 1 )
+
+ insinto /usr/lib64
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib64/libdlfaker.so libdlfaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib64/libdlfaker.so.${vglver} /usr/lib64/libdlfaker.so || ( eend 1 && return 1 )
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib64/libgefaker.so libgefaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib64/libgefaker.so.${vglver} /usr/lib64/libgefaker.so || ( eend 1 && return 1 )
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib64/librrfaker.so librrfaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib64/librrfaker.so.${vglver} /usr/lib64/librrfaker.so || ( eend 1 && return 1 )
+ dosym /usr/lib64/librrfaker.so.${vglver} /opt/VirtualGL/fakelib/64/libGL.so || ( eend 1 && return 1 )
+
+ insinto /usr/lib32
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib/libdlfaker.so libdlfaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib32/libdlfaker.so.${vglver} /usr/lib32/libdlfaker.so || ( eend 1 && return 1 )
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib/libgefaker.so libgefaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib32/libgefaker.so.${vglver} /usr/lib32/libgefaker.so || ( eend 1 && return 1 )
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib/librrfaker.so librrfaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib32/librrfaker.so.${vglver} /usr/lib32/librrfaker.so || ( eend 1 && return 1 )
+ dosym /usr/lib32/librrfaker.so.${vglver} /opt/VirtualGL/fakelib/libGL.so || ( eend 1 && return 1 )
+ elif [ "${ARCH}" = "i386" ]; then
+ insinto /usr/lib
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib/libdlfaker.so libdlfaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib/libdlfaker.so.${vglver} /usr/lib/libdlfaker.so || ( eend 1 && return 1 )
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib/libgefaker.so libgefaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib/libgefaker.so.${vglver} /usr/lib/libgefaker.so || ( eend 1 && return 1 )
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/lib/librrfaker.so librrfaker.so.${vglver} || ( eend 1 && return 1 )
+ dosym /usr/lib/librrfaker.so.${vglver} /usr/lib/librrfaker.so || ( eend 1 && return 1 )
+ dosym /usr/lib/librrfaker.so.${vglver} /opt/VirtualGL/fakelib/libGL.so || ( eend 1 && return 1 )
+ fi
+
+ insinto /usr/include
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/include/rr.h rr.h || ( eend 1 && return 1 )
+ dosym /usr/include/rr.h /opt/VirtualGL/include/rr.h || ( eend 1 && return 1 )
+
+ newins ${S}/install-files/VirtualGL.${ARCH}/usr/include/rrtransport.h rrtransport.h || ( eend 1 && return 1 )
+ dosym /usr/include/rrtransport.h /opt/VirtualGL/include/rrtransport.h || ( eend 1 && return 1 )
+
+ insinto "/usr/share/doc/VirtualGL-${vglver}"
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/411.gif" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/422.gif" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/444.gif" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/ChangeLog.txt" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/LGPL.txt" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/LICENSE.txt" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/LICENSE-FLTK.txt" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/LICENSE-PuTTY.txt" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/LICENSE-xauth.txt" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/chromium-displaywall.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/chromium-sortfirst.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/chromium-sortlast.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/configdialog.gif" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/exceed1.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/exceed2.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/exceed3.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/exceed6.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/index.html" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/somerights20.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/sshtunnel.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/sunray.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/sunrayvgltransport.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/vgltransport.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/vgltransportservernetwork.png" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/virtualgl.css" || ( eend 1 && return 1 )
+ doins "${S}/install-files/VirtualGL.${ARCH}/usr/share/doc/VirtualGL-${vglver}/x11transport.png" || ( eend 1 && return 1 )
+ dosym "/usr/share/doc/VirtualGL-${vglver}" "/opt/VirtualGL/doc" || ( eend 1 && return 1 )
+ eend 0
+
+ return 0
+}
+
+pkg_setup() {
+ # ewarn "THIS SCRIPT MUST BE RUN WITH SUDO"
+
+ # Seems obvious, but better safe than sorry
+ check_rights || die "Please run the installation with: sudo"
+
+ echo "WELCOME to the bumblebee installation v.${BUMBLEBEEVERSION}"
+ echo "Licensed under Red Bull, BEER-WARE License and GPL"
+ echo
+ echo "This will enable you to utilize both your Intel and nVidia card"
+ echo
+ echo "Please note that this script will probably only work with Ubuntu,"
+ echo "Debian, OpenSuSE and Fedora Based machines"
+ echo "and has (by me) only been tested on Ubuntu Natty 11.04 and"
+ echo "Fedora 14 but should work on others as well"
+
+ # Determinig bus ids for our cards
+ # NOTE: That can be copied from MrMEEE's laptop database,
+ # see "bumblebee-submitsystem", (will be introduced later)
+ # INTELBUSID=`echo "PCI:"\`lspci |grep VGA |grep Intel |cut -f1 -d:\`":"\`lspci |grep VGA |grep Intel |cut -f2 -d: |cut -f1 -d.\`":"\`lspci |grep VGA |grep Intel |cut -f2 -d. |cut -f1 -d" "\``
+ NVIDIABUSID=`echo "PCI:"\`lspci |grep VGA |grep nVidia |cut -f1 -d:\`":"\`lspci |grep VGA |grep nVidia |cut -f2 -d: |cut -f1 -d.\`":"\`lspci |grep VGA |grep nVidia |cut -f2 -d. |cut -f1 -d" "\``
+
+ # Now check the laptop model
+ check_machine
+
+ # Way to configure monitor connection type automatically
+ # Unfortunately it can't be used unless nvidia card is
+ # enabled with acpi_call command
+ # I will leave that for now and deal with it in the
+ # future
+# ebegin "Autodetecting monitor connection type"
+# ${MODPROBE} nvidia-current
+# ${MODPROBE} acpi_call
+# if [ $(LD_LIBRARY_PATH=/usr/lib/nvidia /usr/bin/nvidia-xconfig --query-gpu-info|grep "Display Devices"|cut -f2 -d":") -gt 0 ]; then
+# CONNECTEDMONITOR=$(LD_LIBRARY_PATH=/usr/lib/nvidia /usr/bin/nvidia-xconfig --query-gpu-info|grep "Display Device 0"|cut -f2 -d\( | cut -f1 -d\))
+# fi
+# ${MODPROBE} -r nvidia-current
+# ${MODPROBE} -r acpi_call
+# eend 0
+
+ # turn off case sensitivity for this comparison only
+ shopt -s nocasematch
+
+ case ${MACHINE_PRODUCT_NAME} in
+
+ "U30J"|\
+ "UL30VT"|\
+ "U30JC"|\
+ "U31JG"|\
+ "P31JG"|\
+ "U35J"|\
+ "U36JC"|\
+ "U43JC"|\
+ "U35JC"|\
+ "U43JC"|\
+ "U53JC"|\
+ "P52JC"|\
+ "K52JC"|\
+ "X52JC"|\
+ "N53SV"|\
+ "X53SV"|\
+ "N61Jv"|\
+ "X64JV"|\
+ "N73JN"|\
+ "0PXM4R")
+ CONNECTEDMONITOR="CRT-0"
+ ;;
+
+ "1215N"|\
+ "5745PG"|\
+ "5742G"|\
+ "8951G")
+ CONNECTEDMONITOR="DFP-0"
+ ;;
+
+ *)
+ echo "Can't determine your lcd pane connection type automatically"
+ echo "Please enter it manually"
+ manual_set_connection_type
+ ;;
+
+ esac
+
+ shopt -u nocasematch
+
+ echo "CONNECTEDMONITOR is set to [ ${CONNECTEDMONITOR} ]"
+
+ # Set new bumblebee group
+# ebegin "Create bumblebee group and add us there"
+# enewgroup bumblebee
+# eend 0
+}
+
+src_unpack() {
+ # Handle MrMEEE's files getting
+# EGIT_REPO_URI="git://github.com/MrMEEE/bumblebee.git"
+# EGIT_BRANCH=master
+ ebegin "Getting MrMEEE's repo"
+ git_fetch
+ eend ${?}
+
+ # Handle unpacking rpm VirtualGL install
+ ebegin "Unpacking VirtualGL rpm install for ${ARCH}"
+ if [ "${ARCH}" = "x86_64" ]; then
+ cd ${S}/install-files/
+ rpmunpack ${S}/install-files/VirtualGL.x86_64.rpm
+ elif [ "${ARCH}" = "i386" ]; then
+ cd ${S}/install-files/
+ rpmunpack ${S}/install-files/VirtualGL.i386.rpm
+ fi
+ eend 0
+}
+
+#src_prepare() {
+#}
+
+src_install() {
+# echo S "[ ${S} ]"
+# echo D "[ ${D} ]"
+
+ # Creating directory to store bumblebee beckups and default settings
+# dodir ${CONF_BACKUP_DIR}
+# ebegin "Backing up your Configuration"
+# cp -n /etc/conf.d/modules "${CONF_BACKUP_DIR}"/modules.optiorig
+ # cp -n /etc/X11/xorg.conf "${CONF_BACKUP_DIR}"/xorg.conf.optiorig
+# eend 0
+# einfo "Your config backups will be stored in ${CONF_BACKUP_DIR}"
+
+ # Setting up and configuring xorg.config.nvidia file
+ ebegin "Adjusting xorg.config.nvidia"
+# cp ${FILESDIR}/etc/X11/xorg.conf.intel ${S}
+# cp ${FILESDIR}/etc/X11/xorg.conf.nvidia ${S}
+# sed -i 's/REPLACEWITHBUSID/'${INTELBUSID}'/g' ${S}/install-files/xorg.conf.intel || ( eend 1 && die "Can't access ${S}/install-files/xorg.conf.intel for configuration" )
+ sed -i 's/REPLACEWITHBUSID/'${NVIDIABUSID}'/g' ${S}/install-files/xorg.conf.nvidia || ( eend 1 && die "Can't access ${S}/install-files/xorg.conf.nvidia for configuration" )
+ # Setting output device to: CONNECTEDMONITOR variable
+ sed -i 's/REPLACEWITHCONNECTEDMONITOR/'${CONNECTEDMONITOR}'/g' ${S}/install-files/xorg.conf.nvidia || ( eend 1 && die "Can't access ${S}/install-files/xorg.conf.nvidia for configuration" )
+ # now install modified config files into /etc/X11
+ insinto /etc/X11
+# newins "${WORKDIR}/etc/X11/xorg.conf.intel" xorg.conf || die "intel xorg configuration copying failed"
+ doins "${S}/install-files/xorg.conf.nvidia" || ( eend 1 && die "nvidia xorg configuration copying failed" )
+ eend 0
+
+ # Copy bumblebee specific executables into /usr/local/bin
+ ebegin "Copying bumblebee specific files"
+ exeinto /usr/local/bin
+ doexe ${S}/install-files/bumblebee-bugreport || ( eend 1 && die )
+# doexe ${S}/install-files/bumblebee-uninstall || ( eend 1 && die )
+ doexe ${S}/install-files/bumblebee-submitsystem || ( eend 1 && die )
+ doexe ${S}/install-files/bumblebee-enablecard || ( eend 1 && die )
+ doexe ${S}/install-files/bumblebee-disablecard || ( eend 1 && die )
+
+ # Installing default configuration
+ insinto ${BUMBLEBEE_DEFAULT_CONFIG_DIR}
+ newins ${S}/install-files/bumblebee.default bumblebee || ( eend 1 && die )
+
+ # Installing documentation
+ insinto /usr/share/doc/bumblebee
+ doins ${S}/install-files/documentation || ( eend 1 && die )
+ doins ${S}/install-files/ubuntu/* || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.1015PN || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.1215n || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.K42Jc.K52Jc.N53Jf.N53Jg.N71JV.N73JF.P52JC.U30JC.U33JC.U35JC.U36JC || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.U41SV.N53SN || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.U43Jc || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.UL30VT || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.e6420 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.fedora.N53SV || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.m11xr2 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.p31jg || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.t410 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.template.fedora || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.template.opensuse || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.template.ubuntu || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.vostro3500 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-disablecard.xps15 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.1015PN || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.1215n || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.K42Jc.K52Jc.N53Jf.N53Jg.N71JV.N73JF.P52JC.U30JC.U33JC.U35JC.U36JC || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.U41SV.N53SN || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.U43Jc || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.UL30VT || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.e6420 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.fedora.N53SV || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.m11xr2 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.p31jg || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.t410 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.template.fedora || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.template.opensuse || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.template.ubuntu || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.vostro3500 || ( eend 1 && die )
+# doins ${S}/install-files/bumblebee-enablecard.xps15 || ( eend 1 && die )
+ eend 0
+
+ # Perform installation of VirtualGL
+ virtual_gl_ala_install_improvisation || die
+
+ ebegin "Installing bumblebee service"
+ newinitd "${FILESDIR}/bumblebee.initd" bumblebee || ( eend 1 && die )
+ newconfd "${FILESDIR}/bumblebee.confd" bumblebee || ( eend 1 && die )
+ eend 0
+
+ # Install executables to launch apps with bumblebee support
+ ebegin "Install optirun executables"
+ exeinto /usr/local/bin
+ if [ ${ARCH} = "x86_64" ]; then
+ doexe ${FILESDIR}/optirun64
+ doexe ${FILESDIR}/optirun32
+ dosym /usr/local/bin/optirun64 /usr/local/bin/optirun
+ elif [ "${ARCH}" = "i386" ]; then
+ newexe ${FILESDIR}/optirun64 optirun
+ fi
+ eend 0
+
+ # Install vgl-client-service
+ ebegin "Setup vglclient service"
+ exeinto /usr/bin
+ doexe ${FILESDIR}/vglclient-service || ( eend 1 && die )
+
+ # Let vglclient-service autorun each time we start
+ # This is an awful hack, but I didn't found any way yet around it
+# VGL_CLIENT_USER=$(env |grep SUDO_USER |cut -f2 -d=)
+# exeinto /home/${VGL_CLIENT_USER}/.config/autostart
+# doexe ${S}/install-files/vglclient.desktop || ( eend 1 && die )
+ # change owner to current user, who installs bumblebee
+# fowners ${VGL_CLIENT_USER}:${VGL_CLIENT_USER} \
+# /home/${VGL_CLIENT_USER}/.config/autostart/vglclient.desktop
+ eend 0
+
+# die "Hey !!! Debugging interrupt, to see what is going on"
+}
+
+pkg_preinst() {
+ # probe all modules
+ depmod -a
+
+ ldconfig
+
+ # Removing nouveau module and put it to blacklist
+ modprobe -r nouveau
+
+ # Check if nouveau is in blacklist.conf
+ ebegin "Remove nouveau from /etc/modprobe.d/backlist.conf"
+# if [ "`cat /etc/modprobe.d/blacklist.conf |grep "blacklist nouveau" |wc -l`" -ne "0" ]; then
+ if [ "$(cat /etc/modprobe.d/blacklist.conf |grep "blacklist nouveau" |wc -l)" -ne "0" ]; then
+ grep -Ev 'nouveau' /etc/modprobe.d/blacklist.conf > /tmp/blacklist.conf
+ mv /tmp/blacklist.conf /etc/modprobe.d/blacklist.conf
+ fi
+ eend 0
+
+ # Add nouveau into blacklist if not present in blacklist
+ echo "blacklist nouveau" >> /etc/modprobe.d/nouveau-blacklist.conf
+
+ # Adding module to load list (for baselayout 2) and then inserting it
+ modprobe nvidia
+
+ # Add nvidia module into modules autoload list
+ # if [ "`cat /etc/modules |grep "nvidia" |wc -l`" -eq "0" ]; then
+ # echo "nvidia" >> /etc/modules
+ # fi
+
+ #if [ -d ${HOME}/.kde/Autostart ]; then
+ # if [ -f ${HOME}/.kde/Autostart/vlgclient-service ]; then
+ # rm ${HOME}/.kde/Autostart/vglclient-service
+ # fi
+ # ln -s /usr/bin/vglclient-service ${HOME}/.kde/Autostart/vglclient-service
+ #fi
+}
+
+pkg_postinst() {
+ # ebegin "Enabling bumblebee Service"
+ # /etc/init.d/xdm-optimus start
+
+ echo "Please logout and back in"
+ echo
+ echo "If you want power saving by shutting the nVidia down when not in use."
+ echo "Please adjust the scripts:"
+ echo "/usr/local/bin/bumblebee-enablecard and"
+ echo "/usr/local/bin/bumblebee-disablecard for your machine."
+ echo
+ echo "Examples and documentation is available in /usr/share/doc/bumblebee/"
+ echo
+ if [ "${ARCH}" = "x86_64" ]; then
+ echo "After that you should be able to start applications with"
+ echo "\"optirun32 <application>\" or \"optirun64 <application>\""
+ echo "optirun32 can be used for legacy 32-bit applications and Wine Games.."
+ echo "Everything else should work on optirun64"
+ echo "But... if one doesn't work... try the other"
+ elif [ "${ARCH}" = "i386" ]; then
+ echo "After that you should be able to start applications with"
+ echo "\"optirun <application>\"."
+ fi
+ echo
+ echo "If you have any problems in or after the installation"
+ echo "please run the bumblebee-bugreport tool and send me a bugreport."
+ echo "to rmtdev@gmail.com"
+ echo
+ echo "Or even better.. create an issue on github"
+ echo "https://github.com/iegor/bumblebee-Gentoo-support"
+ echo "this really makes bugfixing much easier for me and faster for you."
+ echo
+ echo "If you need to reconfigure bumblebee the script"
+ echo "bumblebee-config as available."
+ echo "but I did not tested it yet under gentoo"
+ echo
+ echo "And please... I your system is working.. run the bumblebee-submitsystem"
+ echo "utility"
+ echo
+ echo "Good luck... MrMEEE / Martin Juhl"
+ echo " rainman / Iegor Danylchenko"
+ echo
+ echo "http://www.martin-juhl.dk, http://twitter.com/martinjuhl, https://github.com/MrMEEE/bumblebee"
+}
+
+#pkg_config() {
+# ebegin "<> pkg_config()"
+# eend ${?}
+#}
View
34 x11-misc/bumblebee/files/bumblebee.confd
@@ -0,0 +1,34 @@
+# You can set {TRUE; YES} or {FALSE; NO} case is irrelevant
+
+# DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/default-display-manager
+# DEFAULT_DISPLAY_MANAGER_FILE=/etc/X11/xdm
+
+# PATH=/bin:/usr/bin:/sbin:/usr/sbin
+DAEMON=/usr/bin/X
+
+DAEMON_ARGS="-ac -config /etc/X11/xorg.conf.nvidia -sharevts -modulepath /usr/lib/opengl/nvidia/extensions,/usr/lib/xorg/modules -nolisten tcp -noreset :1 vt8"
+DAEMON_WAIT_INTERVAL=2
+
+VGLDAEMON=/usr/bin/vglclient
+VGLDAEMON_ARGS="gl"
+
+PIDFILE=/tmp/.X1-lock
+
+ACPI_CALL_MODULE_NAME=acpi_call
+ACPI_CALL_MODULE=/lib/modules/$(uname -r)/build/acpi_call.ko
+
+BUMBLEBEE_SERVICE_NAME=bumblebee
+
+# Do we need to disable our card when stopping service ?
+BUMBLEBEE_DISABLE_CARD_ON_STOP=TRUE
+
+# It may be that module will be needed by someone when we are done.
+BUMBLEBEE_REMOVE_UNUSED_MODULE=FALSE
+
+# Next goes laptop specific variables.
+# You can take those from MrMEE scripts which are
+# comes with bumblebee installation, or from
+# his bumblebee-settings base
+BUMBLEBEE_CMD_BLOCK=\_SB.PCI0.PEGR.GFX0.
+
+BUMBLEBEE_CMD__DSM_BLOCK="${NV_OPTIMUS_CMD_BLOCK}_DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}"
View
207 x11-misc/bumblebee/files/bumblebee.initd
@@ -0,0 +1,207 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+# Script for using bumblebee and it's certain dependencies as service.
+
+#NB: Config is in /etc/conf.d/bumblebee
+
+### BEGIN INIT INFO
+# Provides: xdm-optimus
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Should-Start: xfs $named slapd hal
+# Should-Stop: xfs $named slapd hal
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: The X Display Manager for Optimus
+### END INIT INFO
+
+# set -e
+
+#. /lib/lsb/init-functions
+
+# To start xdm even if it is not the default display manager, change
+# HEED_DEFAULT_DISPLAY_MANAGER to "false."
+# Also overridable from command line like:
+# HEED_DEFAULT_DISPLAY_MANAGER=false /etc/init.d/xdm start
+[ -z "${HEED_DEFAULT_DISPLAY_MANAGER}" ] && HEED_DEFAULT_DISPLAY_MANAGER=true
+
+depend() {
+ need localmount xdm-setup
+ use consolekit xfs
+
+ provide bumblebee
+
+ # this should start as early as possible
+ # we can't do 'before *' as that breaks it
+
+ after bootmisc
+ # (#70689 comment #92) Start after consolefont to avoid display corruption
+ after consolefont
+ after modules
+ after netmount
+ after readahead-list
+
+ # (#139824) Start after ypbind and autofs for network authentication
+ after ypbind autofs
+ after openvpn
+
+ # (#145219 #180163) Could use lirc mouse as input device
+ after gpm
+ after lircmd
+
+ # (#291269) Start after quota, since some dm need readable home
+ after quota
+
+ before alsasound
+ after xdm
+}
+
+acpi_call () {
+ echo "$*" > /proc/acpi/call
+ cat /proc/acpi/call
+}
+
+insert_acpi_call_module() {
+ [ ! -f ${ACPI_CALL_MODULE} ] || ( eerror "module ${ACPI_CALL_MODULE} not found" && return 1 )
+
+ [ lsmod | grep -q "${ACPI_CALL_MODULE_NAME}" ] || ( eerror "${ACPI_CALL_MODULE} is already inserted" && return 1 )
+
+ ebegin "Inserting acpi_call module"
+ modprobe ${ACPI_CALL_MODULE}
+ local INS_RESULT=${?}
+ eend ${INS_RESULT}
+
+ [ ${INS_RESULT} -eq 0 ] || ( eerror "module ${ACPI_CALL_MODULE_NAME} was not inserted" && return 1 )
+
+ return 0
+}
+
+remove_acpi_call_module() {
+ [ ! `lsmod | grep -q "${ACPI_CALL_MODULE_NAME}"` ] || ( eerror "module is not inserted" && return 1 )
+
+ ebegin "Removing acpi_call module"
+ modprobe -r ${ACPI_CALL_MODULE_NAME}
+ local REM_RESULT=${?}
+ eend ${REM_RESULT}
+
+ # Check if we still have module inserted, then it probably means that something is using it
+ # we will not remove module in that case
+ [ ${REM_RESULT} -eq 0 ] || ( eerror "Module was not removed. leaving it as it is." && return 1 )
+
+ return 0
+}
+
+is_optimus_on() {
+ PSC=$(acpi_call "${BUMBLEBEE_CMD_BLOCK}_PSC")
+ echo _PSC is ${PSC}
+ case "${PSC}" in
+ 0x0)
+ # PSC="on"
+ return 0
+ ;;
+ 0x3)
+ # PSC="off"
+ return 1
+ ;;
+ esac
+ return 2
+}
+
+enable_nv_card() {
+ # Check if we already enabled nvidia card
+ is_optimus_on || ( eerror "nvidia card is already enabled" && return 1 )
+
+ ebegin "Enabling optimus nvidia card"
+ # Make _PS0 call
+ echo _PS0 $(acpi_call "${BUMBLEBEE_CMD_BLOCK}_PS0")
+ echo P3MO $(acpi_call "${BUMBLEBEE_CMD_BLOCK}P3MO")
+ echo DGPS $(acpi_call "${BUMBLEBEE_CMD_BLOCK}DGPS")
+ # Test to see if we did enabled it
+ is_optimus_on
+ local NVENABLE_RESULT=${?}
+ eend ${NVENABLE_RESULT}
+
+ [${NVENABLE_RESULT} -eq 0] || ( echo "Failed to enable nvidia card" && return 1 )
+
+ return 0
+}
+
+disable_nv_card() {
+ # Check if we already disabled nvidia card
+ [ ! is_optimus_on ] || ( eerror "Nvidia card is already disabled" && return 1 )
+
+ ebegin "Disabling optimus nvidia card"
+ # Make our DSM call
+ echo _DSM $(acpi_call ${BUMBLEBEE_CMD__DSM_BLOCK})
+ # Make _PS3 call
+ echo _PS3 $(acpi_call "${BUMBLEBEE_CMD_BLOCK}_PS3")
+ echo P3MO $(acpi_call "${BUMBLEBEE_CMD_BLOCK}P3MO")
+ echo DGPS $(acpi_call "${BUMBLEBEE_CMD_BLOCK}DGPS")
+ # Test to make sure we disabled it
+ is_optimus_on
+ local NVDISABLE_RESULT=${?}
+ eend ${NVDISABLE_RESULT}
+
+ [ ${NVDISABLE_RESULT} -eq 0 ] || ( echo "Failed to disable nvidia card" && return 1 )
+
+ return 0
+}
+
+wait_for_condition()
+{
+ echo interval "[ ${1} ]"
+ echo condition "[ ${2} ]"
+ i=1
+ while [ ${2} -eq 1 ]; do
+ sleep 1
+ i=`expr $i + 1`
+ if [ $i -gt ${1} ]; then
+ echo "condition not met in required interval"
+ return 1
+ fi
+ done
+ return 0
+}
+
+start() {
+ # Check if we already started bumblebee service
+ # Try to enable nvidia card
+ # Try to start bumblebee X instance
+ ebegin "Starting X instance"
+ export LD_PRELOAD="/usr/lib/opengl/nvidia/lib/libGL.so:/usr/lib/opengl/nvidia/lib/libnvidia-tls.so"
+ start-stop-daemon -v -S -q -b -p ${PIDFILE} -x ${DAEMON} -P -- ${DAEMON_ARGS} || eend 1
+ sleep ${DAEMON_WAIT_INTERVAL}
+ eend 0
+
+ # Wait 10 sec and check if it is started
+ # wait_for_condition 10 "ps aux |grep xorg.conf.nvidia |wc -l"
+
+ # Try to start a VGL daemon
+ #ebegin "Starting VGL instance"
+ #start-stop-daemon -v --start -q -b -x /usr/bin/vglclient -- -gl || eend 1
+ #eend 0
+}
+
+stop() {
+ # Kill bumblebee X instance
+ ebegin "Stopping X instance"
+ #kill $(cat ${PIDFILE})
+ start-stop-daemon -v -s SIGKILL -q -p ${PIDFILE} -P || eend 1
+ sleep ${DAEMON_WAIT_INTERVAL}
+ rm -f ${PIDFILE}
+ eend 0
+
+ # Kill bumblebee VGL instance
+ #ebegin "Stopping VGL instance"
+ # killall vglclient
+ #start-stop-daemon -v -s SIGKILL -q -n $(basename ${VGLDAEMON}) || eend 1
+ #eend 0
+
+ # Wait 10 sec
+ # wait_for_condition 10 "$(ps aux |grep xorg.conf.nvidia |wc -l) -ne 1"
+ # Check if we stopped bumblebee X instance
+ # Try to disable nvidia card
+}
View
10 x11-misc/bumblebee/files/optirun32
@@ -0,0 +1,10 @@
+#!/bin/bash
+# This script is a replacement of optirun64 alias
+# Testing to fix problems when launching from kmenu
+
+source /etc/default/bumblebee/bumblebee
+
+export ${VGL_READBACK}
+export LD_PRELOAD="/usr/lib32/opengl/nvidia/lib/libGL.so:/usr/lib32/opengl/nvidia/lib/libnvidia-tls.so"
+
+vglrun -c ${VGL_COMPRESS} -d ${VGL_DISPLAY} -ld /usr/lib32 -- "$@"
View
10 x11-misc/bumblebee/files/optirun64
@@ -0,0 +1,10 @@
+#!/bin/bash
+# This script is a replacement of optirun64 alias
+# Testing to fix problems when launching from kmenu
+
+source /etc/default/bumblebee/bumblebee
+
+export ${VGL_READBACK}
+export LD_PRELOAD="/usr/lib/opengl/nvidia/lib/libGL.so:/usr/lib/opengl/nvidia/lib/libnvidia-tls.so"
+
+vglrun -c ${VGL_COMPRESS} -d ${VGL_DISPLAY} -ld /usr/lib -- "$@"
View
2 x11-misc/bumblebee/files/vglclient-service
@@ -0,0 +1,2 @@
+#!/bin/bash
+/usr/bin/vglclient -gl

0 comments on commit b10c572

Please sign in to comment.