public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/mesa] rawhide: Include CentOS bundled dependencies
Date: Mon, 23 Nov 2026 08:22:53 GMT	[thread overview]
Message-ID: <179542217398.1.2581380050924301794.rpms-mesa-c790668cccef@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/mesa
            Branch : rawhide
            Commit : c790668cccefa219bedbfda6c821fc1e336b8d53
            Author : José Expósito <jexposit@redhat.com>
            Date   : 2026-11-20T16:01:58+01:00
            Stats  : +240/-4 in 18 file(s)
            URL    : https://src.fedoraproject.org/rpms/mesa/c/c790668cccefa219bedbfda6c821fc1e336b8d53?branch=rawhide

            Log:
            Include CentOS bundled dependencies

Some dependencies are not available in CentOS and they need to be build
as part of the mesa pacakge.

To avoid polluting the mesa spec with CentOS-only dependencies, build
them in .inc files, keeping the changes in the spec file to the minimum.

---
diff --git a/100-meson-source.inc b/100-meson-source.inc
new file mode 100644
index 0000000..786cc24
--- /dev/null
+++ b/100-meson-source.inc
@@ -0,0 +1,7 @@
+# meson >= 1.7.0 is required in CentOS 9 and 10
+%if 0%{?rhel} && !0%{?eln}
+
+%global meson_ver 1.7.0
+Source150: https://github.com/mesonbuild/meson/releases/download/%{meson_ver}/meson-%{meson_ver}.tar.gz
+
+%endif

diff --git a/101-meson-prep.inc b/101-meson-prep.inc
new file mode 100644
index 0000000..96b42ae
--- /dev/null
+++ b/101-meson-prep.inc
@@ -0,0 +1,5 @@
+%if 0%{?rhel} && !0%{?eln}
+
+tar -xvf %{SOURCE150}
+
+%endif

diff --git a/102-meson-build.inc b/102-meson-build.inc
new file mode 100644
index 0000000..09b8048
--- /dev/null
+++ b/102-meson-build.inc
@@ -0,0 +1,10 @@
+%if 0%{?rhel} && !0%{?eln}
+
+cd meson-%{meson_ver}
+%py3_build
+%py3_install
+%global __meson %{buildroot}%{_bindir}/meson
+export PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib}
+cd -
+
+%endif

diff --git a/103-meson-install.inc b/103-meson-install.inc
new file mode 100644
index 0000000..5803ae3
--- /dev/null
+++ b/103-meson-install.inc
@@ -0,0 +1,9 @@
+%if 0%{?rhel} && !0%{?eln}
+
+cd meson-%{meson_ver}
+%py3_install
+%global __meson %{buildroot}%{_bindir}/meson
+export PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib}
+cd -
+
+%endif

diff --git a/104-meson-install-cleanup.inc b/104-meson-install-cleanup.inc
new file mode 100644
index 0000000..ab9a707
--- /dev/null
+++ b/104-meson-install-cleanup.inc
@@ -0,0 +1,10 @@
+%if 0%{?rhel} && !0%{?eln}
+
+rm -f  %{buildroot}%{_bindir}/meson
+rm -rf %{buildroot}%{_mandir}/man1/meson.1*
+rm -f  %{buildroot}%{_datadir}/polkit-1/actions/com.mesonbuild.install.policy
+rm -f  %{buildroot}%{_datadir}/bash-completion/completions/meson
+rm -f  %{buildroot}%{_datadir}/zsh/site-functions/_meson
+rm -rf %{buildroot}%{python3_sitelib}
+
+%endif

diff --git a/200-spirv-llvm-translator-source.inc b/200-spirv-llvm-translator-source.inc
new file mode 100644
index 0000000..b47af56
--- /dev/null
+++ b/200-spirv-llvm-translator-source.inc
@@ -0,0 +1,16 @@
+# spirv-llvm-translator is required in CentOS 9 and 10
+%if 0%{?rhel} && !0%{?eln}
+
+%global spirv_llvm_trans_ver 23.1.2
+%global spirv_llvm_trans_commit e65dde28ce8f12ef7245914fa2850260328669e4
+%global spirv_llvm_trans_shortcommit %(c=%{spirv_llvm_trans_commit}; echo ${c:0:7})
+Source250:      https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/%{spirv_llvm_trans_commit}/spirv-llvm-translator-%{spirv_llvm_trans_shortcommit}.tar.gz
+
+BuildRequires:  cmake
+BuildRequires:  ninja-build
+BuildRequires:  llvm-static
+BuildRequires:  spirv-headers-devel
+BuildRequires:  spirv-tools-devel
+BuildRequires:  zlib-devel
+
+%endif

