%global asahi_mesa_ver 20240527 %global git_tag asahi-%{asahi_mesa_ver} %global basever 24.2.0 %global ver %{basever}-asahipre%{asahi_mesa_ver} %global sdk_ver 22.08 %global llvm_major 16 %global libdrm_ver libdrm-2.4.121 %global libclc_ver llvmorg-16.0.2 %global spirv_tools_ver v2024.2 %global spirv_headers_ver vulkan-sdk-1.3.283.0 %global spirv_llvm_translator_ver v16.0.2 %global meson_ver 1.5.0 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 # update rpkg.conf as well with the download URL path Source0: org.freedesktop.Platform.GL.asahi.yml Source1: bwrapwrapper Source10: https://gitlab.freedesktop.org/asahi/mesa/-/archive/%{git_tag}/mesa-%{git_tag}.tar.bz2 Source11: https://gitlab.freedesktop.org/mesa/drm/-/archive/%{libdrm_ver}/drm-%{libdrm_ver}.tar.bz2 Source12: https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/refs/tags/%{spirv_llvm_translator_ver}.tar.gz Source13: https://github.com/KhronosGroup/SPIRV-Headers/archive/refs/tags/%{spirv_headers_ver}.tar.gz Source14: https://github.com/KhronosGroup/SPIRV-Tools/archive/refs/tags/%{spirv_tools_ver}.tar.gz Source15: https://github.com/llvm/llvm-project/archive/refs/tags/%{libclc_ver}.tar.gz Source16: https://files.pythonhosted.org/packages/d6/97/852cc27c460d5fae07c6d7e4a2744f5684760358de3456b5ee9f130b8f57/meson-%{meson_ver}.tar.gz Requires: flatpak 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_LIBDRM,%SOURCE11,g" \ -e "s,\%SRC_SPIRV_LLVM_TRANSLATOR,%SOURCE12,g" \ -e "s,\%SRC_SPIRV_HEADERS,%SOURCE13,g" \ -e "s,\%SRC_SPIRV_TOOLS,%SOURCE14,g" \ -e "s,\%SRC_LIBCLC,%SOURCE15,g" \ -e "s,\%SRC_MESON,%SOURCE16,g" \ %SOURCE0 > org.freedesktop.Platform.GL.asahi.yml cp %SOURCE1 . 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.asahi.yml %install mkdir -p %{buildroot}%{_sharedstatedir}/flatpak/extension/org.freedesktop.Platform.GL.asahi/$(flatpak --default-arch)/ mv build/files %{buildroot}%{_sharedstatedir}/flatpak/extension/org.freedesktop.Platform.GL.asahi/$(flatpak --default-arch)/%{sdk_ver} ln -s share/glvnd share/vulkan %{buildroot}%{_sharedstatedir}/flatpak/extension/org.freedesktop.Platform.GL.asahi/$(flatpak --default-arch)/%{sdk_ver}/ mkdir -p %{buildroot}%{_prefix}/lib/environment.d echo 'FLATPAK_GL_DRIVERS=asahi' > %{buildroot}%{_prefix}/lib/environment.d/50-asahi-flatpak-extension-%{sdk_ver}.conf %files %{_sharedstatedir}/flatpak/extension/org.freedesktop.Platform.GL.asahi/ %{_prefix}/lib/environment.d/50-asahi-flatpak-extension-%{sdk_ver}.conf %changelog * Mon Jul 15 2024 Hector Martin - 24.2.0~asahipre20240527-1 - Initial release