Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkgbuilds/apple-ib-drv-dkms/99-ibridge.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Apple T1 iBridge (05ac:8600) on 2016/2017 Touch Bar MacBook Pros.
# Configuration 1 exposes both the Touch Bar HID and FaceTime HD camera.
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="8600", ATTR{bConfigurationValue}="1"

# Changing the USB configuration can reset power/control after the initial add
# event. Reapply on the resulting change/bind event after generic autosuspend.
ACTION=="add|change|bind", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="8600", TEST=="power/control", ATTR{power/control}="on"
59 changes: 59 additions & 0 deletions pkgbuilds/apple-ib-drv-dkms/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
pkgname=apple-ib-drv-dkms
pkgver=0.3.0
pkgrel=1
pkgdesc='Freeze-safe Apple T1 iBridge and Touch Bar DKMS driver'
arch=('x86_64')
url='https://github.com/AJ-dev-i60/t1-touchbar'
license=('GPL-2.0-only' 'MIT')
depends=('dkms')
checkdepends=('LINUX-HEADERS')
conflicts=('macbook12-spi-driver-dkms')
source=("t1-touchbar-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz"
'99-ibridge.rules')
sha256sums=('4092c93e450578c7de61e5c0452fae59ea7e49a7902464eb981c645f15988af5'
'86f8f64485fb7d700bbf695e0902152f107867de1b94cba711257654dd319593')

check() {
local kernels=(/usr/lib/modules/*/build)
if [[ ! -d ${kernels[0]} ]]; then
echo 'LINUX-HEADERS required to run check' >&2
return 0
fi

local kernel_build kernel_release
kernel_build=$(printf '%s\n' "${kernels[@]}" | sort -V | tail -n 1)
kernel_release=$(basename "$(dirname "$kernel_build")")
make -C "t1-touchbar-${pkgver}/apple-ib-drv" KERNELRELEASE="$kernel_release"
}

package() {
local source_dir="t1-touchbar-${pkgver}/apple-ib-drv"
local target_dir="$pkgdir/usr/src/apple-ib-drv-${pkgver}"

install -d -m 0755 "$target_dir"
install -m 0644 \
"$source_dir/Makefile" \
"$source_dir/apple-ibridge.c" \
"$source_dir/apple-ibridge.h" \
"$source_dir/apple-touchbar.c" \
"$source_dir/hid-ids.h" \
"$source_dir/dkms.conf" \
"$target_dir/"

sed -i \
-e "s/^PACKAGE_VERSION=.*/PACKAGE_VERSION=\"${pkgver}\"/" \
-e '/^CLEAN=/d' \
"$target_dir/dkms.conf"

install -Dm644 "$source_dir/packaging/apple-touchbar.modprobe.conf" \
"$pkgdir/usr/lib/modprobe.d/apple-touchbar.conf"
install -Dm644 "$source_dir/packaging/apple-touchbar.modules-load.conf" \
"$pkgdir/usr/lib/modules-load.d/apple-touchbar.conf"
install -Dm644 99-ibridge.rules \
"$pkgdir/usr/lib/udev/rules.d/99-ibridge.rules"

install -Dm644 "t1-touchbar-${pkgver}/LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE"
install -Dm644 "$source_dir/LICENSE" \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE.driver"
}