Skip to content
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ AURORA_INSTALL_BUILDDEPS=1 bash scripts/build-rpm aura

The platform includes `avd-fw` from Aurora's firmware fork and `upower` from Aurora's battery-reporting fork. The latter retains Fedora's `upower`, `upower-libs` and `upower-devel` package names so desktop dependencies resolve normally. Its native build runs the macsmc battery-time regression tests. Firmware builds retain the linked symbols for all six decoder variants.

`aurora-flatpak-gl` gives Flatpak apps the same Mesa as the rest of the system. Flatpak apps load OpenGL and Vulkan from the runtime's GL extension, so without it they run Flathub's `GL.default`. `build-extension.sh` in the package directory builds `org.freedesktop.Platform.GL.aurora` for a runtime branch from the `mesa-aurora` commit into a local OSTree repository. The RPM carries that repository (`--with repo`), installs the extension into the system installation and sets `FLATPAK_GL_DRIVERS=aurora:default:host`. The extension has a higher priority than `GL.default` and ships the same file names, so its Asahi ICD, EGL vendor file and DRI drivers replace Flathub's in the merged GL directories. Runtime branches without a `GL.aurora` build keep `GL.default`. Removing the package removes the extension, the remote and its override keys.
`aurora-flatpak-gl` gives Flatpak apps the same Mesa as the rest of the system. Flatpak apps load OpenGL and Vulkan from the runtime's GL extension, so without it they run Flathub's `GL.default`. `build-extension.sh` in the package directory builds `org.freedesktop.Platform.GL.aurora` for a runtime branch from the `mesa-aurora` commit into a local OSTree repository. The RPM carries that repository (`--with repo`), installs the extension into the system installation and sets `FLATPAK_GL_DRIVERS=aurora:default:host`. The extension has a higher priority than `GL.default` and ships the same file names, so its Asahi ICD, EGL vendor file and DRI drivers replace Flathub's in the merged GL directories. Runtime branches without a `GL.aurora` build keep `GL.default`. The recipe follows the `mesa-aurora` commit, Version and Release like `mesa-aurora-fex-guest`, the source tracker moves it along, and a build refuses a repository stamped with another Mesa commit. Removing the package removes the extension, the remote and its override keys.

## Updates and distribution

Expand Down
37 changes: 28 additions & 9 deletions packages/aurora-flatpak-gl/aurora-flatpak-gl.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,38 @@
# GL.default. Removing the package removes the extension and the settings, and
# apps go back to GL.default.
#
# Keep commit, Version and Release identical to packages/mesa-aurora, as for
# mesa-aurora-fex-guest: the tracker moves all three together and
# tests/test_specs.py checks it. A host Mesa built from another recipe can be
# matched without editing this file, e.g. for the fleet's mesa.spec line:
# rpmbuild --define 'commit <40-hex>' --define 'host_version 26.3.0~devel' \
# --define 'host_release 0.17.aurora.borealis.<12-hex>%%{?dist}' ...
#
# The repository is not built here: build it with build-extension.sh (next to
# this file) for each runtime branch, tar it as Source10 and build with --with repo.
# Without it the package carries only the settings, which change nothing until
# GL.aurora is installed.
# this file) for each runtime branch, tar it as Source10 and build with
# --with repo. build-extension.sh stamps each branch with its Mesa commit and
# the build refuses a repository from another commit. Without the repository
# the package carries only the settings, which change nothing until GL.aurora
# is installed.
%bcond repo 0
%global mesa_commit 473e325b4f50d01d9716fe276bfdce57d0a76ca7
%global mesa_short 473e325b4f50
%{!?commit:%global commit f2c9dc3fb59c81fdaf51f19884175c856e3d1889}
%{!?host_version:%global host_version 26.3.0}
%{!?host_release:%global host_release 7%{?dist}.aurora}
%global shortcommit %{sub %{commit} 1 12}
%global debug_package %{nil}
%global __requires_exclude_from ^%{_datadir}/aurora-flatpak-gl/
%global __provides_exclude_from ^%{_datadir}/aurora-flatpak-gl/
Name: aurora-flatpak-gl
Version: 26.3.0
Release: 0.1.%{mesa_short}%{?dist}
Version: %{host_version}
Release: %{host_release}
Summary: Aurora Mesa for Flatpak apps
License: MIT
URL: https://github.com/aurora-silicon/fedora-aurora
Source0: aurora-flatpak-gl
Source1: 60-aurora-flatpak-gl.conf
Source2: aurora-flatpak-gl.sh
%if %{with repo}
Source10: aurora-flatpak-gl-repo-%{mesa_short}.tar
Source10: aurora-flatpak-gl-repo-%{shortcommit}.tar
%endif
ExclusiveArch: aarch64
Requires: flatpak
Expand All @@ -51,7 +62,12 @@ install -Dm644 %{SOURCE2} %{buildroot}%{_sysconfdir}/profile.d/aurora-flatpak-gl
install -d %{buildroot}%{_datadir}/aurora-flatpak-gl
%if %{with repo}
tar -xf %{SOURCE10} -C %{buildroot}%{_datadir}/aurora-flatpak-gl
test -d %{buildroot}%{_datadir}/aurora-flatpak-gl/repo/objects
repo=%{buildroot}%{_datadir}/aurora-flatpak-gl/repo
test -d $repo/objects
stamps=$(ls $repo/aurora-mesa-commit.* 2>/dev/null) || { echo 'repository has no Mesa commit stamp' >&2; exit 1; }
for s in $stamps; do
[ "$(cat $s)" = %{commit} ] || { echo "$s is $(cat $s), not %{commit}" >&2; exit 1; }
done
%endif

