Commit 03f3d5de authored by philm's avatar philm
Browse files

bumblebee: add new pkg

bbswitch: add new pkg
parent f7f9439d
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# Find the kernel name inside the chroot
_extramodules=extramodules-`pacman -Q linux | cut -c7-9 | sed 's/linux //g'`-CHAKRA
_kver="$(cat /lib/modules/${_extramodules}/version)"
pkgname=bbswitch
pkgver=0.4.1
pkgrel=1
pkgdesc="kernel module allowing to switch dedicated graphics card on Optimus laptops"
arch=('i686' 'x86_64')
url=("http://github.com/Bumblebee-Project/bbswitch")
license=('GPL')
provides=('bbswitch')
install=bbswitch.install
depends=('linux>=3.2' 'linux<3.3')
source=("https://github.com/downloads/Bumblebee-Project/bbswitch/${pkgname}-${pkgver}.tar.gz")
md5sums=('9b2ab87770987af6264812ef99759c95')
build() {
cd ${srcdir}/${pkgname}-${pkgver}
make
}
package() {
cd ${srcdir}/${pkgname}-${pkgver}
msg2 "Building module for $_kver..."
# KDIR is necessary even when cleaning
make KDIR=/usr/src/linux-${_kver} clean
make KDIR=/usr/src/linux-${_kver}
mkdir -p $pkgdir//lib/modules/${_extramodules}
install -D -m644 bbswitch.ko $pkgdir/lib/modules/${_extramodules}
gzip "${pkgdir}/lib/modules/${_extramodules}/bbswitch.ko"
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/bbswitch.install"
}
\ No newline at end of file
post_install() {
EXTRAMODULES='extramodules-3.2-CHAKRA'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
echo 'In order to use nvidia module, reboot the system.'
}
post_upgrade() {
EXTRAMODULES='extramodules-3.2-CHAKRA'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
}
post_remove() {
EXTRAMODULES='extramodules-3.2-CHAKRA'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
}
\ No newline at end of file
#
# Chakra Packages for Chakra, part of chakra-project.org
#
# maintainer (i686): Phil Miller <philm[at]chakra-project[dog]org>
# maintainer (x86_64): Manuel Tortosa <manutortosa[at]chakra-project[dot]org>
# This script is incomplete and in development.
# AUR-Maintainer: Samsagax <samsagax@gmail.com>
pkgname=bumblebee
pkgver=3.0
pkgrel=1
pkgdesc="Bumblebee brings Optimus Support for Linux Through VirtualGL. You need to install proper drivers separately. Can be used with Nouveau or Nvidia"
arch=('i686' 'x86_64')
makedepends=('git')
depends=('virtualgl' 'libbsd' 'glib2')
optdepends=('xf86-video-nouveau: Nouveau driver' 'nouveau-dri: 3D acceleration features fo Nouveau' 'mesa: 3D acceleration features fo Nouveau' 'bbswitch: switch on/off discrete card' 'nvidia-utils-bumblebee: Nvidia utils not breaking LibGL' 'nvidia: Nvidia kernel driver')
if [ "$CARCH" = "x86_64" ]; then
optdepends[${#optdepends[@]}]='lib32-virtualgl: run 32bit applications with optirun'
fi
url="http://www.Bumblebee-Project.org"
license=("GPL3")
install='bumblebee.install'
provides=('bumblebee')
backup=('etc/bumblebee/bumblebee.conf')
source=("https://github.com/downloads/Bumblebee-Project/Bumblebee/${pkgname}-${pkgver}.tar.gz" 'bumblebeed.in')
md5sums=('2ddd4d47bc52aceb3b295e68f9f32ffe'
'8b05da760e9236ecff2c6820616119f7')
build() {
cd "${srcdir}/${pkgname}-${pkgver}"
./configure \
CONF_DRIVER_MODULE_NVIDIA=nvidia \
CONF_LDPATH_NVIDIA=/usr/lib/nvidia-bumblebee:/usr/lib32/nvidia-bumblebee \
CONF_MODPATH_NVIDIA=/usr/lib/nvidia-bumblebee/xorg/,/usr/lib/xorg/modules \
--prefix=/usr \
--sysconfdir=/etc
make
}
package() {
cd "${srcdir}/${pkgname}-${pkgver}"
make install DESTDIR="$pkgdir"
install -D -m755 "$srcdir/bumblebeed.in" "$pkgdir/etc/rc.d/bumblebeed"
# Make bash_completion work
mv -v "${pkgdir}/etc/bash_completion.d/bumblebee" "${pkgdir}/etc/bash_completion.d/optirun"
}
\ No newline at end of file
_notice() {
echo "Don't forget to add yourself to the 'bumblebee' group to use Bumblebee"
}
post_upgrade() {
getent group "bumblebee" &>/dev/null || groupadd bumblebee
}
post_remove() {
getent group "bumblebee" &>/dev/null && groupdel bumblebee 1>/dev/null
}
post_install() {
post_upgrade
_notice
}
#!/bin/bash
# Bumblebee daemon handler script. Distro-independent script to start/stop
# daemon. Should be runnable in any distro but won't give any feedback.
. /etc/rc.conf
. /etc/rc.d/functions
NAME=bumblebeed
CLIENT="$(which optirun)"
BIN="$(which $NAME)"
PIDFILE=/var/run/$NAME.pid
start() {
# Start the daemon only if there is not another instance running
stat_busy "Starting Bumblebee"
local pid="$(cat "$PIDFILE" 2>/dev/null)"
kill -0 $pid >/dev/null 2>&1
case $? in
0) ;; # already running
*) # Can be started
"$BIN" --daemon >/dev/null
add_daemon $NAME
stat_done
return 0
;;
esac
stat_fail
return 1
}
stop() {
# Stop the daemon only if there is an instance running
stat_busy "Stopping Bumblebee"
local pid="$(cat "$PIDFILE" 2>/dev/null)"
kill -0 $pid >/dev/null 2>&1
case $? in
0) # Alive and running
local pid="$(cat "$PIDFILE" 2>/dev/null)"
kill -TERM $pid >/dev/null
# give it time to end gracefully...
local retries=10
while [ $retries -gt 0 ]; do
retries=$(expr $retries - 1)
kill -0 $pid >/dev/null 2>&1
case $? in
0) # not ready
sleep .5
;;
*) # no need for polling anymore
break
;;
esac
done
# ... otherwhise just terminate it.
kill -0 $pid >/dev/null 2>&1
case $? in
0) # still alive > Kill
kill -KILL $pid >/dev/null
;;
*)
;;
esac
rm_daemon $NAME
stat_done
;;
*) # Not started
stat_done
;;
esac
}
restart() {
stop
sleep 0.5
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
;;
esac
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment