mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-10 11:24:39 +08:00
36 lines
1.0 KiB
Bash
36 lines
1.0 KiB
Bash
# Source global configuration
|
|
source ../linux.conf
|
|
|
|
pkgname=bbswitch
|
|
pkgver=0.8
|
|
pkgrel=29
|
|
pkgdesc="kernel module allowing to switch dedicated graphics card on Optimus laptops"
|
|
arch=('x86_64')
|
|
url=("http://github.com/Bumblebee-Project/bbswitch")
|
|
license=('GPL')
|
|
install=bbswitch.install
|
|
depends=("linux=${_kernelver}")
|
|
makedepends=("linux-headers=${_kernelver}")
|
|
source=("https://github.com/Bumblebee-Project/bbswitch/archive/v${pkgver}.tar.gz")
|
|
md5sums=('5b116b31ace3604ddf9d1fc1f4bc5807')
|
|
|
|
prepare() {
|
|
#automatically update bbswitch.install
|
|
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/bbswitch.install"
|
|
}
|
|
|
|
build() {
|
|
cd ${srcdir}/${pkgname}-${pkgver}
|
|
make KDIR=${_rootOfSourceTree}
|
|
}
|
|
|
|
package() {
|
|
cd ${srcdir}/${pkgname}-${pkgver}
|
|
msg2 "Building module for $_kver..."
|
|
|
|
# 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"
|
|
}
|