[SOLVED] Mesa 21.0 (from git) on Mageia 7

This forum is dedicated to advanced help and support :

Ask here your questions about advanced usage of Mageia. For example you may post here all your questions about network and automated installs, complex server configurations, kernel tuning, creating your own Mageia mirrors, and all tasks likely to be touchy even for skilled users.

[SOLVED] Mesa 21.0 (from git) on Mageia 7

Postby MagicD3VIL » Dec 12th, '20, 21:07

Greetings,
I have a question/request regarding the mesa package. I would be interested in running the Cyberpunk 2077 on my Linux install which is officially supported with the new Proton 5.13-4 but currently to do that it requires having mesa 21.0 which I assume is available only from the git directly (since Mga7 has mesa-20.2.3-1 and Cauldron has mesa-20.3.0-2).

I've only managed to make a few backports for my Mageia 7 installation for example corectrl from Cauldron so I don't have much experience with packaging and I have no idea how to package it if I would (managed to) build the mesa myself. So if you are or you know someone who would be able (and willing) to build or help me build mesa 21.0 package for Mageia 7.1 it would be very appreciated. I have no idea if it might be even possible (because of some dependencies or idk).

Thanks in advance for your replies
Cheers
Last edited by MagicD3VIL on Dec 15th, '20, 03:22, edited 1 time in total.
User avatar
MagicD3VIL
 
Posts: 60
Joined: Jun 2nd, '19, 00:25
Location: Ostrava, Czech Republic

Re: Mesa 21.0 (from git) on Mageia 7

Postby doktor5000 » Dec 13th, '20, 02:39

mesa has recently been updated, and since we're approaching Mageia 8 final release, I don't think there will be another update to a new mesa release, even less as mesa 21 is not even close to being released as a stable release AFAICT.
My suggestion would be to grab the latest cauldron src.rpm and try to update it yourself. FWIW it already includes a small shell script to grab a snapshot from latest git snapshot.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16738
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mesa 21.0 (from git) on Mageia 7

Postby doktor5000 » Dec 13th, '20, 16:48

FWIW, I've tried a local build on 7.1 based on the cauldron src.rpm and it builds just fine, not that many changes were needed.
You'd need to install the cauldron src.rpm, apply those differences and download a mesa git snapshot with the mentioned script.

Code: Select all
[doktor5000@Mageia7]─[15:45:05]─[~/MGA/CAULDRON/mesa/SPECS] svn diff
Index: mesa.spec
===================================================================
--- mesa.spec   (revision 1656078)
+++ mesa.spec   (working copy)
@@ -1,13 +1,13 @@
 # https://cgit.freedesktop.org/mesa/mesa/commit/?h=13.0&id=3bb0415ab96f74183f7aa58c1a543448653ccb3e
-%define git 0
+%define git 20201213
 %define git_branch 20.3
 
 %define opengl_ver 4.6
 
 # define version, RC & release
-%define main_version           20.3.0
+%define main_version           21.0
 #define relc                   1
-%define rel                    2
+%define rel                    1
 
 %define release                        %mkrel %{?relc:0.rc%{relc}.}%{rel}
 
@@ -260,15 +260,15 @@
 
 URL:           https://www.mesa3d.org
 %if %{git}
-#Source0:      %{name}-%{git}.tar.bz2
+Source0:       %{name}-%{git}.tar.xz
 # (blino) snapshot of 13.0 branch
-Source0:       %{name}-%{git_branch}-%{git}.tar.xz
+#Source0:      %%{name}-%%{git_branch}-%%{git}.tar.xz
 %else
 Source0:       https://mesa.freedesktop.org/archive/mesa-%{main_version}%{?relc:-rc%{relc}}.tar.xz
 %endif
 Source3:       make-git-snapshot.sh
 
-Patch0: 0001-radeonsi-fix-regression-on-gpus-using-the-radeon-win.patch
+#Patch0: 0001-radeonsi-fix-regression-on-gpus-using-the-radeon-win.patch
 
 # mesa staging/20.3 branch from 1 (https://www.mesa3d.org/releasing.html#stagingbranch)
 
@@ -689,8 +689,11 @@
 #------------------------------------------------------------------------------
 
 %prep
+%if %{git}
+%autosetup -n %{name}-%{git} -p1
+%else
 %autosetup -n %{name}-%{version}%{?relc:-rc%{relc}} -p1
-
+%endif
 # remove unused docs
 rm -f docs/README.WIN32
 
@@ -700,12 +703,16 @@
 %endif
 
 %build
-%meson \
+# FIXME: platform wayland requires wayland update to 1.18
+#  -Dplatforms=x11,wayland \
+# FIXME: workaround when both cmake and clang are installed, might need meson update
+# https://gitlab.freedesktop.org/mesa/mesa/-/issues/3873
+%meson -Dmicrosoft-clc=disabled \
   -Dcpp_std=gnu++14 \
-  -Dplatforms=x11,wayland \
+  -Dplatforms=x11 \
   -Ddri3=enabled \
   -Ddri-drivers=%{?dri_drivers} \
-  -Dosmesa=gallium \
+  -Dosmesa=true \
 %if 0%{?with_hardware}
   -Dgallium-drivers=swrast,virgl,r300,nouveau%{?with_iris:,iris}%{?with_vmware:,svga}%{?with_radeonsi:,radeonsi,r600}%{?with_freedreno:,freedreno}%{?with_etnaviv:,etnaviv}%{?with_tegra:,tegra}%{?with_vc4:,vc4}%{?with_v3d:,v3d}%{?with_kmsro:,kmsro}%{?with_lima:,lima}%{?with_panfrost:,panfrost}%{?with_vulkan_hw:,zink}%{?with_openswr:,swr} \
 %else
@@ -742,7 +749,8 @@
   -Dvalgrind=%{?with_valgrind:enabled}%{!?with_valgrind:disabled} \
   -Dbuild-tests=false \
   -Dselinux=false \
-  %{nil}
+    %{nil}
+
 %meson_build
 
 # build docs
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16738
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mesa 21.0 (from git) on Mageia 7

Postby MagicD3VIL » Dec 13th, '20, 21:56

Greetings,
so I downloaded the src.rpm, unpacked it (I had the build structure from doing my previous backports), made the changes to the .spec file to match your example above, used the script to download latest git, downloaded all dependencies via "sudo dnf builddep mesa.spec" and used the "rpmbuild -ba mesa.spec" to build it.

Now I'm stuck with this build error:
Code: Select all
Processing files: mesa-common-devel-21.0-1.git20201213.1.x86_64
Processing files: mesa-debugsource-21.0-1.git20201213.1.x86_64
error: Empty %files file /home/magicd3vil/rpmbuild/BUILD/mesa-20201213/debugsourcefiles.list


RPM build errors:
    Macro expanded in comment on line 265: %{name}-%{git_branch}-%{git}.tar.xz

    Duplicate build-ids /media/SteamLinux/home/magicd3vil/rpmbuild/BUILDROOT/mesa-21.0-1.git20201213.1.x86_64/usr/lib64/libGL.so.1.2.0 and /media/SteamLinux/home/magicd3vil/rpmbuild/BUILDROOT/mesa-21.0-1.git20201213.1.x86_64/usr/lib64/mesa/libGL.so.1.2.0
    Empty %files file /home/magicd3vil/rpmbuild/BUILD/mesa-20201213/debugsourcefiles.list
magicd3vil@localhost ~/r/SPECS>
User avatar
MagicD3VIL
 
Posts: 60
Joined: Jun 2nd, '19, 00:25
Location: Ostrava, Czech Republic

Re: Mesa 21.0 (from git) on Mageia 7

Postby doktor5000 » Dec 13th, '20, 23:13

MagicD3VIL wrote:
Code: Select all
error: Empty %files file /home/magicd3vil/rpmbuild/BUILD/mesa-20201213/debugsourcefiles.list


What does your ~/.rpmmacros look like ?
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16738
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mesa 21.0 (from git) on Mageia 7

Postby MagicD3VIL » Dec 13th, '20, 23:15

It should be the default example provided on the wiki.
Code: Select all
# rpm build settings

# directory overrides
%_topdir         %(echo $HOME)/rpmbuild/
%_tmppath        %(echo $HOME)/rpmbuild/tmp

# package signature add automatically (name as assigned, for example, by GnuPG)
# packages can be signed later with `rpm --resign`
%_signature      gpg
%_gpg_name       John Doe
%_gpg_path       ~/.gnupg

# packager, distributor, and vendor override
# for vendor consider using personal name
%packager        John Doe <foo@example.com>
#%distribution    Mageia
#%vendor          Mageia.Org

# distribution name suffix override
#%distsuffix      mga

# distribution name override
#%dis             mageia
User avatar
MagicD3VIL
 
Posts: 60
Joined: Jun 2nd, '19, 00:25
Location: Ostrava, Czech Republic

Re: Mesa 21.0 (from git) on Mageia 7

Postby doktor5000 » Dec 14th, '20, 00:12

Well, here the debugsources packages are partially empty. Have a look at https://wiki.mageia.org/en/Packaging_pr ... ebug_Files
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16738
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mesa 21.0 (from git) on Mageia 7

Postby MagicD3VIL » Dec 14th, '20, 12:28

So... the build finished successfully and I've installed all of the generated rpms. However, the installation would not proceed until I removed the 32bit "libmesagl1-20.2.3-1.mga7.i586", which at first I had no idea how I got in the first place. After removing this package the new mesa and everything with it installed successfully. After that, I restarted my computer just for a good measure.

