PKGBUILD 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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.6.14
  33. pkgname=tp_smapi-lts
  34. _upstream_name=tp_smapi
  35. pkgver=0.44
  36. pkgrel=15
  37. pkgrel+=.parabola1.basekernel${_basekernel}
  38. pkgdesc="Modules for ThinkPad's SMAPI functionality"
  39. pkgdesc+=" (for 'linux-libre-lts')"
  40. arch=('x86_64')
  41. arch+=('i686')
  42. url='https://github.com/evgeni/tp_smapi'
  43. license=(GPL)
  44. makedepends=(linux-libre-lts-headers=${_basekernel})
  45. source=(${_upstream_name}-${pkgver}.tar.gz::https://github.com/linux-thinkpad/${_upstream_name}/archive/refs/tags/${_upstream_name/_/-}/${pkgver}.tar.gz)
  46. sha256sums=('ccc317157c71df621ef92e0213c3a813de4a792fa1dce16a1784944edfcb9ea4')
  47. build() {
  48. cd ${_upstream_name}-${_upstream_name/_/-}-${pkgver}
  49. # https://bugs.archlinux.org/task/54975 (kernel has no _GLOBAL_OFFSET_TABLE_):
  50. # Clear EXTRA_CFLAGS since it defaults to injecting CFLAGS and -fno-plt breaks the modules
  51. make HDAPS=1 KVER="$(</usr/src/linux-libre-lts/version)" EXTRA_CFLAGS=
  52. }
  53. package() {
  54. depends=(linux-libre-lts=${_basekernel})
  55. local extradir=/usr/lib/modules/$(</usr/src/linux-libre-lts/version)/extramodules
  56. cd ${_upstream_name}-${_upstream_name/_/-}-${pkgver}
  57. find . -name "*.ko" -exec install -Dt "$pkgdir$extradir" {} +
  58. find "$pkgdir" -name "*.ko" -exec strip --strip-debug {} +
  59. find "$pkgdir" -name "*.ko" -exec xz {} +
  60. # load module on startup
  61. echo tp_smapi | install -Dm644 /dev/stdin "$pkgdir/usr/lib/modules-load.d/$pkgname.conf"
  62. }