summaryrefslogtreecommitdiff
path: root/pcr/bbswitch-lts/PKGBUILD
blob: 5ff915a6a730bb845eb7be4a51d4b83b10427928 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Maintainer (AUR): e5ten <e5ten.arch@gmail.com>
# Contributor (AUR): Sven-Hendrik Haase <sh@lutzhaase.com>
# Contributor (AUR): M0Rf30
# Contributor (AUR): Samsagax <samsagax@gmail.com>
# Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Contributor (Hyperbola): Márcio Silva <coadde@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>

_basekernel=5.4.78

pkgname=bbswitch-lts
pkgver=0.8
pkgrel=47
pkgrel+=.parabola1.basekernel${_basekernel%-*}
pkgdesc="Kernel module allowing to switch dedicated graphics card on Optimus laptops"
pkgdesc+=" (built for the linux-libre-lts kernel package)"
arch=('x86_64')
arch+=('i686')
url="http://github.com/Bumblebee-Project/bbswitch"
license=('GPL')
makedepends=(linux-libre-lts-headers=${_basekernel%-*} git libelf)
source=("${pkgname%-*}-$pkgver.tar.gz::https://github.com/Bumblebee-Project/bbswitch/archive/v${pkgver}.tar.gz"
        0001-proc_ops-struct.patch 0002-kernel-5.7.patch)
sha512sums=('11ab163931feb6c0e202d04c4552b848e999fedea9990390c26b28abdb4a69081ccfb5a22d1e390cc274f1c0cfc9adedc719c5fece14738b17aaa93e28865b7c'
            '993a2895c37ea213c105be668f794af54838d8015d6f561ee6bc7ce65583425515931c83c2487ab97c14454105f233f089e8bdc90ea5ed9576be767335f57ad1'
            '2eeae463b2f83e7744ff1a769cb6186389e026fc78668e836525dfd16a56abfae01cfb150c9bb46af74ec42e87ebea91636118fe0c773e7eaa7ea671b25d2e04')

prepare() {
  cd ${pkgname%-*}-${pkgver}
  patch -Np1 < ../0001-proc_ops-struct.patch
  patch -Np1 < ../0002-kernel-5.7.patch
}

build() {
  cd ${pkgname%-*}-${pkgver}
  make KDIR=/usr/src/linux-libre-lts
}

package() {
  depends=(linux-libre-lts=${_basekernel%-*})

  cd ${pkgname%-*}-${pkgver}
  _extradir="/usr/lib/modules/$(</usr/src/linux-libre-lts/version)/extramodules"
  install -Dt "${pkgdir}${_extradir}" -m644 *.ko
  find "${pkgdir}" -name '*.ko' -exec strip --strip-debug {} +
  find "${pkgdir}" -name '*.ko' -exec xz {} +
}