Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple Silicon Mac support packages (v2) #39796

Merged
merged 12 commits into from
Jan 12, 2025
Merged
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
1 change: 1 addition & 0 deletions srcpkgs/MesaLib-asahi-devel
17 changes: 17 additions & 0 deletions srcpkgs/alsa-ucm-conf-asahi/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Template file for 'alsa-ucm-conf-asahi'
pkgname=alsa-ucm-conf-asahi
version=5
revision=1
depends="alsa-ucm-conf"
short_desc="ALSA Use Case Manager topology configurations for Apple silicon devices"
maintainer="dkwo <[email protected]>"
license="BSD-3-Clause"
homepage="https://github.com/AsahiLinux/alsa-ucm-conf-asahi"
distfiles="https://github.com/AsahiLinux/alsa-ucm-conf-asahi/archive/refs/tags/v${version}.tar.gz"
checksum=a697ef6923b94bb4d07abe0039c7fdc3c853625c7fe207b2d50a5c5bbe84c9cf

do_install() {
vmkdir usr/share/alsa/ucm2/conf.d/
vcopy ucm2/conf.d/macaudio usr/share/alsa/ucm2/conf.d/
vlicense LICENSE.asahi
}
17 changes: 17 additions & 0 deletions srcpkgs/asahi-audio/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Template file for 'asahi-audio'
pkgname=asahi-audio
version=2.5
revision=1
build_style=gnu-makefile
depends="alsa-ucm-conf-asahi speakersafetyd linux-asahi
pipewire wireplumber bankstown lsp-plugins-lv2>=1.2.14"
short_desc="Linux userspace audio configuration for Apple Silicon Macs"
maintainer="dkwo <[email protected]>"
license="MIT"
homepage="https://github.com/AsahiLinux/asahi-audio"
distfiles="https://github.com/AsahiLinux/asahi-audio/archive/refs/tags/v${version}.tar.gz"
checksum=61b014019e0f0172bbe5a9be4a3d8210e77e689bdef411af01bc3a8654d977bc

post_install() {
vlicense LICENSE
}
3 changes: 3 additions & 0 deletions srcpkgs/asahi-base/INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if [ "${ACTION}" = "post" ] && [ "${UPDATE}" = "no" ]; then
ln -s /etc/sv/speakersafetyd /var/service
fi
22 changes: 22 additions & 0 deletions srcpkgs/asahi-base/files/tinyramfs-hook-asahi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
for _mod in \
apple-mailbox \
vfat \
nvme_apple \
pinctrl-apple-gpio \
macsmc macsmc-rtkit \
i2c-apple i2c-pasemi-platform tps6598x apple-dart dwc3 dwc3-of-simple xhci-pci pcie-apple \
xhci-plat-hcd \
nvme-apple-efuses phy-apple-atc gpio_macsmc \
rtc-macsmc simple-mfd-spmi spmi-apple-controller nvmem_spmi_mfd \
spi-apple spi-hid-apple spi-hid-apple-of \
apple-dockchannel dockchannel-hid apple-rtkit-helper \
apple-sio \
mux-apple-display-crossbar phy-apple-dptx
do
copy_kmod "$_mod"
done

for _bin in umount cpio cp grep cat sed seq
do
copy_exec "$_bin"
done
20 changes: 20 additions & 0 deletions srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
modprobe apple-mailbox
modprobe nvme-apple

for i in $(seq 0 50); do
[ -e /sys/bus/platform/drivers/nvme-apple/*.nvme/nvme/nvme*/nvme*n1/ ] && break
sleep 0.1
done

print 'asahi: mounting ESP'
mountpoint=/run/.system-efi
mkdir -p "$mountpoint"
while grep -q "$mountpoint" /proc/mounts; do
umount "$mountpoint"
done
esp_uuid="$(cat /proc/device-tree/chosen/asahi,efi-system-partition 2> /dev/null | sed 's/\x00//')"
mount "PARTUUID=$esp_uuid" "$mountpoint"

print 'asahi: unpacking vendor firmware into initramfs'
cpio -i < "$mountpoint/vendorfw/firmware.cpio"
umount "$mountpoint"
9 changes: 9 additions & 0 deletions srcpkgs/asahi-base/files/tinyramfs-hook-asahi.init.late
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[ -e /vendorfw ] || return 0
print 'asahi: copying vendor firmware to root filesystem'
loaderdir=/mnt/root/lib/firmware/vendor
mkdir -p "$loaderdir"
mount -t tmpfs -o mode=0755 vendorfw "$loaderdir"

