From fcdbb1d961273f109987f5664e1dcdc905495217 Mon Sep 17 00:00:00 2001
From: Janne Grunau <janne-fdr@jannau.net>
Date: Sep 27 2024 07:24:06 +0000
Subject: [PATCH 1/4] remove leftover mksquashfs command


Fixes: 1fb508b ("Switch to erofs")

---

diff --git a/fex-emu-overlay-mesa.spec b/fex-emu-overlay-mesa.spec
index a3c3f31..9d723f5 100644
--- a/fex-emu-overlay-mesa.spec
+++ b/fex-emu-overlay-mesa.spec
@@ -64,7 +64,6 @@ for lib in lib lib64; do
   ln -s asahi_drv.so "out/usr/${lib}/dri/apple_dri.so"
 done
 
-mksquashfs out mesa.squashfs
 mkfs.erofs -z lz4 mesa.erofs out
 
 %install

From f63626d1ecc7f44de6c9969b7e6e87da4896f84c Mon Sep 17 00:00:00 2001
From: Janne Grunau <janne-fdr@jannau.net>
Date: Sep 27 2024 09:12:56 +0000
Subject: [PATCH 2/4] Add .gitignore


---

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0615dd6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+*.src.rpm
+mesa-*.rpm

From 5fdc75da51dc4951e76e0c4f43418d902fb75532 Mon Sep 17 00:00:00 2001
From: Janne Grunau <janne-fdr@jannau.net>
Date: Sep 27 2024 09:12:56 +0000
Subject: [PATCH 3/4] Bump to mesa-24.3.0~asahipre20240925-1


---

diff --git a/fex-emu-overlay-mesa.spec b/fex-emu-overlay-mesa.spec
index 9d723f5..d08ea2d 100644
--- a/fex-emu-overlay-mesa.spec
+++ b/fex-emu-overlay-mesa.spec
@@ -1,6 +1,10 @@
+%global asahi_mesa_ver 20240925
+%global basever 24.3.0
+%global ver %{basever}-asahipre%{asahi_mesa_ver}
+
 Name:           fex-emu-overlay-mesa
-Version:        24.2.0~asahipre20240727
-Release:        3%{?dist}
+Version:        %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
+Release:        1%{?dist}
 Summary:        Mesa overlay for FEX RootFS
 
 %global baseurl https://download.copr.fedorainfracloud.org/results/%40asahi/mesa
@@ -10,11 +14,7 @@ Summary:        Mesa overlay for FEX RootFS
 %global basechroot fedora-%{fedora}
 %endif
 %global mesa_package %{version}-1
-%if 0%{?fedora} == 41
-%global mesa_build 07940075
-%else
-%global mesa_build 07799247
-%endif
+%global mesa_build 08072777
 
 License:        MIT
 URL:            https://pagure.io/fedora-asahi/fex-emu-overlay-mesa
@@ -24,10 +24,12 @@ Source10:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-dri-driver
 Source11:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libEGL-%{mesa_package}.fc%{fedora}.i686.rpm
 Source12:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libGL-%{mesa_package}.fc%{fedora}.i686.rpm
 Source13:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libglapi-%{mesa_package}.fc%{fedora}.i686.rpm
-Source14:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libGL-%{mesa_package}.fc%{fedora}.x86_64.rpm
-Source15:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libEGL-%{mesa_package}.fc%{fedora}.x86_64.rpm
-Source16:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-dri-drivers-%{mesa_package}.fc%{fedora}.x86_64.rpm
-Source17:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libglapi-%{mesa_package}.fc%{fedora}.x86_64.rpm
+Source14:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-vulkan-drivers-%{mesa_package}.fc%{fedora}.i686.rpm
+Source20:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libGL-%{mesa_package}.fc%{fedora}.x86_64.rpm
+Source21:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libEGL-%{mesa_package}.fc%{fedora}.x86_64.rpm
+Source22:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-dri-drivers-%{mesa_package}.fc%{fedora}.x86_64.rpm
+Source23:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libglapi-%{mesa_package}.fc%{fedora}.x86_64.rpm
+Source24:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-vulkan-drivers-%{mesa_package}.fc%{fedora}.x86_64.rpm
 
 BuildRequires:  coreutils
 BuildRequires:  cpio
@@ -47,7 +49,7 @@ for Asahi-specific features.
 %prep
 %autosetup -c -T
 cp -p %SOURCE0 %SOURCE1 .
