mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 22:47:14 +08:00
52 lines
1.6 KiB
Bash
52 lines
1.6 KiB
Bash
# Source global configuration
|
|
source ../linux.conf
|
|
|
|
pkgname=acpi_call
|
|
_pkgname=acpi_call
|
|
pkgver=1.1.0
|
|
pkgrel=39
|
|
pkgdesc="A kernel module that enables you to call parameterless ACPI methods by writing the method name to /proc/acpi/call, e.g. to turn off discrete graphics card in a dual graphics environment (like NVIDIA Optimus)."
|
|
arch=('x86_64')
|
|
url=("http://github.com/mkottman/acpi_call")
|
|
license=('GPL')
|
|
depends=("linux=${_kernelver}")
|
|
makedepends=("linux-headers=${_kernelver}")
|
|
install=acpi_call.install
|
|
source=("https://github.com/mkottman/acpi_call/archive/v${pkgver}.tar.gz")
|
|
md5sums=('f69d40e130b0e5ed17ce8adb19e6dda1')
|
|
|
|
prepare() {
|
|
cd ${pkgname}-${pkgver}
|
|
|
|
# Fix build with Linux >= 3.17
|
|
sed -i 's|acpi/acpi.h|linux/acpi.h|' acpi_call.c
|
|
|
|
# Fix build with Linux >= 4.12
|
|
sed -i 's|asm/uaccess.h|linux/uaccess.h|' acpi_call.c
|
|
}
|
|
|
|
build() {
|
|
cd ${pkgname}-${pkgver}
|
|
|
|
make KVERSION=${_kver}
|
|
}
|
|
package() {
|
|
cd ${pkgname}-${pkgver}
|
|
|
|
install -dm 755 "${pkgdir}"/usr/lib/{modules/${_extramodules},modules-load.d} "${pkgdir}"/usr/bin
|
|
install -m 644 ${pkgname}.ko "${pkgdir}"/usr/lib/modules/${_extramodules}
|
|
gzip "${pkgdir}"/usr/lib/modules/${_extramodules}/${pkgname}.ko
|
|
echo ${pkgname} > "${pkgdir}"/usr/lib/modules-load.d/${pkgname}.conf
|
|
|
|
install -dm 755 "${pkgdir}"/usr/share/${pkgname}
|
|
cp -dr --no-preserve='ownership' {examples,support} "${pkgdir}"/usr/share/${pkgname}/
|
|
|
|
ln -s /usr/share/$_pkgname/examples/turn_off_gpu.sh \
|
|
${pkgdir}/usr/bin/turn_off_gpu.sh
|
|
|
|
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" \
|
|
"${startdir}/${pkgname}.install"
|
|
}
|
|
|
|
# vim: ts=2 sw=2 et:
|