%posttrans
Expand All @@ -69,6 +85,9 @@ fi
%{_datadir}/aurora-flatpak-gl/

%changelog
* Thu Oct 29 2026 Ryan Murray <ryan@aurorasilicon.org> - 26.3.0-7.aurora
- Move in lockstep with mesa-aurora: commit, Version and Release follow its
pin, and the build checks the repository's Mesa commit stamps.
* Thu Oct 29 2026 Aurora Silicon <hey@djdev.me> - 26.3.0-0.1.473e325b4f50
- Initial package: GL.aurora for the 25.08 and 26.08 runtimes from Mesa
473e325b4f50.
2 changes: 2 additions & 0 deletions packages/aurora-flatpak-gl/build-extension.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,6 @@ PY
flatpak build-export --arch=aarch64 \
--subject="Aurora Mesa $commit for $branch" "$repo" "$work/build" "$branch"
flatpak build-update-repo "$repo"
# aurora-flatpak-gl.spec checks these against its Mesa commit.
echo "$commit" > "$repo/aurora-mesa-commit.$branch"
echo "exported org.freedesktop.Platform.GL.aurora/aarch64/$branch from $commit"
29 changes: 22 additions & 7 deletions scripts/track-sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@
KINDS = {'kernel-aurora': 'kernel', 'mesa-aurora': 'mesa'}
CI_WORKFLOWS = ['rpms.yml', 'checks.yml']
# The only files a tracker proposal may change.
PATCH_PATHS = [r'sources\.json', r'packages/(kernel-aurora|aura|mesa-aurora|mesa-aurora-fex-guest)/[^/]+\.spec']
# The FEX guest Mesa moves in lockstep with the host Mesa (tests/test_specs.py).
PATCH_PATHS = [r'sources\.json', r'packages/(kernel-aurora|aura|mesa-aurora|mesa-aurora-fex-guest|aurora-flatpak-gl)/[^/]+\.spec']
# The FEX guest Mesa and the Flatpak GL extension move in lockstep with the
# host Mesa (tests/test_specs.py).
GUEST = 'mesa-aurora-fex-guest'
FLATPAK_GL = 'aurora-flatpak-gl'


def update_recipe(root, item, today):
Expand Down Expand Up @@ -58,21 +60,34 @@ def update_recipe(root, item, today):
raise ValueError(f'{key}: {new_version}-{release} would not upgrade {"-".join(previous)}')
if key == 'mesa-aurora':
sync_fex_guest(root, item['new'], new_version, dist)
sync_flatpak_gl(root, item['new'], new_version, dist)
return notes