-for s in %SOURCE10 %SOURCE11 %SOURCE12 %SOURCE13 %SOURCE14 %SOURCE15 %SOURCE16 %SOURCE17; do
+for s in %SOURCE10 %SOURCE11 %SOURCE12 %SOURCE13 %SOURCE14 %SOURCE20 %SOURCE21 %SOURCE22 %SOURCE23 %SOURCE24; do
   rpm2cpio "$s" | cpio -id
 done
 
@@ -60,8 +62,14 @@ for lib in lib lib64; do
     usr/${lib}/libEGL_mesa.so*
   ln -s libGLX_mesa.so.0 "out/usr/${lib}/libGLX_system.so.0"
 
-  install -Dpm0755 -t "out/usr/${lib}/dri/" "usr/${lib}/dri/asahi_dri.so"
-  ln -s asahi_drv.so "out/usr/${lib}/dri/apple_dri.so"
+  install -Dpm0755 -t "out/usr/${lib}/" \
+    usr/${lib}/libVkLayer_MESA_device_select.so \
+    usr/${lib}/libvulkan_asahi.so
+
+  install -Dpm0755 -t "out/usr/${lib}/" "usr/${lib}/libgallium-%{basever}-asahi%{asahi_mesa_ver}.so"
+  install -Dpm0755 -t "out/usr/${lib}/dri/" "usr/${lib}/dri/libdril_dri.so"
+  ln -s libdril_dri.so "out/usr/${lib}/dri/apple_dri.so"
+  ln -s libdril_dri.so "out/usr/${lib}/dri/asahi_dri.so"
 done
 
 mkfs.erofs -z lz4 mesa.erofs out
@@ -75,6 +83,9 @@ install -Dpm0644 -t %{buildroot}%{_datadir}/fex-emu/overlays/ mesa.erofs
 %{_datadir}/fex-emu/overlays/mesa.erofs
 
 %changelog
+* Fri Sep 27 2024 Janne Grunau <janne-fdr@jannau.net> - 24.3.0~asahipre20240925-1
+- Bump to mesa-24.3.0~asahipre20240925-1
+
 * Wed Sep 25 2024 Davide Cavalca <dcavalca@fedoraproject.org> - 24.2.0~asahipre20240727-3
 - Use lz4 compression for erofs
 - Fetch the right builds from copr
diff --git a/sources b/sources
new file mode 100644
index 0000000..77230c4
--- /dev/null
+++ b/sources
@@ -0,0 +1,10 @@
+SHA512 (mesa-dri-drivers-24.3.0~asahipre20240925-1.fc40.i686.rpm) = 59f6cf923823e15ff0612dcc69933890ea3920c4f2c421b373dec93590a6e666799bbcbb435b8d19a959305f46b0acd5f9ec7a41fc6dd80d19d82d8fb90cb01d
+SHA512 (mesa-dri-drivers-24.3.0~asahipre20240925-1.fc40.x86_64.rpm) = 7f95f4cbacef5fc81cf92df40d2732a214ff9b48b18cfc902b7a023359cbf50cae561cbdd3bb9768b9ea6260db304113d6be428a0fe63410d256c06c1cc9140a
+SHA512 (mesa-libEGL-24.3.0~asahipre20240925-1.fc40.i686.rpm) = 34027682bd7a898707007b7395f357896903d152038bcf161f1773c94cba16d11081984aeac9ceb3f0922439394cca62fef7fd23137911bdcc89c90548af8611
+SHA512 (mesa-libEGL-24.3.0~asahipre20240925-1.fc40.x86_64.rpm) = d4941859f406adffb3f13304fe0310968ebca47e560fa021bb615fcb3078ba00fa55f16e8c0d037ecffff479a5f4a5acaa12036b0888490866a4030e68d6c710
+SHA512 (mesa-libGL-24.3.0~asahipre20240925-1.fc40.i686.rpm) = c6ca2197803d862f8d9a578ab53da6af6a58f3032598a0dc2be7180b6d553f2e4e264b9d46abf5dfcac577faf8160e2969b4ac0ca7513012a846596c468f539d
+SHA512 (mesa-libGL-24.3.0~asahipre20240925-1.fc40.x86_64.rpm) = 71d96a17a69152db032d82faa0f1a60a9d99e5f2548179e6d46aab591c4785f67108343be46add60ecfc8537d3d990fa88f6808188049f050cd7b3839c3794ce
+SHA512 (mesa-libglapi-24.3.0~asahipre20240925-1.fc40.i686.rpm) = d263128f569d92091bd37254e15d45dbe5b3161f9184c24d740bfea73f6734cb8f8b7cf57abd7132805716a96a0ff03d9268ba35f27b02a76e82eff3a8b522b5
+SHA512 (mesa-libglapi-24.3.0~asahipre20240925-1.fc40.x86_64.rpm) = 801042ca48e8e45b20055bca6fefe8585f7499f5a89562bfd6b127b2fa462bbceec6169996d23d6fb275defd4009a04d5227e20dc2e5e89052360a8f1c478e3b
+SHA512 (mesa-vulkan-drivers-24.3.0~asahipre20240925-1.fc40.i686.rpm) = cd8f4b05e83ffdffdfa14dbbb65b5d5a1e0ddd6cf870349b142ab502f09ff81f00c2259977af593b87ee435b0cfe7f70d196fdd48c47f259e2c025b44d395815
+SHA512 (mesa-vulkan-drivers-24.3.0~asahipre20240925-1.fc40.x86_64.rpm) = 6c637aadaa5751f9d7af4d20c6883d4da97a1e6f0fae3153376b29193566cf8d22f70e208751b603c1456cdd79e85ae30a7968a29888a6820e05f90a87d8922d

