PKGBUILD 1006 Bytes
Newer Older
1 2 3

pkgname=bbswitch-lts
_pkgname=bbswitch
AlmAck's avatar
AlmAck committed
4
pkgver=0.8
AlmAck's avatar
AlmAck 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')
AlmAck's avatar
AlmAck committed
11 12
_extramodules=extramodules-CHAKRA
depends=("linux-lts=4.4.147")
AlmAck's avatar
AlmAck committed
13
makedepends=("linux-lts-headers=4.4.147")
14
source=("https://github.com/Bumblebee-Project/bbswitch/archive/v${pkgver}.tar.gz")
AlmAck's avatar
AlmAck committed
15
md5sums=('5b116b31ace3604ddf9d1fc1f4bc5807')
16

17
build() {
AlmAck's avatar
AlmAck committed
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() {
AlmAck's avatar
AlmAck committed
26 27
  cd ${srcdir}/${pkgname}-${pkgver}
  msg2 "Building module for $_kver..."
28

AlmAck's avatar
AlmAck committed
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
}