diff --git a/201-spirv-llvm-translator-prep.inc b/201-spirv-llvm-translator-prep.inc
new file mode 100644
index 0000000..3195fa5
--- /dev/null
+++ b/201-spirv-llvm-translator-prep.inc
@@ -0,0 +1,5 @@
+%if 0%{?rhel} && !0%{?eln}
+
+tar -xvf %{SOURCE250}
+
+%endif

diff --git a/202-spirv-llvm-translator-build.inc b/202-spirv-llvm-translator-build.inc
new file mode 100644
index 0000000..a145e4a
--- /dev/null
+++ b/202-spirv-llvm-translator-build.inc
@@ -0,0 +1,27 @@
+%if 0%{?rhel} && !0%{?eln}
+
+cd SPIRV-LLVM-Translator-%{spirv_llvm_trans_commit}
+%cmake -GNinja \
+       -DLLVM_BUILD_TOOLS=ON \
+       -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+       -DCMAKE_INSTALL_RPATH:BOOL=";" \
+       -DLLVM_DIR="/usr/lib64/cmake/llvm/" \
+%if 0%{?__isa_bits} == 64
+       -DLLVM_LIBDIR_SUFFIX=64 \
+%else
+       -DLLVM_LIBDIR_SUFFIX= \
+%endif
+       -DLLVM_EXTERNAL_PROJECTS="SPIRV-Headers" \
+       -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR="/usr/include/spirv/"
+%cmake_build
+%cmake_install
+cd -
+
+export LIBRARY_PATH=%{buildroot}%{_libdir}:$LIBRARY_PATH
+export LD_LIBRARY_PATH=%{buildroot}%{_libdir}:$LD_LIBRARY_PATH
+export XDG_DATA_DIRS=%{buildroot}%{_datadir}:$XDG_DATA_DIRS
+export CPATH=%{buildroot}%{_includedir}:$CPATH
+export PKG_CONFIG_PATH=%{buildroot}%{_libdir}/pkgconfig:%{buildroot}%{_datadir}/pkgconfig:$PKG_CONFIG_PATH
+export PATH=%{buildroot}%{_bindir}:$PATH
+
+%endif

diff --git a/203-spirv-llvm-translator-install-cleanup.inc b/203-spirv-llvm-translator-install-cleanup.inc
new file mode 100644
index 0000000..6edb5e6
--- /dev/null
+++ b/203-spirv-llvm-translator-install-cleanup.inc
@@ -0,0 +1,9 @@
+%if 0%{?rhel} && !0%{?eln}
+
+rm -f  %{buildroot}%{_bindir}/llvm-spirv
+rm -fr %{buildroot}%{_includedir}/LLVMSPIRVLib
+rm -f  %{buildroot}%{_libdir}/libLLVMSPIRVLib.so
+rm -f  %{buildroot}%{_libdir}/libLLVMSPIRVLib.so.*
+rm -f  %{buildroot}%{_libdir}/pkgconfig/LLVMSPIRVLib.pc
+
+%endif

diff --git a/300-wayland-protocols-source.inc b/300-wayland-protocols-source.inc
new file mode 100644
index 0000000..c31c542
--- /dev/null
+++ b/300-wayland-protocols-source.inc
@@ -0,0 +1,8 @@
+# wayland-protocols >= 1.49 is required CentOS 9
+%if 0%{?rhel} == 9
+
+%global wayland_protocols_ver 1.49
+Source350:      https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/%{wayland_protocols_ver}/downloads/wayland-protocols-%{wayland_protocols_ver}.tar.xz
+BuildRequires:  wayland-devel
+
+%endif

