Initial commit on c9s

Resolves: https://issues.redhat.com/browse/RHEL-132415
This commit is contained in:
José Expósito 2026-01-09 11:41:18 +01:00
parent 933f3025bf
commit 8038fd7c8c
6 changed files with 363 additions and 0 deletions

9
.gitignore vendored
View File

@ -0,0 +1,9 @@
*.jx
*.src.rpm
.build*
/mesa-*.tar.bz2
/mesa-*.tar.xz
/meson-*.tar.gz
x86_64/
results_mesa/
mesa-*/

View File

@ -0,0 +1,47 @@
From 6e3646c81143477008e448d3b0b5c349169e4112 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Fri, 7 Nov 2025 13:14:56 +1000
Subject: [PATCH] c11/threads: fix build on fedora 44.
glibc is now including once_init in stdlib.h
https://patchwork.sourceware.org/project/glibc/patch/78061085-f04a-0c45-107b-5a8a15521083@redhat.com/#213088
Just fix up our use of it.
---
src/c11/impl/threads_posix.c | 2 +-
src/c11/threads.h | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/c11/impl/threads_posix.c b/src/c11/impl/threads_posix.c
index 3b8692482bb..4769c029bad 100644
--- a/src/c11/impl/threads_posix.c
+++ b/src/c11/impl/threads_posix.c
@@ -49,7 +49,7 @@ impl_thrd_routine(void *p)
void
call_once(once_flag *flag, void (*func)(void))
{
- pthread_once(flag, func);
+ pthread_once((pthread_once_t *)flag, func);
}
diff --git a/src/c11/threads.h b/src/c11/threads.h
index dbcb3459a9b..053636f6674 100644
--- a/src/c11/threads.h
+++ b/src/c11/threads.h
@@ -118,8 +118,11 @@ typedef pthread_cond_t cnd_t;
typedef pthread_t thrd_t;
typedef pthread_key_t tss_t;
typedef pthread_mutex_t mtx_t;
+#ifndef __once_flag_defined
+#define __once_flag_defined 1
typedef pthread_once_t once_flag;
# define ONCE_FLAG_INIT PTHREAD_ONCE_INIT
+#endif
# ifdef PTHREAD_DESTRUCTOR_ITERATIONS
# define TSS_DTOR_ITERATIONS PTHREAD_DESTRUCTOR_ITERATIONS
# else
--
2.51.1

View File

