PKGBUILD 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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.12.6
  13. pkgname=tp_smapi
  14. pkgver=0.43
  15. pkgrel=309
  16. pkgrel+=.parabola1.basekernel${_basekernel}
  17. pkgdesc="Modules for ThinkPad's SMAPI functionality"
  18. pkgdesc+=" (for linux-libre)"
  19. arch=('x86_64')
  20. arch+=('i686')
  21. url='https://github.com/evgeni/tp_smapi'
  22. license=('GPL')
  23. makedepends=(linux-libre-headers=${_basekernel} git libelf)
  24. _commit=a63729ab30d85430048f65c37f29188ab484cd52 # tags/tp-smapi/0.43
  25. source=("git+https://github.com/evgeni/tp_smapi#commit=$_commit")
  26. sha256sums=('SKIP')
  27. pkgver() {
  28. cd $pkgname
  29. git describe --tags | sed 's/^tp-smapi\///;s/-/+/g'
  30. }
  31. build() {
  32. cd $pkgname
  33. # https://bugs.archlinux.org/task/54975 (kernel has no _GLOBAL_OFFSET_TABLE_):
  34. # Clear EXTRA_CFLAGS since it defaults to injecting CFLAGS and -fno-plt breaks the modules
  35. make HDAPS=1 KVER="$(</usr/src/linux-libre/version)" EXTRA_CFLAGS=
  36. }
  37. package() {
  38. depends=(linux-libre=${_basekernel})
  39. local extradir=/usr/lib/modules/$(</usr/src/linux-libre/version)/extramodules
  40. cd $pkgname
  41. find . -name "*.ko" -exec install -Dt "$pkgdir$extradir" {} +
  42. find "$pkgdir" -name "*.ko" -exec strip --strip-debug {} +
  43. find "$pkgdir" -name "*.ko" -exec xz {} +
  44. # load module on startup
  45. echo tp_smapi | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
  46. }