-
Notifications
You must be signed in to change notification settings - Fork 1
/
PKGBUILD
67 lines (51 loc) · 1.66 KB
/
PKGBUILD
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Maintainer: Aun-Ali Zaidi <[email protected]>
_pkgbase=('apple-bce')
pkgname=(${_pkgbase}-git ${_pkgbase}-dkms-git)
pkgdesc="Apple BCE (Buffer Copy Engine) driver for T2-based devices."
pkgver=r185.f93c656
pkgrel=10
arch=('x86_64')
url="https://github.com/t2linux/apple-bce-drv"
license=('GPL2')
depends=('linux')
makedepends=('git' 'linux-headers' 'pahole')
options=(!strip)
source=("apple-bce::git+https://github.com/t2linux/apple-bce-drv.git#branch=aur"
"dkms.conf.in")
sha256sums=('SKIP'
'06c389cbfb9e771397c962a782e7217a56be85ac4eee652d927e1e0f63a78ed6')
pkgver() {
cd "$_pkgbase"
( set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
)
}
prepare() {
# Set name and version
sed -e "s/@PKGVER@/$pkgver/" \
-e "s/@_PKGBASE@/$_pkgbase/" dkms.conf.in > dkms.conf
}
build() {
cd "$_pkgbase"
_kernver=$(</usr/src/linux-mbp/version)
make KVERSION=${_kernver}
}
package_apple-bce-git() {
depends=('linux-mbp=5.12.19' 'linux-mbp-headers=5.12.19')
_kernver=$(</usr/src/linux-mbp/version)
_extramodules="/usr/lib/modules/${_kernver}/extramodules"
cd "$_pkgbase"
install -Dt "${pkgdir}${_extramodules}" -m644 *.ko
find "${pkgdir}" -name '*.ko' -exec xz {} +
}
package_apple-bce-dkms-git() {
depends=('dkms' 'pahole')
conflicts=("${_pkgbase}")
provides=("${_pkgbase}")
install -Dm644 dkms.conf "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/dkms.conf
cd "$_pkgbase"
# XXX: Find a better solution...
make KVERSION=$(</usr/src/linux-mbp/version) clean
cp -dr --no-preserve='ownership' ./* "${pkgdir}"/usr/src/${_pkgbase}-${pkgver}/
}