@ -0,0 +1,117 @@
Subject: RE: Question about Mesa MLAA license
From: Jorge Jimenez <iryoku@gmail.com>
Date: 01/08/2013 12:50 PM
To: Tom Callaway <tcallawa@redhat.com>
CC: "jorge@iryoku.com" <jorge@iryoku.com>
Yes to both questions.
Thanks,
Jorge
From: Tom Callaway <tcallawa@redhat.com>
Sent: January 8, 2013 6:49 PM
To: Jorge Jimenez <iryoku@gmail.com>
CC: jorge@iryoku.com
Subject: Re: Question about Mesa MLAA license
On 01/08/2013 12:39 PM, Jorge Jimenez wrote:
> Hi Tom,
>
> What we meant with that is that we made an exception for clause 2.
> Instead of clause 2, in the case of the Mesa project, you have to name
> the technique Jimenez's MLAA in the config options of Mesa. We did that
> just to allow them to solve license issues. This exception should be for
> the Mesa project, and any project using Mesa, like Fedora.
>
> We want to widespread usage of our MLAA, so we want to avoid any kind of
> license complications. Hope current one is good for Fedora, if not
> please tell, and we'll see what we can do!
Okay, a few more questions:
* If Fedora decides to simply reproduce the quoted statement:
"Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia,
Jose I. Echevarria, Fernando Navarro and Diego Gutierrez."
Specifically, if this is done as part of documentation included with
Mesa, is that sufficient to meet clause 2 even if the Mesa config option
is not set as described in your exception?
* Currently, the Mesa config option for MLAA says: "Morphological
anti-aliasing based on Jimenez\' MLAA. 0 to disable, 8 for default
quality". Is this in compliance with your exception?
Thanks again,
~tom
==
Fedora Project
Subject: RE: Question about Mesa MLAA license
From: Jorge Jimenez <iryoku@gmail.com>
Date: 01/08/2013 12:39 PM
To: "jorge@iryoku.com" <jorge@iryoku.com>, Tom Callaway <tcallawa@redhat.com>
Hi Tom,
What we meant with that is that we made an exception for clause 2.
Instead of clause 2, in the case of the Mesa project, you have to name
the technique Jimenez's MLAA in the config options of Mesa. We did that
just to allow them to solve license issues. This exception should be for
the Mesa project, and any project using Mesa, like Fedora.
We want to widespread usage of our MLAA, so we want to avoid any kind of
license complications. Hope current one is good for Fedora, if not
please tell, and we'll see what we can do!
Cheers,
Jorge
From: Tom Callaway <tcallawa@redhat.com>
Sent: January 8, 2013 6:30 PM
To: jorge@iryoku.com
Subject: Question about Mesa MLAA license
Jorge,
Thanks for all of your fantastic graphics work! I have been auditing
Fedora (a popular distribution of Linux) for license compliance and I
came across your MLAA code in Mesa.
The license says:
* 2. Redistributions in binary form must reproduce the following
statement:
*
* "Uses Jimenez's MLAA. Copyright (C) 2010 by Jorge Jimenez, Belen Masia,
* Jose I. Echevarria, Fernando Navarro and Diego Gutierrez."
*
* Only for use in the Mesa project, this point 2 is filled by naming the
* technique Jimenez's MLAA in the Mesa config options.
That wording is unclear. When you say "Only for use in the Mesa
project...", it seems like you could either be saying:
- This code may only be used as part of Mesa.
OR
- In Mesa, you can comply with clause 2 by simply selecting "Jimenez's
MLAA" in the Mesa config options.
*****
If the first item is true, then we may have to remove the MLAA code from
Fedora's copy of Mesa. However, looking at the license on your SMAA
code, I do not believe it to be the case. Please let me know either way!
Thanks in advance,
Tom Callaway
Fedora Legal
==
Fedora Project

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# mesa-compat
The mesa-compat package

185
mesa-compat.spec Normal file
View File

