PKGBUILD 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # Maintainer (arch): Lukas Fleischer <lfleischer@archlinux.org>
  2. # Contributor: xduugu
  3. # Contributor: nh2
  4. # Contributor: Steven Davidovitz <steviedizzle ð gmail đ com>
  5. # Contributor: Nick B <Shirakawasuna ð gmail đ com>
  6. # Contributor: Christof Musik <christof ð senfdax đ de>
  7. # Contributor: Stefan Rupp <archlinux ð stefanrupp đ de>
  8. # Contributor: Ignas Anikevicius <anikevicius ð gmail đ com>
  9. # Contributor: André Silva <emulatorman@hyperbola.info>
  10. # Contributor: Márcio Silva <coadde@hyperbola.info>
  11. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  12. # Contributor: bill-auger <bill-auger@programmer.net>
  13. # parabola changes and rationale:
  14. # - re-package for linux-libre
  15. # - build from versioned source-ball rather than VCS
  16. # - pin to kernel versions
  17. # build order:
  18. # acpi_call-dkms <- acpi_call-lts
  19. # acpi_call
  20. # linux-libre-lts-headers <- acpi_call-lts
  21. # tp_smapi-lts
  22. # linux-libre-headers <- acpi_call
  23. # tp_smapi
  24. #
  25. # NOTE: It is normally not necessary to edit any of these PKGBUILDs.
  26. # These packages may be built as a batch, with the helper script:
  27. # 'scripts/package-all-acpi_call-tp_smapi'
  28. # Simply edit 'KERNEL_VER' and/or 'KERNEL_LTS_VER' in the helper script.
  29. # It will build any or all of the above packages,
  30. # but only those for which the PKGBUILD '_basekernel' differs,
  31. # update '_basekernel', and commit the changes to VCS, if successful.
  32. _basekernel=6.7.4
  33. pkgname=tp_smapi
  34. pkgver=0.44
  35. pkgrel=15
  36. pkgrel+=.parabola1.basekernel${_basekernel}
  37. pkgdesc="Modules for ThinkPad's SMAPI functionality"
  38. pkgdesc+=" (for 'linux-libre')"
  39. arch=('x86_64')
  40. arch+=('i686')
  41. url='https://github.com/evgeni/tp_smapi'
  42. license=(GPL)
  43. makedepends=(linux-libre-headers=${_basekernel})
  44. source=(${pkgname}-${pkgver}.tar.gz::https://github.com/linux-thinkpad/${pkgname}/archive/refs/tags/${pkgname/_/-}/${pkgver}.tar.gz)
  45. sha256sums=('ccc317157c71df621ef92e0213c3a813de4a792fa1dce16a1784944edfcb9ea4')
  46. build() {
  47. cd ${pkgname}-${pkgname/_/-}-${pkgver}
  48. # https://bugs.archlinux.org/task/54975 (kernel has no _GLOBAL_OFFSET_TABLE_):
  49. # Clear EXTRA_CFLAGS since it defaults to injecting CFLAGS and -fno-plt breaks the modules
  50. make HDAPS=1 KVER="$(</usr/src/linux-libre/version)" EXTRA_CFLAGS=
  51. }
  52. package() {
  53. depends=(linux-libre=${_basekernel})
  54. local extradir=/usr/lib/modules/$(</usr/src/linux-libre/version)/extramodules
  55. cd ${pkgname}-${pkgname/_/-}-${pkgver}
  56. find . -name "*.ko" -exec install -Dt "$pkgdir$extradir" {} +
  57. find "$pkgdir" -name "*.ko" -exec strip --strip-debug {} +
  58. find "$pkgdir" -name "*.ko" -exec xz {} +
  59. # load module on startup
  60. echo tp_smapi | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
  61. }