|
| 1 | +# SPDX-License-Identifier: GPL-2.0-only |
| 2 | +pkgname=apple-t1-touchbar-dkms |
| 3 | +pkgver=0.1.r2.ga33c7eb |
| 4 | +pkgrel=1 |
| 5 | +pkgdesc='Pinned T1 Touch Bar DKMS driver with guarded late loading for MacBookPro14,3' |
| 6 | +arch=('x86_64') |
| 7 | +url='https://github.com/monomyth/t1-touchbar' |
| 8 | +license=('GPL-2.0-only') |
| 9 | +depends=('dkms' 'python' 'kmod' 'systemd' 'linux-omarchy-headers') |
| 10 | +makedepends=('linux-omarchy-headers') |
| 11 | +conflicts=('macbook12-spi-driver-dkms' 'apple-ib-drv-dkms' 'apple-ib-drv-dkms-git' |
| 12 | + 'apple-t1-touchbar-dkms-local') |
| 13 | +backup=('etc/modprobe.d/apple-t1-touchbar.conf') |
| 14 | +options=('!strip' '!debug' '!lto') |
| 15 | + |
| 16 | +_pin=a33c7eb27777339c047b8f532d1e6baebaec46bd |
| 17 | +_base="https://raw.githubusercontent.com/monomyth/t1-touchbar/${_pin}/apple-ib-drv" |
| 18 | +source=("${_base}/apple-ibridge.c" |
| 19 | + "${_base}/apple-touchbar.c" |
| 20 | + "${_base}/apple-ibridge.h" |
| 21 | + "${_base}/hid-ids.h" |
| 22 | + "${_base}/Makefile" |
| 23 | + "${_base}/LICENSE" |
| 24 | + 'dkms.conf' |
| 25 | + 'apple-t1-touchbar.conf' |
| 26 | + 'apple-t1-touchbar.service' |
| 27 | + 't1-touchbar' |
| 28 | + 'test_t1_touchbar.py' |
| 29 | + 'README.md' |
| 30 | + '99-zz-apple-gmux-backlight.rules') |
| 31 | +sha256sums=('96fc45f6ab17a01a1472e180ad7ff36648188db7a65dfc6712cf24eb7b09952d' |
| 32 | + 'ed4e076a117c354740fabf69baea592f735e007d337b1a1673bf5ec5fe1ec8f5' |
| 33 | + '34d7c6c294a657b3675502e9e082cb5499ef0204c4a0206360be7498a3754754' |
| 34 | + '70b551b047fc5c4e8c029764b64ef0a6167aa93b55913459f8df487ec1be2974' |
| 35 | + '0b83960367a409292ce1b12c2d3cb62aa3a1bf9b5a911a999b9de1a222f33982' |
| 36 | + 'db296f2f7f35bca3a174efb0eb392b3b17bd94b341851429a3dff411b1c2fc73' |
| 37 | + 'caf9f6bb22cc5c4940dc62ca19e307bde2a2946b139eaf348afaa87964522b1f' |
| 38 | + '9180d262cc8c7ee615a0928a2dae57b1ba11e46bf15ad6a261a79ed8eb70105c' |
| 39 | + '2cceada4b2994f9a7107c6bae033e5226c3058b707f078848eced5a312e8dc64' |
| 40 | + '8dda01c561c9819e53241cb60920ac3828be1849a07558259166cfb0010938a4' |
| 41 | + '787d5393d26c3819669e00b14f687136106ee629cb49cf52dcc784baa0e0d853' |
| 42 | + '8804d88710e880fdc9f019483a5089c9928e882b77904e3651b3d1cf8cc19ae0' |
| 43 | + 'a84a3e9247e37ba5505faf0080d2f6a29ba90fc579df2b279f12f62fd191eee3') |
| 44 | + |
| 45 | +build() { |
| 46 | + # A chroot/container shares the host uname, not its installed kernel headers. |
| 47 | + local headers kernel module built=0 |
| 48 | + for headers in /usr/lib/modules/*/build; do |
| 49 | + [[ -f "$headers/Makefile" ]] || continue |
| 50 | + kernel=${headers%/build} |
| 51 | + kernel=${kernel##*/} |
| 52 | + make -C "$headers" M="$srcdir" clean |
| 53 | + make -C "$headers" M="$srcdir" -j2 modules |
| 54 | + for module in apple-ibridge apple-touchbar; do |
| 55 | + [[ $(modinfo -F vermagic "$srcdir/$module.ko") == "$kernel "* ]] || return 1 |
| 56 | + done |
| 57 | + built=1 |
| 58 | + done |
| 59 | + (( built )) || { error 'No installed kernel headers found'; return 1; } |
| 60 | +} |
| 61 | + |
| 62 | +check() { |
| 63 | + PYTHONDONTWRITEBYTECODE=1 python3 -B "$srcdir/test_t1_touchbar.py" -v |
| 64 | +} |
| 65 | + |
| 66 | +package() { |
| 67 | + local dest="$pkgdir/usr/src/apple-t1-touchbar-${pkgver}" |
| 68 | + install -d "$dest" |
| 69 | + install -m644 "$srcdir"/{apple-ibridge.c,apple-touchbar.c,apple-ibridge.h,hid-ids.h,Makefile,LICENSE,dkms.conf} "$dest/" |
| 70 | + install -Dm644 "$srcdir/apple-t1-touchbar.conf" "$pkgdir/etc/modprobe.d/apple-t1-touchbar.conf" |
| 71 | + install -Dm644 "$srcdir/apple-t1-touchbar.service" "$pkgdir/usr/lib/systemd/system/apple-t1-touchbar.service" |
| 72 | + install -Dm755 "$srcdir/t1-touchbar" "$pkgdir/usr/lib/apple-t1-touchbar/t1-touchbar" |
| 73 | + install -Dm644 "$srcdir/99-zz-apple-gmux-backlight.rules" "$pkgdir/usr/lib/udev/rules.d/99-zz-apple-gmux-backlight.rules" |
| 74 | + install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE" |
| 75 | + install -Dm644 "$srcdir/README.md" "$pkgdir/usr/share/doc/$pkgname/README.md" |
| 76 | +} |
0 commit comments