core/bbswitch/PKGBUILD

38 lines
1.1 KiB
Bash
Raw Normal View History

2012-11-19 21:27:09 +08:00
pkgname=bbswitch
2014-01-02 05:38:02 +08:00
pkgver=0.8
pkgrel=42
pkgdesc="kernel module allowing to switch dedicated graphics card on Optimus laptops"
arch=('x86_64')
2018-05-02 04:34:20 +08:00
url="http://github.com/Bumblebee-Project/bbswitch"
license=('GPL')
install=bbswitch.install
depends=("linux=4.17.12")
makedepends=("linux-headers=4.17.12")
_extramodules=extramodules-CHAKRA
2013-05-22 17:46:20 +08:00
source=("https://github.com/Bumblebee-Project/bbswitch/archive/v${pkgver}.tar.gz")
2014-01-02 05:38:02 +08:00
md5sums=('5b116b31ace3604ddf9d1fc1f4bc5807')
prepare() {
#automatically update bbswitch.install
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/bbswitch.install"
}
build() {
cd ${srcdir}/${pkgname}-${pkgver}
KERNEL_VERSION=$(</usr/lib/modules/$_extramodules/version)
msg2 "Kernel = $KERNEL_VERSION"
make KDIR="/usr/lib/modules/$KERNEL_VERSION/build/"
}
package() {
2014-01-02 05:38:02 +08:00
cd ${srcdir}/${pkgname}-${pkgver}
msg2 "Building module for $_kver..."
2014-01-02 05:38:02 +08:00
# 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"
2012-02-22 18:14:42 +08:00
}