From 5078e6b1a180cb201a19c2117225b07da4f00c92 Mon Sep 17 00:00:00 2001
From: Janne Grunau <janne-fdr@jannau.net>
Date: Sep 27 2024 14:44:14 +0000
Subject: [PATCH 4/4] Build only fedora 41 overlay


---

diff --git a/fex-emu-overlay-mesa.spec b/fex-emu-overlay-mesa.spec
index d08ea2d..ad6575e 100644
--- a/fex-emu-overlay-mesa.spec
+++ b/fex-emu-overlay-mesa.spec
@@ -1,6 +1,7 @@
 %global asahi_mesa_ver 20240925
 %global basever 24.3.0
 %global ver %{basever}-asahipre%{asahi_mesa_ver}
+%global notfedora 41
 
 Name:           fex-emu-overlay-mesa
 Version:        %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
@@ -11,7 +12,7 @@ Summary:        Mesa overlay for FEX RootFS
 %if 0%{?fedora} == 42
 %global basechroot fedora-rawhide
 %else
-%global basechroot fedora-%{fedora}
+%global basechroot fedora-%{notfedora}
 %endif
 %global mesa_package %{version}-1
 %global mesa_build 08072777
@@ -20,16 +21,16 @@ License:        MIT
 URL:            https://pagure.io/fedora-asahi/fex-emu-overlay-mesa
 Source0:        LICENSE
 Source1:        README.md
-Source10:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-dri-drivers-%{mesa_package}.fc%{fedora}.i686.rpm
-Source11:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libEGL-%{mesa_package}.fc%{fedora}.i686.rpm
-Source12:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libGL-%{mesa_package}.fc%{fedora}.i686.rpm
-Source13:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libglapi-%{mesa_package}.fc%{fedora}.i686.rpm
-Source14:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-vulkan-drivers-%{mesa_package}.fc%{fedora}.i686.rpm
-Source20:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libGL-%{mesa_package}.fc%{fedora}.x86_64.rpm
-Source21:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libEGL-%{mesa_package}.fc%{fedora}.x86_64.rpm
-Source22:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-dri-drivers-%{mesa_package}.fc%{fedora}.x86_64.rpm
-Source23:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libglapi-%{mesa_package}.fc%{fedora}.x86_64.rpm
-Source24:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-vulkan-drivers-%{mesa_package}.fc%{fedora}.x86_64.rpm
+Source10:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-dri-drivers-%{mesa_package}.fc%{notfedora}.i686.rpm
+Source11:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libEGL-%{mesa_package}.fc%{notfedora}.i686.rpm
+Source12:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libGL-%{mesa_package}.fc%{notfedora}.i686.rpm
+Source13:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-libglapi-%{mesa_package}.fc%{notfedora}.i686.rpm
+Source14:       %{baseurl}/%{basechroot}-i386/%{mesa_build}-mesa/mesa-vulkan-drivers-%{mesa_package}.fc%{notfedora}.i686.rpm
+Source20:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libGL-%{mesa_package}.fc%{notfedora}.x86_64.rpm
+Source21:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libEGL-%{mesa_package}.fc%{notfedora}.x86_64.rpm
+Source22:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-dri-drivers-%{mesa_package}.fc%{notfedora}.x86_64.rpm
+Source23:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-libglapi-%{mesa_package}.fc%{notfedora}.x86_64.rpm
+Source24:       %{baseurl}/%{basechroot}-x86_64/%{mesa_build}-mesa/mesa-vulkan-drivers-%{mesa_package}.fc%{notfedora}.x86_64.rpm
 
 BuildRequires:  coreutils
 BuildRequires:  cpio