@ -0,0 +1,185 @@
%global origname mesa
# We've gotten a report that enabling LTO for mesa breaks some games. See
# https://bugzilla.redhat.com/show_bug.cgi?id=1862771 for details.
# Disable LTO for now
%global _lto_cflags %nil
Name: %{origname}-compat
Summary: Mesa graphics libraries - legacy compatibility libraries
%global ver 25.0.7
Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)}
Release: %autorelease
License: MIT AND BSD-3-Clause AND SGI-B-2.0
URL: http://www.mesa3d.org
Source0: https://archive.mesa3d.org/mesa-%{ver}.tar.xz
# src/gallium/auxiliary/postprocess/pp_mlaa* have an ... interestingly worded license.
# Source1 contains email correspondence clarifying the license terms.
# Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD.
Source1: Mesa-MLAA-License-Clarification-Email.txt
# meson >= 1.3.0 is required
%global meson_ver 1.7.0
Source2: https://github.com/mesonbuild/meson/releases/download/%{meson_ver}/meson-%{meson_ver}.tar.gz
# fix c11/threads builds problem on f44
Patch01: 0001-c11-threads-fix-build-on-fedora-44.patch
BuildRequires: meson
BuildRequires: gcc
BuildRequires: gcc-c++
BuildRequires: gettext
%if 0%{?with_hardware}
BuildRequires: kernel-headers
%endif
BuildRequires: pkgconfig(expat)
BuildRequires: pkgconfig(zlib) >= 1.2.3
BuildRequires: pkgconfig(libzstd)
BuildRequires: bison
BuildRequires: flex
BuildRequires: pkgconfig(libelf)
BuildRequires: llvm-devel >= 7.0.0
BuildRequires: libdrm-devel
BuildRequires: python3-devel
BuildRequires: python3-mako
BuildRequires: python3-pycparser
BuildRequires: python3-pyyaml
%description
%{summary}.
%package libxatracker
Summary: Mesa XA state tracker
Provides: libxatracker%{?_isa}
Provides: mesa-libxatracker%{?_isa}
Obsoletes: mesa-libxatracker < 25.3
%description libxatracker
%{summary}.
%package libxatracker-devel
Summary: Mesa XA state tracker development package
Requires: %{name}-libxatracker%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
Obsoletes: mesa-libxatracker-devel < 25.3
%description libxatracker-devel
%{summary}.
%package libOSMesa
Summary: Mesa offscreen rendering libraries
Provides: libOSMesa
Provides: libOSMesa%{?_isa}
# New things should not rely on this as this library is dead upstream
Provides: deprecated()
%description libOSMesa
%{summary}.
%package libOSMesa-devel
Summary: Mesa offscreen rendering development package
Requires: %{name}-libOSMesa%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
# New things should not rely on this as this library is dead upstream
Provides: deprecated()
%description libOSMesa-devel
%{summary}.
%prep
# Extract mesa
%autosetup -n %{origname}-%{ver} -p1
cp %{SOURCE1} docs/
# Extract meson
tar -xvf %{SOURCE2}
%build
# Build meson
cd meson-%{meson_ver}
%py3_build
%py3_install
%global __meson %{buildroot}%{_bindir}/meson
export PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib}
cd -
# Build mesa
%meson \
-Dplatforms= \
-Dosmesa=true \
-Dgallium-drivers=llvmpipe,svga \
-Dgallium-vdpau=disabled \
-Dgallium-va=disabled \
-Dgallium-xa=enabled \
-Dgallium-nine=false \
-Dgallium-opencl=disabled \
-Dgallium-rusticl=false \
-Dvulkan-drivers= \
-Dshared-glapi=enabled \
-Dgles1=disabled \
-Dgles2=disabled \
-Dopengl=true \
-Dgbm=disabled \
-Dglvnd=disabled \
-Dglx=disabled \
-Degl=disabled \
-Dllvm=enabled \
-Dshared-llvm=enabled \
-Dvalgrind=disabled \
-Dbuild-tests=false \
-Dmesa-clc=auto \
-Dmicrosoft-clc=disabled \
-Dxlib-lease=disabled \
-Dandroid-libbacktrace=disabled \
-Dlibunwind=disabled \
-Dlmsensors=disabled \
%ifarch %{ix86}
-Dglx-read-only-text=true \
%endif
%{nil}
%meson_build
%install
cd meson-%{meson_ver}
%py3_install
%global __meson %{buildroot}%{_bindir}/meson
export PYTHONPATH=%{buildroot}%{python3_sitelib}:%{python3_sitelib}
cd -
%meson_install
# Delete files installed by meson
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}
# trim some garbage, the mesa base package handles these
rm -rf %{buildroot}%{_datadir}/drirc.d
rm -rf %{buildroot}%{_includedir}/GL/gl*.h
rm -rf %{buildroot}%{_includedir}/KHR
%files libOSMesa
%{_libdir}/libOSMesa.so.8*
%files libOSMesa-devel
%dir %{_includedir}/GL
%{_includedir}/GL/osmesa.h
%{_libdir}/libOSMesa.so
%{_libdir}/pkgconfig/osmesa.pc
%files libxatracker
%{_libdir}/libxatracker.so.2*
%{_libdir}/libxatracker.so.2.*
%files libxatracker-devel
%{_libdir}/libxatracker.so
%{_includedir}/xa_tracker.h
%{_includedir}/xa_composite.h
%{_includedir}/xa_context.h
%{_libdir}/pkgconfig/xatracker.pc
%changelog
%autochangelog

2
sources Normal file
View File

@ -0,0 +1,2 @@
SHA512 (mesa-25.0.7.tar.xz) = 825bbd8bc5507de147488519786c0200afacf97dae621c80ead24b2c5dd55c5a442757ac8452698ae611e9344025465080795cf8f2dc4eb7ce07b5cc521b2b5c
SHA512 (meson-1.7.0.tar.gz) = a5d1f00b193ca37ae64f85c9dfc29a2661c167d82d9953b9acd1393b222b05fa5fc03ffdf00fd1ae7a2014da3a7366c35f70bf02e3204e929b74f7b00c17c840