PKGBUILD 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Maintainer (arch): Sven-Hendrik Haase <sh@lutzhaase.com>
  2. # Contributor: M0Rf30
  3. # Contributor: Samsagax <samsagax@gmail.com>
  4. # Contributor: André Silva <emulatorman@hyperbola.info>
  5. # Contributor: Márcio Silva <coadde@hyperbola.info>
  6. # Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
  7. _basekernel=5.15.12
  8. pkgbase=bbswitch
  9. pkgname=(bbswitch bbswitch-dkms)
  10. pkgver=0.8
  11. pkgrel=477
  12. pkgrel+=.parabola1.basekernel${_basekernel%-*}
  13. pkgdesc="Kernel module allowing to switch dedicated graphics card on Optimus laptops"
  14. pkgdesc+=" (built for the linux-libre kernel package)"
  15. arch=('x86_64')
  16. arch+=('i686')
  17. url="http://github.com/Bumblebee-Project/bbswitch"
  18. license=('GPL')
  19. makedepends=(linux-libre-headers=${_basekernel%-*} git libelf)
  20. source=("${pkgbase}-${pkgver}.tar.gz::https://github.com/Bumblebee-Project/bbswitch/archive/v${pkgver}.tar.gz"
  21. 0001-proc_ops-struct.patch 0002-kernel-5.7.patch)
  22. sha512sums=('11ab163931feb6c0e202d04c4552b848e999fedea9990390c26b28abdb4a69081ccfb5a22d1e390cc274f1c0cfc9adedc719c5fece14738b17aaa93e28865b7c'
  23. '993a2895c37ea213c105be668f794af54838d8015d6f561ee6bc7ce65583425515931c83c2487ab97c14454105f233f089e8bdc90ea5ed9576be767335f57ad1'
  24. '2eeae463b2f83e7744ff1a769cb6186389e026fc78668e836525dfd16a56abfae01cfb150c9bb46af74ec42e87ebea91636118fe0c773e7eaa7ea671b25d2e04')
  25. prepare() {
  26. cd ${pkgbase}-${pkgver}
  27. patch -Np1 < ../0001-proc_ops-struct.patch
  28. patch -Np1 < ../0002-kernel-5.7.patch
  29. }
  30. build() {
  31. cd ${pkgbase}-${pkgver}
  32. make KDIR=/usr/src/linux-libre
  33. }
  34. package_bbswitch() {
  35. depends=(linux-libre=${_basekernel%-*})
  36. cd ${pkgbase}-${pkgver}
  37. _extradir="/usr/lib/modules/$(</usr/src/linux-libre/version)/extramodules"
  38. install -Dt "${pkgdir}${_extradir}" -m644 *.ko
  39. find "${pkgdir}" -name '*.ko' -exec strip --strip-debug {} +
  40. find "${pkgdir}" -name '*.ko' -exec xz {} +
  41. }
  42. package_bbswitch-dkms() {
  43. depends=('dkms')
  44. conflicts=('bbswitch')
  45. provides=('bbswitch')
  46. cd ${pkgbase}-${pkgver}
  47. install -Dt "${pkgdir}/usr/src/${pkgbase}-${pkgver}" -m644 Makefile bbswitch.c dkms/dkms.conf
  48. }