PKGBUILD 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # Maintainer (Arch): Lukas Fleischer <lfleischer@archlinux.org>
  2. # Contributor (Arch): xduugu
  3. # Contributor (Arch): nh2
  4. # Contributor (Arch): Steven Davidovitz <steviedizzle ð gmail đ com>
  5. # Contributor (Arch): Nick B <Shirakawasuna ð gmail đ com>
  6. # Contributor (Arch): Christof Musik <christof ð senfdax đ de>
  7. # Contributor (Arch): Stefan Rupp <archlinux ð stefanrupp đ de>
  8. # Contributor (Arch): Ignas Anikevicius <anikevicius ð gmail đ com>
  9. # Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info>
  10. # Contributor (Hyperbola): Márcio Silva <coadde@hyperbola.info>
  11. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  12. _basekernel=5.4.78
  13. pkgname=tp_smapi-lts
  14. _pkgname=tp-smapi
  15. pkgver=0.43
  16. pkgrel=82
  17. pkgrel+=.parabola1.basekernel${_basekernel}
  18. pkgdesc="Modules for ThinkPad's SMAPI functionality"
  19. pkgdesc+=" (for linux-libre-lts)"
  20. arch=('x86_64')
  21. arch+=('i686')
  22. url='https://github.com/evgeni/tp_smapi'
  23. license=('GPL')
  24. makedepends=(linux-libre-lts-headers=${_basekernel} 'git' libelf)
  25. _commit=a63729ab30d85430048f65c37f29188ab484cd52 # tags/tp-smapi/0.43
  26. source=("git+https://github.com/evgeni/tp_smapi#commit=$_commit")
  27. sha256sums=('SKIP')
  28. pkgver() {
  29. cd ${pkgname/-lts/}
  30. git describe --tags | sed 's/^tp-smapi\///;s/-/+/g'
  31. }
  32. build() {
  33. cd ${pkgname/-lts/}
  34. # https://bugs.archlinux.org/task/54975 (kernel has no _GLOBAL_OFFSET_TABLE_):
  35. # Clear EXTRA_CFLAGS since it defaults to injecting CFLAGS and -fno-plt breaks the modules
  36. make HDAPS=1 KVER="$(</usr/src/linux-libre-lts/version)" EXTRA_CFLAGS=
  37. }
  38. package() {
  39. depends=(linux-libre-lts=${_basekernel})
  40. local extradir=/usr/lib/modules/$(</usr/src/linux-libre-lts/version)/extramodules
  41. cd tp_smapi
  42. # install kernel modules
  43. find . -name "*.ko" -exec install -Dt "$pkgdir$extradir" {} +
  44. # compress kernel modules
  45. find "$pkgdir" -name "*.ko" -exec xz {} +
  46. # load module on startup
  47. echo tp_smapi | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
  48. }