def sync_fex_guest(root, commit, version, release):
"""Give the FEX guest Mesa the host Mesa's commit, Version, Release and pin."""
spec = root / 'packages' / GUEST / f'{GUEST}.spec'
def sync_host_macros(root, name, commit, version, release):
"""Give a lockstep recipe the host Mesa's commit, Version and Release."""
spec = root / 'packages' / name / f'{name}.spec'
if not spec.exists():
return
return False
text = spec.read_text()
for macro, value in (('commit', commit), ('host_version', version), ('host_release', release)):
text, count = re.subn(rf'^%\{{!\?{macro}:%global {macro} \S+\}}$',
lambda _: f'%{{!?{macro}:%global {macro} {value}}}', text, flags=re.M)
if count != 1:
raise ValueError(f'{GUEST}: %{{{macro}}} is not pinned exactly once')
raise ValueError(f'{name}: %{{{macro}}} is not pinned exactly once')
spec.write_text(text)
return True


def sync_flatpak_gl(root, commit, version, release):
"""Give the Flatpak GL extension package the host Mesa's commit, Version and Release."""
sync_host_macros(root, FLATPAK_GL, commit, version, release)


def sync_fex_guest(root, commit, version, release):
"""Give the FEX guest Mesa the host Mesa's commit, Version, Release and pin."""
if not sync_host_macros(root, GUEST, commit, version, release):
return
pins = tl.load_pins(root)
pins[GUEST] = dict(pins['mesa-aurora'])
tl.write_pins(root, pins)
Expand Down
14 changes: 14 additions & 0 deletions tests/test_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ def test_spec_commit_matches_its_source_pin(self):
continue
with self.subTest(package=name):
self.assertEqual(sources[name]['commit'], match.group(1))
def test_flatpak_gl_moves_in_lockstep_with_the_host_mesa(self):
def fields(name):
text = (ROOT / 'packages' / name / (name + '.spec')).read_text()
commit = re.search(r'^%(?:\{!\?commit:)?%?global commit ([0-9a-f]{40})', text, re.M).group(1)
macros = dict(re.findall(r'^%\{!\?(\w+):%global \1 (\S+)\}', text, re.M))
expand = lambda value: re.sub(r'%\{(\w+)\}', lambda m: macros.get(m.group(1), m.group(0)), value)
version = expand(re.search(r'^Version:\s+(\S+)', text, re.M).group(1))
release = expand(re.search(r'^Release:\s+(\S+)', text, re.M).group(1))
return commit, version, release, text
host, gl = fields('mesa-aurora'), fields('aurora-flatpak-gl')
self.assertEqual(host[:3], gl[:3])
self.assertEqual(json.loads((ROOT / 'sources.json').read_text())['mesa-aurora']['commit'], gl[0])
self.assertIn('aurora-mesa-commit.', gl[3])
self.assertIn('aurora-mesa-commit.', (ROOT / 'packages' / 'aurora-flatpak-gl' / 'build-extension.sh').read_text())
def test_flatpak_gl_settings_name_the_files_the_extension_ships(self):
d = ROOT / 'packages' / 'aurora-flatpak-gl'
helper = (d / 'aurora-flatpak-gl').read_text()
Expand Down
14 changes: 14 additions & 0 deletions tests/test_track_sources.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datetime
import importlib.util
import json
import re
from pathlib import Path
import shutil
import sys
Expand Down Expand Up @@ -63,6 +64,19 @@ def test_mesa_keeps_its_numeric_version(self):
module.update_recipe(self.root, item, TODAY)
self.assertEqual(module.tl.spec_field(self.spec('mesa-aurora'), 'Version'), '26.3.0')

def test_mesa_moves_the_flatpak_gl_package_with_it(self):
name = module.FLATPAK_GL
shutil.copytree(ROOT / 'packages' / name, self.root / 'packages' / name)
module.update_recipe(self.root, self.item('mesa-aurora', version='26.3.0'), TODAY)
host, gl = self.spec('mesa-aurora'), self.spec(name)
self.assertIn(f'%{{!?commit:%global commit {NEW}}}\n', gl)
self.assertIn('%{!?host_version:%global host_version '
+ module.tl.spec_field(host, 'Version') + '}\n', gl)
self.assertIn('%{!?host_release:%global host_release '
+ module.tl.spec_field(host, 'Release') + '}\n', gl)
self.assertTrue(any(re.fullmatch(pattern, f'packages/{name}/{name}.spec')
for pattern in module.PATCH_PATHS))

def test_changelog_history_is_never_rewritten(self):
spec = self.root / 'packages/aura/aura.spec'
old = self.pins['aura']['commit']
Expand Down
Loading