Great so now I checked the mesa version with "glxinfo | grep OpenGL" which was reported as Mesa 21.0.0-devel woohoo. Nice so now to open Steam and check how'll the Cyberpunk run... and oh my god... there is no Steam...

It seems like the 32bit package I removed earlier is (for some reason) a hard dependency of the steam package and since it's version 20.2.3-1 I won't be able to install it alongside 21.0. Well that's not frustrating at all xD

Code: Select all
The following packages can't be installed because they depend on packages
that are older than the installed ones:
libdri-drivers-20.2.3-1.mga7
libmesagl1-20.2.3-1.mga7
steam-1.0.0.61-1.mga7.nonfree
Continue installation anyway?
User avatar
MagicD3VIL
 
Posts: 60
Joined: Jun 2nd, '19, 00:25
Location: Ostrava, Czech Republic

Re: Mesa 21.0 (from git) on Mageia 7

Postby doktor5000 » Dec 14th, '20, 16:57

Well, you might need to also rebuild for i586, but for that you would need iurt (cf https://wiki.mageia.org/en/Packagers_Me ... Howto#iurt ) or some other chroot.
But you'd only need that for i586 software (e.g. steam).
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16738
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mesa 21.0 (from git) on Mageia 7

Postby MagicD3VIL » Dec 14th, '20, 17:24

Oh, I hoped that I could just do "rpmbuild --target=i586 -ba mesa.spec" but it's not easy like that apparently xD

Code: Select all
Project name: mesa
Project version: 21.0.0-devel
Appending CFLAGS from environment: '-O2 -g -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fomit-frame-pointer -march=i586 -mtune=generic -fasynchronous-unwind-tables'
Appending LDFLAGS from environment: ['-Wl,--as-needed', '-Wl,--no-undefined', '-Wl,-z,relro', '-Wl,-O1', '-Wl,--build-id', '-Wl,--enable-new-dtags']

meson.build:21:0: ERROR: Compiler cc can not compile programs.
Attachments
meson-log.txt
(2.73 KiB) Downloaded 27 times
User avatar
MagicD3VIL
 
Posts: 60
Joined: Jun 2nd, '19, 00:25
Location: Ostrava, Czech Republic

Re: Mesa 21.0 (from git) on Mageia 7

Postby doktor5000 » Dec 14th, '20, 17:32

No, you cannot cross-compile like that.
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16738
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mesa 21.0 (from git) on Mageia 7

Postby MagicD3VIL » Dec 14th, '20, 17:40

I'm wondering if it wouldn't be better to rebuild the Steam client from the backport to use mesa 21.0 from the start.

EDIT: Tried that and the Steam won't run using the 64bit libraries because it's forced to use 32bit ones. There is also an error message made directly for this. Worth a try tho. I guess back to making 32bit Mesa libs :D

EDIT 2: I really have no clue how to do it using the iurt you suggested so I guess I'm just gonna build it in the Virtualbox 32bit Mageia :p
User avatar
MagicD3VIL
 
Posts: 60
Joined: Jun 2nd, '19, 00:25
Location: Ostrava, Czech Republic

Re: Mesa 21.0 (from git) on Mageia 7

Postby doktor5000 » Dec 14th, '20, 20:49

You basically just install iurt, and use one of the commands to rebuild from your src.rpm into a i586 package.
Check https://wiki.mageia.org/en/Packagers_Me ... Howto#iurt

One of the examples is this:

Cross compiling from x86_64 to i586:

Code: Select all
linux32 iurt  --repository http://ftp-stud.hs-esslingen.de/pub/Mirrors/Mageia/distrib/ \
  --chrooted-urpmi http://ftp-stud.hs-esslingen.de/pub/Mirrors/Mageia/distrib/ \
  --rebuild cauldron i586 ./SRPMS/abiword-2.8.6-1.mga1.src.rpm
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 16738
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

Re: Mesa 21.0 (from git) on Mageia 7

Postby MagicD3VIL » Dec 15th, '20, 03:22

Greetings,
I've already had the 32bit Mageia 7.1 installed on my VMware from some weeks ago (I was showcasing the distro in my Unix class assignment) so I've just used that to build 32bit Mesa 21.0. After that, I installed the "libdri-drivers-21.0-1.git20201213.1.i586.rpm" and "libmesagl1-21.0-1.git20201213.1.i586.rpm" to satisfy and install (back) Steam.

Everything is working as it should and the performance is indistinguishable from Windows running the game on my setup (also it was astonishing to have working Proton with CP2077 on day 1). Thanks again for the help, Dok! Marking as solved. o7
User avatar
MagicD3VIL
 
Posts: 60
Joined: Jun 2nd, '19, 00:25
Location: Ostrava, Czech Republic


Return to Advanced support

Who is online

Users browsing this forum: paulcbrennan2001 and 1 guest