summaryrefslogtreecommitdiff
path: root/libre/bumblebee/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'libre/bumblebee/PKGBUILD')
-rw-r--r--libre/bumblebee/PKGBUILD67
1 files changed, 67 insertions, 0 deletions
diff --git a/libre/bumblebee/PKGBUILD b/libre/bumblebee/PKGBUILD
new file mode 100644
index 000000000..964fcf020
--- /dev/null
+++ b/libre/bumblebee/PKGBUILD
@@ -0,0 +1,67 @@
+# Maintainer (Arch): Sven-Hendrik Haase <sh@lutzhaase.com>
+# Maintainer: André Silva <emulatorman@parabola.nu>
+
+pkgname=bumblebee
+pkgver=3.2.1
+pkgrel=3.parabola1
+pkgdesc="NVIDIA Optimus support for GNU/Linux through VirtualGL, without nonfree nvidia driver support"
+arch=('i686' 'x86_64' 'mips64el')
+depends=('virtualgl' 'glib2' 'mesa-libgl')
+makedepends=('help2man')
+optdepends=('xf86-video-nouveau: nouveau driver'
+ 'nouveau-dri: 3D acceleration features of nouveau'
+ 'bbswitch: switch on/off discrete card'
+ 'primus: faster back-end for optirun')
+if [ "$CARCH" = "x86_64" ]; then
+ optdepends[${#optdepends[@]}]='lib32-virtualgl: run 32bit applications with optirun'
+ optdepends[${#optdepends[@]}]='lib32-primus: faster back-end for optirun'
+fi
+replaces=("$pkgname-libre" 'nvidia-libgl')
+conflicts=("$pkgname-libre" 'nvidia-libgl')
+provides=('nvidia-libgl')
+url="http://www.$pkgname-project.org"
+license=("GPL3")
+install="$pkgname.install"
+backup=("etc/$pkgname/$pkgname.conf"
+ "etc/$pkgname/xorg.conf.nouveau")
+source=("http://www.$pkgname-project.org/${pkgname}-${pkgver}.tar.gz"
+ 'libre.patch')
+md5sums=('30974e677bb13e8a3825fd6f3e7d3b24'
+ '1daed1e00f74538add6c435dfa0569d1')
+
+prepare() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ # Remove nonfree references to nonfree nvidia driver and unnecessaries files
+ rm -rv "README.markdown"
+ rm -rv "conf/"{99-$pkgname-nvidia-dev.rules,xorg.conf.nvidia}
+ rm -rv "doc"
+ rm -rv "scripts/$pkgname-bugreport.in"
+ patch -Np1 -i "${srcdir}/libre.patch"
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ ./configure \
+ CONF_DRIVER=nouveau \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc \
+ --without-pidfile
+
+ make
+}
+
+package() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ make install DESTDIR="$pkgdir"
+
+ # Install systemd unit
+ install -D -m644 "scripts/systemd/${pkgname}d.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}d.service"
+ sed -i "s/sbin/bin/" "${pkgdir}/usr/lib/systemd/system/${pkgname}d.service"
+
+ # Make bash_completion work
+ mv -v "${pkgdir}/etc/bash_completion.d/$pkgname" "${pkgdir}/etc/bash_completion.d/optirun"
+}