diff --git a/301-wayland-protocols-prep.inc b/301-wayland-protocols-prep.inc
new file mode 100644
index 0000000..be3c8bf
--- /dev/null
+++ b/301-wayland-protocols-prep.inc
@@ -0,0 +1,5 @@
+%if 0%{?rhel} == 9
+
+tar -xvf %{SOURCE350}
+
+%endif

diff --git a/302-wayland-protocols-build.inc b/302-wayland-protocols-build.inc
new file mode 100644
index 0000000..7bbb99a
--- /dev/null
+++ b/302-wayland-protocols-build.inc
@@ -0,0 +1,9 @@
+%if 0%{?rhel} == 9
+
+cd wayland-protocols-%{wayland_protocols_ver}
+%meson --prefix=%{buildroot} -Dtests=false
+%meson_build
+%meson_install
+cd -
+
+%endif

diff --git a/303-wayland-protocols-install-cleanup.inc b/303-wayland-protocols-install-cleanup.inc
new file mode 100644
index 0000000..0692f7e
--- /dev/null
+++ b/303-wayland-protocols-install-cleanup.inc
@@ -0,0 +1,6 @@
+%if 0%{?rhel} == 9
+
+rm -f  %{buildroot}%{_datadir}/pkgconfig/wayland-protocols.pc
+rm -fr %{buildroot}%{_datadir}/wayland-protocols/
+
+%endif

diff --git a/400-python3.11-source.inc b/400-python3.11-source.inc
new file mode 100644
index 0000000..3c53e63
--- /dev/null
+++ b/400-python3.11-source.inc
@@ -0,0 +1,6 @@
+# Mesa >= 26.3 requires Python >= 3.10, but CentOS 9 ships Python 3.9
+%if 0%{?rhel} == 9
+
+BuildRequires:  python3.11
+
+%endif
\ No newline at end of file

diff --git a/401-python3.11-build.inc b/401-python3.11-build.inc
new file mode 100644
index 0000000..fa5d7f2
--- /dev/null
+++ b/401-python3.11-build.inc
@@ -0,0 +1,11 @@
+# RHEL 9 ships Python 3.9, but Mesa >= 26.3 requires >= 3.10.
+# Prepend a shim directory where 'python3' points to python3.11, and expose
+# python3.9 site-packages (mako, pyyaml) via PYTHONPATH so python3.11 finds them.
+%if 0%{?rhel} == 9
+
+mkdir -p %{_builddir}/el9-python-shim
+ln -sf /usr/bin/python3.11 %{_builddir}/el9-python-shim/python3
+export PATH=%{_builddir}/el9-python-shim:$PATH
+export PYTHONPATH=${PYTHONPATH:+$PYTHONPATH:}/usr/lib64/python3.9/site-packages:/usr/lib/python3.9/site-packages
+
+%endif
\ No newline at end of file

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..2df610d
--- /dev/null
+++ b/README.md
@@ -0,0 +1,46 @@
+# About
+
+Mesa package for Fedora and CentOS.
+
+## About Packit
+
+This repository is maintained by packit:
+https://packit.dev/
+
+Packit targets different versions on mesa depending on the Fedora branch.
+
+Make sure to select "Monitoring status > Monitoring all" at:
+https://src.fedoraproject.org/rpms/mesa/
+
+## Downloading sources
+
+Some dependencies are not available in CentOS. To avoid polluting mesa.spec with
+CentOS only code, they are compiled in .inc files.
+
+To download sources and upload them to the lookaside cache run:
+
+```bash
+$ spectool -g --define "_sourcedir $(pwd)" *.spec && fedpkg new-sources *.tar*
+```
+
+CentOS 9:
+
+```bash
+$ rpmspec -P --define "_sourcedir $(pwd)" \
+  --define "rhel 9" \
+  --undefine "fedora" \
+  mesa.spec > /tmp/mesa-expanded.spec
+$ spectool -g -R --define "_sourcedir $(pwd)" /tmp/mesa-expanded.spec
+$ rm -f /tmp/mesa-expanded.spec
+```
+
+CentOS 10:
+
+```bash
+$ rpmspec -P --define "_sourcedir $(pwd)" \
+  --define "rhel 10" \
+  --undefine "fedora" \
+  mesa.spec > /tmp/mesa-expanded.spec
+$ spectool -g -R --define "_sourcedir $(pwd)" /tmp/mesa-expanded.spec
+$ rm -f /tmp/mesa-expanded.spec
+```
\ No newline at end of file

