summaryrefslogtreecommitdiff
path: root/libre/bumblebee-libre/PKGBUILD
blob: aff067a9472c670a11e9eeaac5c84f66a71263b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Maintainer: Sven-Hendrik Haase <sh@lutzhaase.com>
# Maintainer (Parabola): André Silva <emulatorman@lavabit.com>

_pkgname=bumblebee
pkgname=bumblebee-libre
pkgver=3.1
pkgrel=5.1
pkgdesc="NVIDIA Optimus support for GNU/Linux through VirtualGL, without nonfree nvidia driver support"
arch=('i686' 'x86_64')
depends=('virtualgl' 'libbsd' 'glib2' 'mesa-libgl')
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=('bumblebee')
conflicts=('bumblebee' 'nvidia-libgl')
provides=("bumblebee=$pkgver"'nvidia-libgl')
url="http://www.bumblebee-project.org"
license=("GPL3")
install='bumblebee.install'
backup=('etc/bumblebee/bumblebee.conf' 
        'etc/bumblebee/xorg.conf.nouveau')
source=("http://www.bumblebee-project.org/${_pkgname}-${pkgver}.tar.gz"
        'libre.patch')
md5sums=('de515ef51b1e0714c2f1b2a95f83e77e'
         'f8b6044310039911236f53a625c611a6')

build() {
    cd "${srcdir}/${_pkgname}-${pkgver}"

    # Remove nonfree references to nonfree nvidia driver and unnecessaries files
    rm -rv "README.markdown"
    rm -rv "conf/"{99-remove-nvidia-dev.rules,xorg.conf.nvidia}
    rm -rv "doc"
    rm -rv "scripts/bumblebee-bugreport.in"
    patch -Np1 -i "${srcdir}/libre.patch"

    ./configure \
        CONF_DRIVER=nouveau \
        --prefix=/usr \
        --sysconfdir=/etc

    make
}

package() {
    cd "${srcdir}/${_pkgname}-${pkgver}"

    make install DESTDIR="$pkgdir"

    # Install systemd unit
    install -D -m644 "scripts/systemd/bumblebeed.service" "${pkgdir}/usr/lib/systemd/system/bumblebeed.service"    

    # Make bash_completion work
    mv -v "${pkgdir}/etc/bash_completion.d/bumblebee" "${pkgdir}/etc/bash_completion.d/optirun"
}