PKGBUILD 1.2 KB
Newer Older
Phil's avatar
Phil committed
1 2

pkgname=acpi_call-lts
3
_pkgname=acpi_call
AlmAck's avatar
AlmAck committed
4
pkgver=1.1.0
AlmAck's avatar
AlmAck committed
5
pkgrel=10
Phil's avatar
Phil committed
6
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)."
7
arch=('x86_64')
8
url='http://github.com/mkottman/acpi_call'
Phil's avatar
Phil committed
9
license=('GPL')
AlmAck's avatar
AlmAck committed
10 11
depends=("linux-lts=4.4.147")
makedepends=("linux-lts-headers=4.4.147")
AlmAck's avatar
AlmAck committed
12
provides=("${pkgname%-*}")
AlmAck's avatar
AlmAck committed
13 14 15
_extramodules=extramodules-CHAKRA-LTS
source=("https://github.com/mkottman/acpi_call/archive/v${pkgver}.tar.gz")
md5sums=('f69d40e130b0e5ed17ce8adb19e6dda1')
Phil's avatar
Phil committed
16

Chaoting Liu's avatar
Chaoting Liu committed
17
prepare() {
AlmAck's avatar
AlmAck committed
18
  cd ${pkgname%-*}-${pkgver}
AlmAck's avatar
AlmAck committed
19

Chaoting Liu's avatar
Chaoting Liu committed
20 21 22
  # Fix build with Linux >= 3.17
  sed -i 's|acpi/acpi.h|linux/acpi.h|' acpi_call.c
}
23

Chaoting Liu's avatar
Chaoting Liu committed
24 25
build() {
  cd ${pkgname%-*}-${pkgver}
AlmAck's avatar
AlmAck committed
26
  make KVERSION="$(cat /usr/lib/modules/$_extramodules/version)"
Phil's avatar
Phil committed
27
}
AlmAck's avatar
AlmAck committed
28

Phil's avatar
Phil committed
29
package() {
AlmAck's avatar
AlmAck committed
30
  cd ${pkgname%-*}-${pkgver}
AlmAck's avatar
AlmAck committed
31 32
  install -Dt "$pkgdir/usr/lib/modules/$_extramodules" -m644 *.ko
  find "$pkgdir" -name '*.ko' -exec xz {} +
AlmAck's avatar
AlmAck committed
33

AlmAck's avatar
AlmAck committed
34
  echo acpi_call | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules-load.d/acpi_call.conf"
AlmAck's avatar
AlmAck committed
35

AlmAck's avatar
AlmAck committed
36 37
  mkdir -p "$pkgdir/usr/share/acpi_call"
  cp -t "$pkgdir/usr/share/acpi_call" -dr --no-preserve=ownership examples support
Phil's avatar
Phil committed
38
}