diff --git a/mesa.spec b/mesa.spec
index 6f3d61c..3eaec65 100644
--- a/mesa.spec
+++ b/mesa.spec
@@ -114,6 +114,36 @@ Source13:       https://crates.io/api/v1/crates/syn/%{rust_syn_ver}/download#/sy
 Source14:       https://crates.io/api/v1/crates/unicode-ident/%{rust_unicode_ident_ver}/download#/unicode-ident-%{rust_unicode_ident_ver}.tar.gz
 Source15:       https://crates.io/api/v1/crates/rustc-hash/%{rustc_hash_ver}/download#/rustc-hash-%{rustc_hash_ver}.tar.gz
 
+# Some dependencies are not available in CentOS, build them:
+Source100: 100-meson-source.inc
+Source101: 101-meson-prep.inc
+Source102: 102-meson-build.inc
+Source103: 103-meson-install.inc
+Source104: 104-meson-install-cleanup.inc
+Source200: 200-spirv-llvm-translator-source.inc
+Source201: 201-spirv-llvm-translator-prep.inc
+Source202: 202-spirv-llvm-translator-build.inc
+Source203: 203-spirv-llvm-translator-install-cleanup.inc
+Source300: 300-wayland-protocols-source.inc
+Source301: 301-wayland-protocols-prep.inc
+Source302: 302-wayland-protocols-build.inc
+Source303: 303-wayland-protocols-install-cleanup.inc
+Source400: 400-python3.11-source.inc
+Source401: 401-python3.11-build.inc
+
+%include %{SOURCE100}
+%include %{SOURCE200}
+%include %{SOURCE300}
+%include %{SOURCE400}
+
+%if !0%{?rhel} || 0%{?rhel} >= 10
+# Not available in CentOS 9
+%global with_libdisplay_info 1
+%global with_gles1 1
+BuildRequires:  pkgconfig(libdisplay-info)
+BuildRequires:  pkgconfig(wayland-protocols) >= 1.49
+%endif
+
 # Fix Freedreno compilation with GCC 11 (CentOS 9)
 Patch0:         0001-tu-autotune-use-unique_ptr-rp_histories_t-to-fix-GCC.patch
 
@@ -136,11 +166,9 @@ BuildRequires:  pkgconfig(expat)
 BuildRequires:  pkgconfig(zlib) >= 1.2.3
 BuildRequires:  pkgconfig(libzstd)
 BuildRequires:  pkgconfig(wayland-scanner)
-BuildRequires:  pkgconfig(wayland-protocols) >= 1.49
 BuildRequires:  pkgconfig(wayland-client) >= 1.11
 BuildRequires:  pkgconfig(wayland-server) >= 1.11
 BuildRequires:  pkgconfig(wayland-egl-backend) >= 3
-BuildRequires:  pkgconfig(libdisplay-info)
 BuildRequires:  pkgconfig(x11)
 BuildRequires:  pkgconfig(xext)
 BuildRequires:  pkgconfig(xdamage) >= 1.1
@@ -178,8 +206,11 @@ BuildRequires:  xtensor-devel
 %if 0%{?with_opencl} || 0%{?with_nvk} || 0%{?with_asahi} || 0%{?with_panfrost}
 BuildRequires:  clang-devel
 BuildRequires:  pkgconfig(SPIRV-Tools)
+%if !0%{?rhel} || 0%{?eln}
+# Dependency not available in CentOS, bundled instead
 BuildRequires:  pkgconfig(LLVMSPIRVLib)
 %endif
+%endif
 %if 0%{?with_opencl} || 0%{?with_nvk}
 BuildRequires:  bindgen
 %if 0%{?rhel}
@@ -354,6 +385,10 @@ The drivers with support for the Vulkan API.
 %autosetup -n %{name}-%{ver} -p1
 cp %{SOURCE1} docs/
 
+%include %{SOURCE101}
+%include %{SOURCE201}
+%include %{SOURCE301}
+
 # Extract Rust crates meson cache directory
 %if 0%{?vendor_nvk_crates}
 mkdir subprojects/packagecache/
