%global bumpver 0 %global _name box64 %global commit 056999e8fd7ec7649762179f52e32819ef5e48e1 %{?commit:%global shortcommit %(c=%{commit}; echo ${c:0:7})} Name: %{_name}-git Conflicts: %{_name} Provides: %{_name} = %{version}-%{release} Version: 0.3.8%{?bumpver:^%{bumpver}.git.%{shortcommit}} Release: 1%{?dist} Summary: Linux userspace x86_64 emulator with a twist, targeted at ARM64 # Tests are disabled as they require x86_64 libraries to run %bcond tests 0 %global forgeurl https://github.com/ptitSeb/box64 %global common_description %{expand: Box64 lets you run x86_64 Linux programs (such as games) on non-x86_64 Linux systems, like ARM (host system needs to be 64-bit little-endian).} License: MIT URL: https://box86.org Source: %{forgeurl}/archive/%{shortcommit}/%{_name}-%{shortcommit}.tar.gz BuildRequires: cmake BuildRequires: gcc BuildRequires: make BuildRequires: perl-podlators BuildRequires: systemd-rpm-macros # box64 only supports these architectures ExclusiveArch: aarch64 riscv64 ppc64le %{x86_64} Requires: %{_name}-data = %{version}-%{release} # These should not be pulled in on x86_64 as they can cause a loop and prevent # any binary from successfully executing (#2344770) %ifnarch %{x86_64} Recommends: %{name}-binfmts = %{version}-%{release} %endif %ifarch aarch64 Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives %endif %description %{common_description} %package -n box64-data Provides: box64-data = %{version}-%{release} Summary: Common files for %{_name} BuildArch: noarch %description -n box64-data %{common_description} This package provides common data files for box64. %ifnarch %{x86_64} %package binfmts Conflicts: box64-binfmts Provides: box64-binfmts = %{version}-%{release} Summary: binfmt_misc handler configurations for box64 %description binfmts %{common_description} This package provides binfmt_misc handler configurations to use box64 to execute x86_64 binaries. %endif %ifarch aarch64 %package asahi Conflicts: box64-asahi Provides: box64-asahi = %{version}-%{release} Summary: Apple Silicon version of box64 Requires: %{_name}-data = %{version}-%{release} Requires(post): %{_sbindir}/update-alternatives Requires(postun): %{_sbindir}/update-alternatives %description asahi %{common_description} This package contains a version of box64 targeting Apple Silicon systems using a 16k page size. %endif %prep %autosetup -p1 -n %{_name}-%{commit} # Remove prebuilt libraries rm -r x64lib # Fix encoding sed -i 's/\r$//' docs/*.md # Fix install paths sed -i 's:/etc/binfmt.d:%{_binfmtdir}:g' CMakeLists.txt %build %global common_flags -DNOGIT=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBOX32=ON -DBOX32_BINFMT=ON -DBOX32_FMT=ON %ifarch aarch64 %global common_flags -DARM_DYNAREC=ON %{common_flags} # Apple Silicon %cmake %{common_flags} -DM1=ON %cmake_build cp -p %{__cmake_builddir}/%{_name} %{_name}.asahi rm -r %{__cmake_builddir} %endif %cmake %{common_flags} -DNO_LIB_INSTALL=ON \ %ifarch aarch64 -DARM64=ON %endif %ifarch riscv64 -DRV64=ON %endif %ifarch ppc64le -DPPC64LE=ON %endif %ifarch %{x86_64} -DLD80BITS=ON \ -DNOALIGN=ON %endif %cmake_build # Build manpage pod2man --stderr docs/%{_name}.pod > docs/%{_name}.1 %install %ifarch %{x86_64} # Install manually as cmake_install doesn't seem to work on x86_64 install -Dpm0755 -t %{buildroot}%{_bindir} %{__cmake_builddir}/%{_name} install -Ddpm0755 %{buildroot}%{_binfmtdir} sed 's:${CMAKE_INSTALL_PREFIX}/bin/${BOX64}:%{_bindir}/%{_name}:' \ < system/box32.conf.cmake > system/box32.conf sed 's:${CMAKE_INSTALL_PREFIX}/bin/${BOX64}:%{_bindir}/%{_name}:' \ < system/box64.conf.cmake > system/box64.conf install -Dpm0644 -t %{buildroot}%{_sysconfdir} system/box64.box64rc %else %cmake_install %endif # Install manpage install -Dpm0644 -t %{buildroot}%{_mandir}/man1 docs/%{_name}.1 %ifarch aarch64 mv %{buildroot}%{_bindir}/%{_name} %{buildroot}%{_bindir}/%{_name}.aarch64 touch %{buildroot}%{_bindir}/%{_name} chmod +x %{buildroot}%{_bindir}/%{_name} install -Dpm0755 -t %{buildroot}%{_bindir} \ %{_name}.asahi %post %{_sbindir}/update-alternatives --install %{_bindir}/%{_name} \ %{_name} %{_bindir}/%{_name}.aarch64 10 %postun if [ $1 -eq 0 ] ; then %{_sbindir}/update-alternatives --remove %{_name} %{_bindir}/%{_name}.aarch64 fi %post asahi %{_sbindir}/update-alternatives --install %{_bindir}/%{_name} \ %{_name} %{_bindir}/%{_name}.asahi 20 %postun asahi if [ $1 -eq 0 ] ; then %{_sbindir}/update-alternatives --remove %{_name} %{_bindir}/%{_name}.asahi fi %endif %if %{with tests} %check %ctest %endif %files %ifarch aarch64 %ghost %{_bindir}/%{_name} %{_bindir}/%{_name}.aarch64 %else %{_bindir}/%{_name} %endif %ifarch aarch64 %files asahi %ghost %{_bindir}/%{_name} %{_bindir}/%{_name}.asahi %endif %files -n box64-data %license LICENSE %doc README.md %doc %lang(cn) README_CN.md %doc %lang(uk) README_UK.md %doc docs/*.md docs/img %{_mandir}/man1/box64.1* %config(noreplace) %{_sysconfdir}/box64.box64rc %ifnarch %{x86_64} %files binfmts %{_binfmtdir}/box32.conf %{_binfmtdir}/box64.conf %endif %changelog ## START: Generated by rpmautospec * Sun Dec 07 2025 Lachlan Marie - 0.3.8-2 - Update to 0.3.8 - Apple silicon only * Wed Aug 06 2025 Davide Cavalca - 0.3.6-1 - Update to 0.3.6; Fixes: RHBZ#2370862 * Wed Jul 23 2025 Fedora Release Engineering - 0.3.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild * Tue Mar 11 2025 Davide Cavalca - 0.3.4-1 - Update to 0.3.4; Fixes: RHBZ#2351162 * Wed Feb 12 2025 Davide Cavalca - 0.3.2-3 - Do not install binfmt_misc configs on x86_64; Fixes: RHBZ#2344770 * Thu Jan 16 2025 Fedora Release Engineering - 0.3.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild * Sat Dec 21 2024 Davide Cavalca - 0.3.2-1 - Update to 0.3.2; Fixes: RHBZ#2330808 * Sat Nov 02 2024 Teoh Han Hui - 0.3.0-1 - Update to 0.3.0 * Wed Jul 17 2024 Fedora Release Engineering - 0.2.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Wed May 22 2024 Davide Cavalca - 0.2.8-1 - Update to 0.2.8; Fixes: RHBZ#2282278 * Wed Jan 24 2024 Davide Cavalca - 0.2.6-1 - Update to 0.2.6; Fixes: RHBZ#2254840 * Tue Jan 23 2024 Fedora Release Engineering - 0.2.4-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Fri Jan 19 2024 Fedora Release Engineering - 0.2.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Wed Aug 23 2023 Davide Cavalca - 0.2.4-1 - Update to 0.2.4 * Wed Aug 23 2023 Davide Cavalca - 0.2.2-1 - Initial import; Fixes: RHBZ#2217227 ## END: Generated by rpmautospec