set +f
cp -pr /vendorfw/* /vendorfw/.vendorfw.manifest "$loaderdir"
set -f
17 changes: 17 additions & 0 deletions srcpkgs/asahi-base/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Template file for 'asahi-base'
pkgname=asahi-base
version=20250103
revision=1
archs="aarch64*"
build_style=meta
depends="linux-asahi m1n1 asahi-uboot speakersafetyd"
short_desc="Void Linux Apple Silicon support package"
maintainer="Will Springer <[email protected]>, dkwo <[email protected]>"
license="Public Domain"
homepage="https://asahilinux.org"

do_install() {
vinstall "${FILESDIR}/tinyramfs-hook-asahi" 644 usr/lib/tinyramfs/hook.d/asahi asahi
vinstall "${FILESDIR}/tinyramfs-hook-asahi.init" 644 usr/lib/tinyramfs/hook.d/asahi asahi.init
vinstall "${FILESDIR}/tinyramfs-hook-asahi.init.late" 644 usr/lib/tinyramfs/hook.d/asahi asahi.init.late
}
17 changes: 17 additions & 0 deletions srcpkgs/asahi-firmware/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Template file for 'asahi-firmware'
pkgname=asahi-firmware
version=0.7.9
revision=1
build_style=python3-module
hostmakedepends="python3-setuptools"
depends="python3 lzfse"
short_desc="Asahi Linux firmware tools"
maintainer="dkwo <[email protected]>"
license="MIT"
homepage="https://github.com/AsahiLinux/asahi-installer"
distfiles="https://github.com/AsahiLinux/asahi-installer/archive/refs/tags/v${version}.tar.gz"
checksum=b41f39360ce6cd6de299c4f25cd69718530a5619b16fb7a1eed666083bd909e1

classabbyamp marked this conversation as resolved.
Show resolved Hide resolved
post_install() {
vlicense LICENSE
}
21 changes: 21 additions & 0 deletions srcpkgs/asahi-scripts/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Template file for 'asahi-scripts'
pkgname=asahi-scripts
version=20240822
revision=1
archs="aarch64*"
build_style=gnu-makefile
make_install_args="install-dracut install-mkinitcpio"
depends="asahi-firmware"
short_desc="Miscellaneous admin scripts for Apple silicon devices"
maintainer="dkwo <[email protected]>"
license="MIT"
homepage="https://github.com/AsahiLinux/asahi-scripts"
distfiles="https://github.com/AsahiLinux/asahi-scripts/archive/refs/tags/${version}.tar.gz"
checksum=24023903c1341d6867d9a2baa494bbae90ca27b6cf64fa19218ef87d471304fc
make_dirs="/usr/lib/firmware/vendor 0755 root root"

post_install() {
# config for m1n1, provided by that package
rm ${DESTDIR}/etc/m1n1.conf
vlicense LICENSE
}
53 changes: 53 additions & 0 deletions srcpkgs/asahi-uboot/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Template file for 'asahi-uboot'
pkgname=asahi-uboot
version=2024.10+1
revision=1
archs="aarch64*"
hostmakedepends="bison flex which python3 swig python3-devel
python3-setuptools python3-pyelftools bc dtc"
makedepends="openssl-devel libuuid-devel gnutls-devel ncurses-libtinfo-devel"
depends="m1n1"
checkdepends="python3-pytest dtc-devel python3-filelock"
short_desc="Das U-Boot for Apple Silicon Macs"
maintainer="Will Springer <[email protected]>, dkwo <[email protected]>"
license="GPL-2.0-or-later, MIT"
homepage="https://asahilinux.org"
distfiles="https://github.com/AsahiLinux/u-boot/archive/refs/tags/asahi-v${version/+/-}.tar.gz"
checksum=c226191d52d3f853dd7d4e2c241e4259b90bd0aecb4c56e324936cc61b1bb53e
make_check=no # missing python3-libftf ?

do_configure() {
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
make ${makejobs} apple_m1_defconfig
}

do_build() {
unset CFLAGS CXXFLAGS CPPFLAGS LDFLAGS
if [ "$CROSS_BUILD" ]; then
export CROSS_COMPILE=${XBPS_CROSS_TRIPLET}-
fi
make ${makejobs} EXTRAVERSION=-${revision}
}

do_install() {
vinstall u-boot-nodtb.bin 0644 usr/lib/asahi-boot
for dtb in arch/arm/dts/t[86]*.dtb ; do
vinstall ${dtb} 0644 usr/lib/asahi-boot/dtb
done
}

post_install() {
vlicense Licenses/Exceptions
vlicense Licenses/OFL.txt
vlicense Licenses/README
vlicense Licenses/bsd-2-clause.txt
vlicense Licenses/bsd-3-clause.txt
vlicense Licenses/eCos-2.0.txt
vlicense Licenses/gpl-2.0.txt
vlicense Licenses/ibm-pibs.txt
vlicense Licenses/isc.txt
vlicense Licenses/lgpl-2.0.txt
vlicense Licenses/lgpl-2.1.txt
vlicense Licenses/r8a779x_usb3.txt
vlicense Licenses/x11.txt
}
18 changes: 18 additions & 0 deletions srcpkgs/bankstown/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Template file for 'bankstown'
pkgname=bankstown
version=1.1.0
revision=1
build_style=cargo
short_desc="Barebones bass enhancer"
maintainer="dkwo <[email protected]>"
license="MIT"
homepage="https://github.com/chadmed/bankstown"
distfiles="https://github.com/chadmed/bankstown/archive/refs/tags/${version}.tar.gz"
checksum=e877508b73fe90774d74526d838f75e8ea278bdbcee0a1f92e3eca67ed734675

do_install() {
vinstall target/$XBPS_RUST_TARGET/release/libbankstown.so 755 usr/lib/lv2/bankstown.lv2/ bankstown.so
vinstall bankstown.ttl 644 usr/lib/lv2/bankstown.lv2/
vinstall manifest.ttl 644 usr/lib/lv2/bankstown.lv2/
vlicense LICENSE
}
1 change: 1 addition & 0 deletions srcpkgs/libOSMesa-asahi
1 change: 1 addition & 0 deletions srcpkgs/libgbm-asahi
1 change: 1 addition & 0 deletions srcpkgs/libgbm-asahi-devel
1 change: 1 addition & 0 deletions srcpkgs/linux-asahi-dbg
1 change: 1 addition & 0 deletions srcpkgs/linux-asahi-headers
Loading
Loading