PKGBUILD 1006 Bytes
Newer Older
1 2 3

pkgname=bbswitch-lts
_pkgname=bbswitch
4
pkgver=0.8
Luca Giambonini's avatar
Luca Giambonini committed
5
pkgrel=13
6
pkgdesc="kernel module allowing to switch dedicated graphics card on Optimus laptops"
7
arch=('x86_64')
8
url='http://github.com/Bumblebee-Project/bbswitch'
9 10
license=('GPL')
provides=('bbswitch')
11 12
_extramodules=extramodules-CHAKRA
depends=("linux-lts=4.4.147")
Luca Giambonini's avatar
Luca Giambonini committed
13
makedepends=("linux-lts-headers=4.4.147")
14
source=("https://github.com/Bumblebee-Project/bbswitch/archive/v${pkgver}.tar.gz")
15
md5sums=('5b116b31ace3604ddf9d1fc1f4bc5807')
16

17
build() {
18 19 20 21 22
  cd ${srcdir}/${pkgname}-${pkgver}
  KERNEL_VERSION=$(</usr/lib/modules/$_extramodules/version)
  msg2 "Kernel = $KERNEL_VERSION"

  make KDIR="/usr/lib/modules/$KERNEL_VERSION/build/"
23 24 25
}

package() {
26 27
  cd ${srcdir}/${pkgname}-${pkgver}
  msg2 "Building module for $_kver..."
28

29 30 31 32
  # KDIR is necessary even when cleaning
  #make KDIR=/usr/src/linux-${_kver} clean
  install -Dm644 bbswitch.ko $pkgdir/usr/lib/modules/${_extramodules}/bbswitch.ko
  gzip "${pkgdir}/usr/lib/modules/${_extramodules}/bbswitch.ko"
33
}