@@ -396,6 +431,11 @@ _EOF
 
 
 %build
+%include %{SOURCE102}
+%include %{SOURCE202}
+%include %{SOURCE302}
+%include %{SOURCE401}
+
 # ensure standard Rust compiler flags are set
 export RUSTFLAGS="%build_rustflags"
 
@@ -450,7 +490,7 @@ rewrite_wrap_file rustc-hash
 %endif
   -Dvulkan-drivers=%{?vulkan_drivers} \
   -Dvulkan-layers=device-select \
-  -Dgles1=enabled \
+  -Dgles1=%{?with_gles1:enabled}%{!?with_gles1:disabled} \
   -Dgles2=enabled \
   -Dopengl=true \
   -Dgbm=enabled \
@@ -463,6 +503,7 @@ rewrite_wrap_file rustc-hash
   -Dshared-llvm=enabled \
   -Dvalgrind=%{?with_valgrind:enabled}%{!?with_valgrind:disabled} \
   -Dbuild-tests=false \
+  -Ddisplay-info=%{?with_libdisplay_info:enabled}%{!?with_libdisplay_info:disabled} \
 %if !0%{?with_libunwind}
   -Dlibunwind=disabled \
 %endif
@@ -486,8 +527,14 @@ rewrite_wrap_file rustc-hash
 %endif
 
 %install
+%include %{SOURCE103}
+
 %meson_install
 
+%include %{SOURCE104}
+%include %{SOURCE203}
+%include %{SOURCE303}
+
 # likewise glvnd
 rm -vf %{buildroot}%{_libdir}/libGLX_mesa.so
 rm -vf %{buildroot}%{_libdir}/libEGL_mesa.so

diff --git a/sources b/sources
index 362d123..3eadfa2 100644
--- a/sources
+++ b/sources
@@ -2,6 +2,6 @@ SHA512 (mesa-26.3.1.tar.xz) = 9d56fe98a0b3199f671363c1e3c195eaf5a7465cff6b4fddf6
 SHA512 (paste-1.0.15.tar.gz) = 5026d3ec7141ec4e2517a0b1283912d0801e9356f77b703d954b379439b8d85e3886d42fb28f7835edaeeac465582da14233564fb010c71425a59c9e1cbd46b4
 SHA512 (proc-macro2-1.0.107.tar.gz) = c109d5509624a57156e0eae22a3aec89a1a163623e8b4e376a13d872a46e4bf6855ee3cd4428c07cdf5c22f2284b6ce755f9cc7e075480e4587ce4f2d40fa903
 SHA512 (quote-1.0.47.tar.gz) = 544f4324d425ae011905e0d1b52e367d4660bc34457b2f802af94e1def1e6c4e39ffba3beeb40d75753967d15b6dccce18fea273e7f3d46b63d5c89898d19441
+SHA512 (rustc-hash-2.1.3.tar.gz) = d44c38f6775b77b5841a644c53a68c09a2f98541aafd809d385b854f385bbba86399aa4fc76bb3dfadd2cba64ec688db22bd353e1ae4de81e0f6e9d36f0cf629
 SHA512 (syn-2.0.119.tar.gz) = 4f2493e334b71c2b0c467e19915d385942c10dc4c0142dd989dcfab9809dea552c45ac3da0b0039956a961f7aca2973c0845c6978e9dfe25c03fdc52dfb1dec0
 SHA512 (unicode-ident-1.0.26.tar.gz) = 216d13c655e47dddf888fac997a6345bb7c6d1f0ab6b67ed06bfd9013a891fda8e9e8d71b763639957c15b951145ffd77243ee2056a20ed809d2cae48502c472
-SHA512 (rustc-hash-2.1.3.tar.gz) = d44c38f6775b77b5841a644c53a68c09a2f98541aafd809d385b854f385bbba86399aa4fc76bb3dfadd2cba64ec688db22bd353e1ae4de81e0f6e9d36f0cf629

                 reply	other threads:[~2026-11-23  8:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542217398.1.2581380050924301794.rpms-mesa-c790668cccef@fedoraproject.org \
    --to=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox