Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
Date: Sun, 27 Oct 2019 12:51:38 +0100	[thread overview]
Message-ID: <20191027115138.qdtQ8YwzgYWe-7PQHIZw26HGU5SUkeF6qlBQiQHHgeY@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-15683@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1175 bytes --]

There is an updated pull request by st3r4g against master on the void-packages repository

https://github.com/st3r4g/void-packages mesa-fix-dbg
https://github.com/void-linux/void-packages/pull/15683

[RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
Aims to fix #12760 and #15104
I believe that two things must be addressed in order to fix the issue:

~~1. xbps-src must be aware of hard links when stripping debug symbols.~~ (EDIT: see third comment)
2. `libGL` must be reorganized by creating a subpackage for each "megadriver" that creates hard links (hard links to the same megadriver must be together in the same subpackage).

This is currently just a first step, I moved all the hard links to `libmesa_dri_drivers.so` to a new subpackage `mesa-dri` as a first example. Next would be to create a new subpackage for the aliases to `libgallium_dri.so` and so on, while also removing the current separation by vendors. The final result is going to be a pretty big change in the template structure, so let me know whether it's a good idea or not before I go on.


A patch file from https://github.com/void-linux/void-packages/pull/15683.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mesa-fix-dbg-15683.patch --]
[-- Type: text/x-diff, Size: 11332 bytes --]

From cde16f19ddd96c2798a38252da60082f341e5134 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Wed, 23 Oct 2019 17:18:43 +0200
Subject: [PATCH] libGL: reorganize dri subpackages by megadrivers instead of
 vendors

Mesa dri drivers for different vendors are actually hard links to
the same file, called a `megadriver`, so they are better grouped
in the same subpackage. This solves issues when stripping debug info.
---
 .../libGL/patches/no-unlink-megadrivers.patch |  15 ++
 srcpkgs/libGL/template                        | 150 ++++++++++++------
 srcpkgs/mesa-XvMC                             |   1 +
 srcpkgs/mesa-dri-classic                      |   1 +
 srcpkgs/mesa-dri-gallium                      |   1 +
 srcpkgs/mesa-vdpau                            |   1 +
 srcpkgs/mesa-vulkan-intel                     |   1 +
 srcpkgs/mesa-vulkan-radeon                    |   1 +
 8 files changed, 122 insertions(+), 49 deletions(-)
 create mode 100644 srcpkgs/libGL/patches/no-unlink-megadrivers.patch
 create mode 120000 srcpkgs/mesa-XvMC
 create mode 120000 srcpkgs/mesa-dri-classic
 create mode 120000 srcpkgs/mesa-dri-gallium
 create mode 120000 srcpkgs/mesa-vdpau
 create mode 120000 srcpkgs/mesa-vulkan-intel
 create mode 120000 srcpkgs/mesa-vulkan-radeon

diff --git a/srcpkgs/libGL/patches/no-unlink-megadrivers.patch b/srcpkgs/libGL/patches/no-unlink-megadrivers.patch
new file mode 100644
index 00000000000..3f904abe802
--- /dev/null
+++ b/srcpkgs/libGL/patches/no-unlink-megadrivers.patch
@@ -0,0 +1,15 @@
+This patch is needed to retain the master .so, so that only that filename is
+stripped while the related hard links are excluded.
+diff --git bin/install_megadrivers.py bin/install_megadrivers.py
+index 470137e..7d56def 100644
+--- bin/install_megadrivers.py
++++ bin/install_megadrivers.py
+@@ -71,7 +71,7 @@ def main():
+             os.chdir(ret)
+ 
+     # Remove meson-created master .so and symlinks
+-    os.unlink(master)
++    #os.unlink(master)
+     name, ext = os.path.splitext(master)
+     while ext != '.so':
+         if os.path.lexists(name):
diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index ac9dadd2f43..8265d781822 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.2
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -16,6 +16,7 @@ makedepends="elfutils-devel expat-devel libXdamage-devel libXvMC-devel
  libvdpau-devel libxshmfence-devel ncurses-devel talloc-devel zlib-devel
  $(vopt_if wayland 'wayland-devel wayland-protocols') llvm
  libsensors-devel libXrandr-devel"
+depends="mesa-dri-gallium>=${version}_${revision}"
 short_desc="Graphics library similar to SGI's OpenGL"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="MIT, LGPL-2.1-or-later"
@@ -40,8 +41,11 @@ i686*|x86_64*)
 	configure_args+=" -Dgallium-opencl=icd"
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" libxatracker mesa-ati-dri mesa-intel-dri mesa-nouveau-dri"
-	subpackages+=" mesa-vmwgfx-dri mesa-opencl"
+	depends+=" mesa-dri-classic>=${version}_${revision}"
+	subpackages+=" libxatracker mesa-dri-classic mesa-dri-gallium mesa-vdpau"
+	subpackages+=" mesa-XvMC mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
+	# Transitional dummy packages
+	subpackages+=" mesa-ati-dri mesa-intel-dri mesa-nouveau-dri mesa-vmwgfx-dri"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,13 +60,18 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
+	depends+=" mesa-dri-classic>=${version}_${revision}"
+	subpackages+=" mesa-dri-classic mesa-dri-gallium mesa-vdpau mesa-XvMC"
+	subpackages+=" mesa-vulkan-radeon mesa-opencl"
+	# Transitional dummy packages
 	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
 	;;
 aarch64*)
 	configure_args+=" -Dgallium-drivers=nouveau,tegra,swrast,vc4"
 	configure_args+=" -Dvulkan-drivers= -Ddri-drivers="
 	configure_args+=" -Dgallium-xa=false -Ddri3=true"
+	subpackages+=" mesa-dri-gallium mesa-vdpau mesa-XvMC"
+	# Transitional dummy packages
 	subpackages+=" mesa-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
 	;;
 armv7l*)
@@ -70,6 +79,8 @@ armv7l*)
 	configure_args+=" -Dgallium-drivers=swrast,vc4"
 	configure_args+=" -Dvulkan-drivers= -Ddri-drivers= -Dgallium-xvmc=false"
 	configure_args+=" -Dgallium-xa=false -Dgallium-vdpau=false -Dgallium-va=false"
+	subpackages+=" mesa-dri-gallium"
+	# Transitional dummy packages
 	subpackages+=" mesa-vc4-dri"
 	;;
 *)
@@ -78,6 +89,7 @@ armv7l*)
 	configure_args+=" -Ddri-drivers= -Dvulkan-drivers= -Dgallium-va=false"
 	configure_args+=" -Dgallium-vdpau=false -Dgallium-xvmc=false"
 	configure_args+=" -Dgallium-xa=false"
+	subpackages+=" mesa-dri-gallium"
 	;;
 esac
 
@@ -106,6 +118,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# Broken symlink when xorg-server isn't installed
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,75 +188,114 @@ libxatracker_package() {
 	}
 }
 
-mesa-ati-dri_package() {
-	short_desc="Mesa DRI drivers for ATI GPUs"
-	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
+mesa-opencl_package() {
+	short_desc="Mesa implementation of OpenCL (r600+ only)"
+	depends="libclc libOpenCL"
 	pkg_install() {
-		vmove "usr/lib/libXvMCr[36]00.so.*"
-		vmove "usr/lib/vdpau/libvdpau_r[36]00.so*"
-		vmove "usr/lib/vdpau/libvdpau_radeon*.so*"
-		vmove "usr/lib/xorg/modules/drivers/radeon*"
-		vmove "usr/lib/xorg/modules/drivers/r[236]00*"
-		vmove usr/lib/dri/r*
-		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
-		vmove "usr/lib/libvulkan_radeon.so"
-		vmove "usr/lib/gallium-pipe/pipe_r[36]00.so"
-		vmove usr/lib/gallium-pipe/pipe_radeonsi.so
+		vmove etc/OpenCL
+		vmove "usr/lib/libMesaOpenCL.so.*"
 	}
 }
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-dri-classic_package() {
+	short_desc="Mesa classic DRI drivers"
+	nostrip_files="i915_dri.so i965_dri.so nouveau_vieux_dri.so r200_dri.so
+	 radeon_dri.so"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/i9[16]5_dri.*"
-		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
-		vmove "usr/lib/libvulkan_intel.so"
+		for f in $nostrip_files; do
+			if [ -f "$DESTDIR/usr/lib/xorg/modules/drivers/$f" ]; then
+				vmove "usr/lib/xorg/modules/drivers/$f";
+			fi
+		done
+		vmove "usr/lib/xorg/modules/drivers/libmesa_dri_drivers.so"
 	}
 }
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
+mesa-dri-gallium_package() {
+	short_desc="Mesa Gallium DRI drivers"
+	nostrip_files="radeonsi_dri.so nouveau_dri.so swrast_dri.so
+	 kms_swrast_dri.so r300_dri.so r600_dri.so tegra_dri.so vmwgfx_dri.so
+	  vc4_dri.so virtio_gpu_dri.so"
+	nostrip_files+=" nouveau_drv_video.so r600_drv_video.so
+	 radeonsi_drv_video.so"
 	pkg_install() {
-		vmove "usr/lib/libXvMCnouveau.so.*"
-		vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
-		vmove "usr/lib/xorg/modules/drivers/nouveau*"
-		vmove "usr/lib/dri/nouveau*"
-		case "$XBPS_TARGET_MACHINE" in
-			aarch64*) ;;
-			*) vmove usr/lib/gallium-pipe/pipe_nouveau.so ;;
-		esac
+		for f in $nostrip_files; do
+			if [ -f "$DESTDIR/usr/lib/xorg/modules/drivers/$f" ]; then
+				vmove "usr/lib/xorg/modules/drivers/$f";
+			fi
+			# break when $f = virtio_gpu_dri.so or maybe leave as it is
+		done
+		if [ -d "$DESTDIR/usr/lib/dri" ]; then
+			vmove "usr/lib/dri/*_drv_video.so"
+		fi
+		if [ -d "$DESTDIR/usr/lib/gallium-pipe" ]; then
+			vmove "usr/lib/gallium-pipe/pipe_*.so"
+		fi
+		vmove "usr/lib/xorg/modules/drivers/libgallium_dri.so"
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+mesa-vdpau_package() {
+	short_desc="Mesa Gallium VDPAU"
+	nostrip_files="libvdpau_r300.so.1.0.0 libvdpau_r600.so.1.0.0
+	 libvdpau_radeonsi.so.1.0.0 libvdpau_nouveau.so.1.0.0"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/lib/vdpau/libvdpau_*"
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+mesa-XvMC_package() {
+	short_desc="Mesa Gallium XvMC"
+	nostrip_files="libXvMCnouveau.so.1.0.0 libXvMCr600.so.1.0.0"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vc4*"
+		vmove "usr/lib/libXvMC*"
 	}
 }
 
-mesa-opencl_package() {
-	short_desc="Mesa implementation of OpenCL (r600+ only)"
-	depends="libclc libOpenCL"
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
 	pkg_install() {
-		vmove etc/OpenCL
-		vmove "usr/lib/libMesaOpenCL*"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
-mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+mesa-vulkan-radeon_package() {
+	short_desc="Mesa Radeon Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/tegra*"
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
 	}
 }
+
+mesa-ati-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for ATI GPUs (transitional dummy package)"
+}
+
+mesa-intel-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Intel GPUs (transitional dummy package)"
+}
+
+mesa-nouveau-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for NVIDIA GPUs (transitional dummy package)"
+}
+
+mesa-vmwgfx-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for VMware (transitional dummy package)"
+}
+
+mesa-vc4-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Videocore IV GPU (transitional dummy package)"
+}
+
+mesa-tegra-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Tegra GPU (transitional dummy package)"
+}
diff --git a/srcpkgs/mesa-XvMC b/srcpkgs/mesa-XvMC
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-XvMC
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-dri-classic b/srcpkgs/mesa-dri-classic
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-dri-classic
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-dri-gallium b/srcpkgs/mesa-dri-gallium
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-dri-gallium
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-vdpau b/srcpkgs/mesa-vdpau
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-vdpau
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-vulkan-intel b/srcpkgs/mesa-vulkan-intel
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-vulkan-intel
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-vulkan-radeon b/srcpkgs/mesa-vulkan-radeon
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-vulkan-radeon
@@ -0,0 +1 @@
+libGL
\ No newline at end of file

  parent reply	other threads:[~2019-10-27 11:51 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
2019-10-22  9:20 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-22  9:20 ` voidlinux-github
2019-10-22  9:30 ` voidlinux-github
2019-10-22  9:30 ` voidlinux-github
2019-10-22 10:15 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-22 10:15 ` voidlinux-github
2019-10-22 15:17 ` voidlinux-github
2019-10-22 15:17 ` voidlinux-github
2019-10-22 22:30 ` voidlinux-github
2019-10-22 22:30 ` voidlinux-github
2019-10-22 23:32 ` voidlinux-github
2019-10-22 23:34 ` voidlinux-github
2019-10-22 23:39 ` voidlinux-github
2019-10-23 11:39 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-23 11:39 ` voidlinux-github
2019-10-23 11:47 ` [WIP] " voidlinux-github
2019-10-23 11:48 ` voidlinux-github
2019-10-23 11:49 ` voidlinux-github
2019-10-23 11:55 ` voidlinux-github
2019-10-23 11:57 ` voidlinux-github
2019-10-23 15:19 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-23 15:19 ` voidlinux-github
2019-10-23 15:26 ` voidlinux-github
2019-10-24 12:41 ` voidlinux-github
2019-10-24 12:41 ` voidlinux-github
2019-10-24 13:47 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-24 13:47 ` voidlinux-github
2019-10-24 13:47 ` voidlinux-github
2019-10-26 12:56 ` [PR PATCH] [Updated] [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info) voidlinux-github
2019-10-26 12:56 ` voidlinux-github
2019-10-26 13:01 ` voidlinux-github
2019-10-26 13:01 ` voidlinux-github
2019-10-26 13:03 ` voidlinux-github
2019-10-26 13:16 ` voidlinux-github
2019-10-26 13:17 ` voidlinux-github
2019-10-26 13:18 ` voidlinux-github
2019-10-27  6:17 ` voidlinux-github
2019-10-27 10:55 ` voidlinux-github
2019-10-27 10:58 ` voidlinux-github
2019-10-27 10:58 ` voidlinux-github
2019-10-27 11:00 ` voidlinux-github
2019-10-27 11:04 ` voidlinux-github
2019-10-27 11:07 ` voidlinux-github
2019-10-27 11:10 ` voidlinux-github
2019-10-27 11:23 ` voidlinux-github
2019-10-27 11:24 ` voidlinux-github
2019-10-27 11:34 ` voidlinux-github
2019-10-27 11:36 ` voidlinux-github
2019-10-27 11:51 ` voidlinux-github [this message]
2019-10-27 11:51 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-27 12:00 ` voidlinux-github
2019-10-27 15:24 ` voidlinux-github
2019-11-02 10:14 ` voidlinux-github
2019-11-02 12:55 ` voidlinux-github
2019-11-10 10:15 ` voidlinux-github
2019-11-10 10:17 ` voidlinux-github
2019-11-10 10:36 ` voidlinux-github
2019-11-11 20:13 ` [PR PATCH] [Updated] " voidlinux-github
2019-11-11 20:19 ` voidlinux-github
2019-11-11 20:20 ` voidlinux-github
2019-11-11 20:21 ` voidlinux-github
2019-12-25  7:40 ` [RFC] mesa: " voidlinux-github
2019-12-25  7:41 ` voidlinux-github
2019-12-25 15:48 ` voidlinux-github
2019-12-25 19:05 ` [PR PATCH] [Closed]: " voidlinux-github
2019-12-27 17:03 ` voidlinux-github
2019-12-27 17:06 ` voidlinux-github
2019-12-27 17:06 ` voidlinux-github
2019-12-27 17:09 ` voidlinux-github
2019-12-27 17:53 ` voidlinux-github
2019-12-27 18:42 ` voidlinux-github
2019-12-27 18:42 ` voidlinux-github

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=20191027115138.qdtQ8YwzgYWe-7PQHIZw26HGU5SUkeF6qlBQiQHHgeY@z \
    --to=voidlinux-github@inbox.vuxu.org \
    --cc=ml@inbox.vuxu.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;
as well as URLs for NNTP newsgroup(s).