%global asahi_mesa_ver 20241006 %global git_tag asahi-%{asahi_mesa_ver} %global basever 24.3.0 %global ver %{basever}-asahipre%{asahi_mesa_ver} %global sdk_ver 23.08 %global llvm_major 18 %global libclc_ver llvmorg-18.1.8 %global spirv_tools_ver v2024.2 %global spirv_headers_ver vulkan-sdk-1.3.283.0 %global spirv_llvm_translator_ver v18.1.2 %global meson_ver 1.5.0 %global pyyaml_ver 6.0.2 Name: mesa-asahi-%{sdk_ver}-flatpak Summary: Mesa graphics libraries Flatpak overlay Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)} Release: 1 License: MIT URL: http://www.mesa3d.org Source0: org.freedesktop.Platform.GL.host.yml Source1: bwrapwrapper Source10: https://gitlab.freedesktop.org/asahi/mesa/-/archive/%{git_tag}/mesa-%{git_tag}.tar.gz Source11: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/%{spirv_llvm_translator_ver}.tar.gz Source12: https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/%{spirv_headers_ver}.tar.gz Source13: https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/%{spirv_tools_ver}.tar.gz Source14: https://github.com/llvm/llvm-project/archive/refs/tags/%{libclc_ver}.tar.gz Source15: https://files.pythonhosted.org/packages/d6/97/852cc27c460d5fae07c6d7e4a2744f5684760358de3456b5ee9f130b8f57/meson-%{meson_ver}.tar.gz Source16: https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-%{pyyaml_ver}.tar.gz Requires: flatpak BuildRequires: patchelf BuildRequires: flatpak-builder BuildRequires: fdo-runtime-%{sdk_ver}-flatpak BuildRequires: fdo-sdk-%{sdk_ver}-flatpak BuildRequires: fdo-sdk-extension-llvm%{llvm_major}-%{sdk_ver}-flatpak # We don't want any automatic provides/requires since this is a Flatpak, not a system app %global __provides_exclude_from ^.*$ %global __requires_exclude_from ^.*$ %description %{summary}. %prep sed \ -e "s,\%SRC_MESA,%SOURCE10,g" \ -e "s,\%SRC_SPIRV_LLVM_TRANSLATOR,%SOURCE11,g" \ -e "s,\%SRC_SPIRV_HEADERS,%SOURCE12,g" \ -e "s,\%SRC_SPIRV_TOOLS,%SOURCE13,g" \ -e "s,\%SRC_LIBCLC,%SOURCE14,g" \ -e "s,\%SRC_MESON,%SOURCE15,g" \ -e "s,\%SRC_PYYAML,%SOURCE16,g" \ %SOURCE0 > org.freedesktop.Platform.GL.host.yml cp %SOURCE1 . cat << EOF > mesa-asahi-version.patch --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -%{basever}-devel +%{basever}-asahi%{asahi_mesa_ver} EOF chmod +x bwrapwrapper flatpak remote-add --user flathub https://0.0.0.0 flatpak remote-modify --user --collection-id=org.flathub.Stable flathub flatpak install --assumeyes --user flathub --sideload-repo=/usr/share/flatpak-sideload/fdo-sdk-%{sdk_ver}/ org.freedesktop.Sdk//%{sdk_ver} flatpak install --assumeyes --user flathub --sideload-repo=/usr/share/flatpak-sideload/fdo-runtime-%{sdk_ver}/ org.freedesktop.Platform//%{sdk_ver} flatpak install --assumeyes --user flathub --sideload-repo=/usr/share/flatpak-sideload/fdo-sdk-extension-llvm%{llvm_major}-%{sdk_ver}/ org.freedesktop.Sdk.Extension.llvm%{llvm_major}//%{sdk_ver} %build FLATPAK_BWRAP=$PWD/bwrapwrapper flatpak-builder --disable-rofiles-fuse --extra-sources=%{_sourcedir} build org.freedesktop.Platform.GL.host.yml # add DT_RUNPATH to ensure that libgallium-*.so is found even with a stae ld.so.cache # https://github.com/flatpak/flatpak/issues/5948 patchelf --add-rpath /usr/lib/aarch64-linux-gnu/GL/host/lib/ build/files/lib/libEGL_mesa.so.0.0.0 patchelf --add-rpath /usr/lib/aarch64-linux-gnu/GL/host/lib/ build/files/lib/libGLX_mesa.so patchelf --add-rpath /usr/lib/aarch64-linux-gnu/GL/host/lib/ build/files/lib/libgbm.so.1.0.0 %install mkdir -p %{buildroot}%{_sharedstatedir}/flatpak/extension/org.freedesktop.Platform.GL.host/$(flatpak --default-arch)/ mv build/files %{buildroot}%{_sharedstatedir}/flatpak/extension/org.freedesktop.Platform.GL.host/$(flatpak --default-arch)/%{sdk_ver} ln -s share/glvnd share/vulkan %{buildroot}%{_sharedstatedir}/flatpak/extension/org.freedesktop.Platform.GL.host/$(flatpak --default-arch)/%{sdk_ver}/ %files %{_sharedstatedir}/flatpak/extension/org.freedesktop.Platform.GL.host/ %changelog * Wed Oct 09 2024 Janne Grunau - 24.3.0~asahipre20241006-1 - Bump to mesa-asahi-20241006 * Fri Oct 04 2024 Janne Grunau - 24.3.0~asahipre20241004-1 - Bump to mesa-asahi-20241004 - Use the asahi tag as mesa version * Mon Sep 30 2024 Janne Grunau - 24.3.0~asahipre20240930-1 - Bump to mesa-asahi-20240930 - Remove 'bin/' from the packaged extension - Fix stale ld.so.cache issue with DT_RUNPATH * Thu Sep 26 2024 Janne Grunau - 24.3.0~asahipre20240925-1 - Bump mesa to asahi-20240925 * Sun Jul 28 2024 Janne Grunau - 24.2.0~asahipre20240727-1 - Bump to 24.2.0~asahipre20240727-1 (using asahi UAPI to 10011) * Thu Jul 25 2024 Hector Martin - 24.2.0~asahipre20240725-1 - Bump to 24.2.0~asahipre20240725-1 * Tue Jul 16 2024 Hector Martin - 24.2.0~asahipre20240527-2 - Rename extension to `host`, drop env override, drop libdrm * Mon Jul 15 2024 Hector Martin - 24.2.0~asahipre20240527-1 - Initial release