Summary: U-Boot for Apple Silicon Macs Name: uboot-asahi Version: 20220814 Release: 1%{?dist} License: GPLv3+ URL: https://github.com/AsahiLinux %define debug_package %{nil} %define uboot_commit_id asahi-v2022.07-3 # to download the sources # spectool -g uboot-asahi.spec Source0: https://github.com/AsahiLinux/u-boot/archive/%{uboot_commit_id}.tar.gz BuildRequires: bison BuildRequires: flex BuildRequires: gcc BuildRequires: ImageMagick BuildRequires: make BuildRequires: openssl-devel %ifnarch aarch64 BuildRequires: gcc-aarch64-linux-gnu %endif Provides: /usr/lib/asahi-boot/u-boot-nodtb.bin %description U-Boot for Apple Silicon Macs %prep %setup -b 0 -n u-boot-%{uboot_commit_id} make %{_builddir}/u-boot-%{uboot_commit_id} apple_m1_defconfig %build cd %{_builddir}/u-boot-%{uboot_commit_id} %ifarch aarch64 make -j $(nproc) %else make -j $(nproc) CROSS_COMPILE=aarch64-linux-gnu- %endif %install install -Dpm0644 -t $RPM_BUILD_ROOT/usr/lib/asahi-boot \ %{_builddir}/u-boot-%{uboot_commit_id}/u-boot-nodtb.bin install -Dpm0644 -t $RPM_BUILD_ROOT/usr/lib/asahi-boot/dtb \ %{_builddir}/u-boot-%{uboot_commit_id}/arch/arm/dts/t[86]*.dtb %files %defattr(-,root,root,-) /usr/lib/asahi-boot/ # yeah it's a bit hacky setting the arch here -- but the issue is that m1n1 doesn't have a cross compile option # so it'll build an aarch64 version regardless -- which isn't compatible with the # traditional rpm build process which will attempt to cross compile it by setting the target ARCH # the following line causes the rpm to be named *.aarch64 %define _target_cpu aarch64 %changelog %autochangelog