summaryrefslogtreecommitdiff
path: root/libre/acpi_call-lts/PKGBUILD
blob: 8cab1e7f8ef4374545ab68177f3d2c85bcf288de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Maintainer (arch): Maxime Gauduin <alucryd@archlinux.org>
# Contributor: mortzu <me@mortzu.de>
# Contributor: fnord0 <fnord0@riseup.net>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Márcio Silva <coadde@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>


# build order:
#   acpi_call-dkms          <- acpi_call-lts
#                              acpi_call
#   linux-libre-lts-headers <- acpi_call-lts
#                              tp_smapi-lts
#   linux-libre-headers     <- acpi_call
#                              tp_smapi
#
# these packages may be built as a batch, with the helper script:
#   'scripts/package-all-acpi_call-tp_smapi'
# simply edit '_basekernel' in each # TODO: automate that too


_basekernel=5.15.41

pkgname=acpi_call-lts
pkgver=1.2.2
pkgrel=11
pkgrel+=.parabola1.basekernel${_basekernel}
pkgdesc='A linux kernel module that enables calls to ACPI methods through /proc/acpi/call'
pkgdesc+=' (for linux-libre-lts)'
url='https://github.com/mkottman/acpi_call'
arch=('x86_64')
arch+=('armv7h' 'i686')
license=('GPL')
makedepends=(linux-libre-lts-headers=${_basekernel} acpi_call-dkms=$pkgver libelf)
conflicts=('acpi_call-dkms')
provides=('acpi_call')

build() {
  _kernver=$(</usr/src/linux-libre-lts/version)

  fakeroot dkms build --dkmstree "$srcdir" -m acpi_call/$pkgver -k $_kernver
}

package() {
  depends=(linux-libre-lts=${_basekernel})

  _kernver=$(</usr/src/linux-libre-lts/version)

  install -Dt "$pkgdir/usr/lib/modules/$_kernver/extramodules" -m0644 \
    acpi_call/${pkgver}/$_kernver/$CARCH/module/*

  # compress each module individually
  find "$pkgdir" -name '*.ko' -exec xz -T1 {} +

  echo acpi_call | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"

  mkdir -p "$pkgdir/usr/share"
  cp -a /usr/share/acpi_call "$pkgdir/usr/share/$pkgname"
}