## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global debug_package %{nil} # Chainloading support requires the aarch64-unknown-none-softfloat rust target, # which is only available on aarch64 %ifarch aarch64 %bcond chainloading 1 %else %bcond chainloading 0 %endif # We need to vendor fatfs because m1n1 stage1 relies on unreleased changes # (notably, the lfn feature): https://github.com/rafalh/rust-fatfs/issues/81 %global fatfs_commit 87fc1ed5074a32b4e0344fcdde77359ef9e75432 %global _description %{expand: m1n1 is the bootloader developed by the Asahi Linux project to bridge the Apple (XNU) boot ecosystem to the Linux boot ecosystem.} Name: m1n1 Version: 1.4.14 Release: %autorelease Summary: Bootloader and experimentation playground for Apple Silicon # m1n1 proper is MIT licensed, but it relies on a number of vendored projects # See the "License" section in README.md for the breakdown License: MIT AND CC0-1.0 AND OFL-1.1-RFN AND Zlib AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-2.0-or-later) URL: https://github.com/AsahiLinux/m1n1 Source: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz Source: https://github.com/rafalh/rust-fatfs/archive/%{fatfs_commit}/rust-fatfs-%{fatfs_commit}.tar.gz # Use distribution packages instead of the vendored ones Patch: m1n1-rust-deps.patch # https://github.com/rafalh/rust-fatfs/commit/eb274ca10d035c176e5eac79420ca734c02613ae Patch: rust-fatfs-fix-build-log.patch %ifarch aarch64 # On aarch64 do a native build BuildRequires: gcc %global buildflags RELEASE=1 ARCH= %else # By default m1n1 does a cross build BuildRequires: gcc-aarch64-linux-gnu %global buildflags RELEASE=1 %endif BuildRequires: make # For the bootloader logos and the framebuffer console BuildRequires: adobe-source-code-pro-fonts BuildRequires: coreutils BuildRequires: fontconfig BuildRequires: system-logos BuildRequires: ImageMagick BuildRequires: zopfli # For the udev rule BuildRequires: systemd-rpm-macros %if %{with chainloading} BuildRequires: cargo-rpm-macros >= 24 BuildRequires: rust-std-static-aarch64-unknown-none-softfloat %endif # These are bundled, modified and statically linked into m1n1 Provides: bundled(arm-trusted-firmware) Provides: bundled(dwc3) Provides: bundled(dlmalloc) Provides: bundled(PDCLib) Provides: bundled(libfdt) Provides: bundled(minilzlib) Provides: bundled(tinf) %description %_description %if %{with chainloading} %package stage1 Summary: %{summary} # The following breakdown only covers the rust dependencies # Apache-2.0 OR MIT # MIT # MIT OR Apache-2.0 License: MIT AND CC0-1.0 AND OFL-1.1-RFN AND Zlib AND (BSD-2-Clause OR GPL-2.0-or-later) AND (BSD-3-Clause OR GPL-2.0-or-later) AND (Apache-2.0 OR MIT) AND MIT AND (MIT OR Apache-2.0) # LICENSE.dependencies contains a full license breakdown of the rust dependencies # This is vendored and statically linked into m1n1 when building for stage 1 Provides: bundled(crate(fatfs))= 0.4.0 %description stage1 %_description This package contains the stage1 build of m1n1 that is used by the Asahi Linux Installer. %endif %package tools Summary: Developer tools for m1n1 Requires: %{name} = %{version}-%{release} Requires: python3 Requires: python3dist(construct) Requires: python3dist(pyserial) Requires: systemd-udev BuildArch: noarch %description tools %_description This package contains various developer tools for m1n1. %prep %autosetup -N # Use our logos # https://pagure.io/fedora-logos/pull-request/21 # https://pagure.io/generic-logos/pull-request/2 pushd data rm bootlogo_{128,256}.{bin,png} convert -background none -resize 128x128 -gravity center -extent 128x128 \ %{_datadir}/pixmaps/fedora-logo-sprite.svg bootlogo_128.png zopflipng -ym bootlogo_128.png bootlogo_128.png convert -background none -resize 256x256 -gravity center -extent 256x256 \ %{_datadir}/pixmaps/fedora-logo-sprite.svg bootlogo_256.png zopflipng -ym bootlogo_256.png bootlogo_256.png ./makelogo.sh popd # Use our fonts font="$(fc-match "Source Code Pro:bold" 'file' | cut -d= -f2)" if [ ! -e "$font" ]; then echo "Failed to find font" exit 1 fi pushd font rm SourceCodePro-Bold.ttf font.bin font_retina.bin ./makefont.sh 8 16 12 "$font" font.bin ./makefont.sh 16 32 25 "$font" font_retina.bin popd %if %{with chainloading} tar -xf %{SOURCE1} -C rust/vendor/rust-fatfs --strip-components 1 %autopatch -p1 %cargo_prep %generate_buildrequires cd rust %cargo_generate_buildrequires %endif %build %if %{with chainloading} %make_build %{buildflags} CHAINLOADING=1 mv build build-stage1 pushd rust %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies popd %endif %make_build %{buildflags} %install install -Dpm0644 -t %{buildroot}%{_libdir}/%{name} build/%{name}.{bin,macho} %if %{with chainloading} install -Dpm0644 -t %{buildroot}%{_libdir}/%{name}-stage1 \ build-stage1/%{name}.{bin,macho} %endif install -Ddpm0755 %{buildroot}%{_libexecdir}/%{name} cp -pr proxyclient tools %{buildroot}%{_libexecdir}/%{name}/ install -Dpm0644 -t %{buildroot}%{_udevrulesdir} udev/80-m1n1.rules %files %license LICENSE 3rdparty_licenses/LICENSE.* %doc README.md %{_libdir}/%{name} %if %{with chainloading} %files stage1 %license LICENSE 3rdparty_licenses/LICENSE.* rust/vendor/rust-fatfs/LICENSE.txt rust/LICENSE.dependencies %doc README.md %{_libdir}/%{name}-stage1 %endif %files tools %{_libexecdir}/%{name} %{_udevrulesdir}/80-m1n1.rules %changelog ## START: Generated by rpmautospec * Mon May 20 2024 Davide Cavalca - 1.4.14-2 - Build stage1 as well on aarch64 * Sat May 18 2024 Davide Cavalca - 1.4.14-1 - Update to 1.4.14; Fixes: RHBZ#2281376 * Fri May 17 2024 Hector Martin - 1.4.13-1 - Update to 1.4.13 * Mon Apr 29 2024 Davide Cavalca - 1.4.12-1 - Update to 1.4.12 * Thu Jan 25 2024 Fedora Release Engineering - 1.4.11-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Jan 21 2024 Fedora Release Engineering - 1.4.11-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sun Dec 17 2023 Hector Martin - 1.4.11-1 - Update to 1.4.11 * Sun Dec 17 2023 Hector Martin - 1.4.10-1 - Update to 1.4.10 * Wed Dec 13 2023 Davide Cavalca - 1.4.9-1 - Update to 1.4.9 * Mon Nov 27 2023 Hector Martin - 1.4.8-1 - Update to 1.4.8 * Thu Nov 02 2023 Davide Cavalca - 1.4.6-1 - Update to 1.4.6 * Fri Oct 13 2023 Davide Cavalca - 1.4.3-1 - Update to 1.4.3 * Mon Oct 09 2023 Davide Cavalca - 1.4.2-1 - Update to 1.4.2; Fixes: RHBZ#2242749 * Sun Oct 08 2023 Davide Cavalca - 1.4.1-1 - Update to 1.4.1 * Thu Oct 05 2023 Davide Cavalca - 1.4.0-1 - Update to 1.4.0 * Wed Sep 20 2023 Davide Cavalca - 1.3.7-1 - Update to 1.3.7 * Wed Sep 20 2023 Hector Martin - 1.3.6-2 - Fix font path detection * Mon Sep 04 2023 Davide Cavalca - 1.3.6-1 - Update to 1.3.6 * Mon Aug 21 2023 Davide Cavalca - 1.3.3-1 - Update to 1.3.3 * Wed Aug 02 2023 Davide Cavalca - 1.3.2-1 - Update to 1.3.2 * Wed Aug 02 2023 Davide Cavalca - 1.3.1-1 - Update to 1.3.1 * Sat Jul 22 2023 Davide Cavalca - 1.3.0-1 - Update to 1.3.0; Fixes: RHBZ#2224549 * Thu Jul 20 2023 Fedora Release Engineering - 1.2.9-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Wed Jun 07 2023 Davide Cavalca - 1.2.9-1 - Update to 1.2.9; Fixes: RHBZ#2212155 * Tue May 30 2023 Davide Cavalca - 1.2.8-1 - Update to 1.2.8 * Sat May 06 2023 Davide Cavalca - 1.2.7-1 - Update to 1.2.7; Fixes: RHBZ#2193215 * Sun Mar 19 2023 Davide Cavalca - 1.2.6-1 - Update to 1.2.6; Fixes: RHBZ#2179665 * Sat Mar 11 2023 Davide Cavalca - 1.2.5-1 - Update m1n1 to 1.2.5; Fixes: RHBZ#2177403 * Thu Feb 16 2023 Davide Cavalca - 1.2.4-1 - Update to 1.2.4; Fixes: RHBZ#2164030 * Thu Jan 19 2023 Fedora Release Engineering - 1.2.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Sun Dec 11 2022 Olivia Crain - 1.2.3-2 - Convert license tag to SPDX expression * Fri Dec 09 2022 Davide Cavalca - 1.2.3-1 - Update to 1.2.3; Fixes: RHBZ#2152157 * Sun Dec 04 2022 Davide Cavalca - 1.2.2-1 - Update to 1.2.2; Fixes: RHBZ#2150583 * Thu Nov 17 2022 Davide Cavalca - 1.1.8-1 - Update to 1.1.8; Fixes: RHBZ#2143526 * Thu Oct 27 2022 Davide Cavalca - 1.1.7-1 - Update to 1.1.7; Fixes: RHBZ#2135526 * Mon Sep 19 2022 Davide Cavalca - 1.1.5-1 - Update to 1.1.5; Fixes: RHBZ#2127779 * Sun Aug 14 2022 Davide Cavalca - 1.1.4-1 - Update to 1.1.4; Fixes: RHBZ#2099682 * Thu Jul 21 2022 Fedora Release Engineering - 1.0.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Thu Mar 24 2022 Davide Cavalca - 1.0.2-1 - Initial import; Fixes: RHBZ#2066135 ## END: Generated by rpmautospec