Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
@ 2019-10-21 23:34 voidlinux-github
  2019-10-22  9:20 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (71 more replies)
  0 siblings, 72 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-21 23:34 UTC (permalink / raw)
  To: ml

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

There is a new 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
Aims to fix #12760 and #15104
I believe that two things must be changed in order to fix the issue:

1. `xbps-src` must be aware of hard links when stripping debug symbols.
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. 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: 3725 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From d2b44c0dfe42a436c1c9117f204cf4cdac0c6f4a Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

[ci skip]
Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template | 18 ++++++++++++------
 srcpkgs/mesa-dri       |  1 +
 2 files changed, 13 insertions(+), 6 deletions(-)
 create mode 120000 srcpkgs/mesa-dri

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..cee770fef0a 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -90,7 +90,7 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 
 # -devel must be the last one for proper order.
-subpackages+=" MesaLib-devel"
+subpackages+=" mesa-dri MesaLib-devel"
 
 case "$XBPS_TARGET_MACHINE" in
 	i686) configure_args+=" -Ddri-drivers-path=/usr/lib32/xorg/modules/drivers";;
@@ -175,6 +175,16 @@ libxatracker_package() {
 	}
 }
 
+mesa-dri_package() {
+	short_desc="Mesa DRI drivers"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
+	}
+}
+
 mesa-ati-dri_package() {
 	short_desc="Mesa DRI drivers for ATI GPUs"
 	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
@@ -182,8 +192,6 @@ mesa-ati-dri_package() {
 		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"
@@ -196,7 +204,6 @@ mesa-intel-dri_package() {
 	short_desc="Mesa DRI drivers for Intel GPUs"
 	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
 	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"
 	}
@@ -207,7 +214,6 @@ mesa-nouveau-dri_package() {
 	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*) ;;
diff --git a/srcpkgs/mesa-dri b/srcpkgs/mesa-dri
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-dri
@@ -0,0 +1 @@
+libGL
\ No newline at end of file

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  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
                   ` (69 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22  9:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 8355 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From 7bdeacd93fe66bdd3ce6e34208ecdb4803460d3b Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template                        | 86 +++++++++++--------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |  0
 srcpkgs/{mesa-intel-dri => mesa-gallium-dri}  |  0
 .../{mesa-nouveau-dri => mesa-vulkan-intel}   |  0
 .../{mesa-vmwgfx-dri => mesa-vulkan-radeon}   |  0
 5 files changed, 48 insertions(+), 38 deletions(-)
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-vulkan-intel} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-vulkan-radeon} (100%)

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..dd35150c3c4 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -33,6 +33,7 @@ subpackages="libglapi libgbm libEGL libGLES libOSMesa"
 case "$XBPS_TARGET_MACHINE" in
 i686*|x86_64*)
 	# Enable all x86 drivers.
+	# TODO: Why not the gallium version of i915?
 	configure_args+=" -Dgallium-drivers=r300,r600,radeonsi,svga,swrast,nouveau,virgl"
 	configure_args+=" -Ddri-drivers=i915,i965,r100,r200,nouveau"
 	configure_args+=" -Dgallium-xa=true -Ddri3=true -Dgallium-nine=true"
@@ -40,8 +41,8 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,21 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
+	subpackages+=" mesa-dri mesa-gallium-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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-tegra-dri mesa-ati-dri mesa-gallium-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +79,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +108,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+#	TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +178,59 @@ 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-dri_package() {
+	short_desc="Mesa DRI drivers for i915/i965/nouveau/r200/radeon"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
+	}
+}
+
+mesa-gallium-dri_package() {
+	short_desc="Mesa Gallium DRI drivers for r300/r600/radeonsi(...)"
 	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
-	}
-}
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
-	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"
-	}
-}
-
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
-	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
+
+		vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
+		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+
+# TODO: brace expansion doesn't work?
+		vmove "usr/lib/xorg/modules/drivers/swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/kms_swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+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/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vc4*"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -240,9 +243,16 @@ mesa-opencl_package() {
 	}
 }
 
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
+	}
+}
+
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-vulkan-intel
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-vulkan-intel
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-vulkan-radeon
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-vulkan-radeon

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  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 ` voidlinux-github
  2019-10-22  9:20 ` voidlinux-github
                   ` (70 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22  9:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 8355 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From 7bdeacd93fe66bdd3ce6e34208ecdb4803460d3b Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template                        | 86 +++++++++++--------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |  0
 srcpkgs/{mesa-intel-dri => mesa-gallium-dri}  |  0
 .../{mesa-nouveau-dri => mesa-vulkan-intel}   |  0
 .../{mesa-vmwgfx-dri => mesa-vulkan-radeon}   |  0
 5 files changed, 48 insertions(+), 38 deletions(-)
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-vulkan-intel} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-vulkan-radeon} (100%)

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..dd35150c3c4 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -33,6 +33,7 @@ subpackages="libglapi libgbm libEGL libGLES libOSMesa"
 case "$XBPS_TARGET_MACHINE" in
 i686*|x86_64*)
 	# Enable all x86 drivers.
+	# TODO: Why not the gallium version of i915?
 	configure_args+=" -Dgallium-drivers=r300,r600,radeonsi,svga,swrast,nouveau,virgl"
 	configure_args+=" -Ddri-drivers=i915,i965,r100,r200,nouveau"
 	configure_args+=" -Dgallium-xa=true -Ddri3=true -Dgallium-nine=true"
@@ -40,8 +41,8 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,21 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
+	subpackages+=" mesa-dri mesa-gallium-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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-tegra-dri mesa-ati-dri mesa-gallium-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +79,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +108,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+#	TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +178,59 @@ 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-dri_package() {
+	short_desc="Mesa DRI drivers for i915/i965/nouveau/r200/radeon"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
+	}
+}
+
+mesa-gallium-dri_package() {
+	short_desc="Mesa Gallium DRI drivers for r300/r600/radeonsi(...)"
 	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
-	}
-}
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
-	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"
-	}
-}
-
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
-	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
+
+		vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
+		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+
+# TODO: brace expansion doesn't work?
+		vmove "usr/lib/xorg/modules/drivers/swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/kms_swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+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/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vc4*"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -240,9 +243,16 @@ mesa-opencl_package() {
 	}
 }
 
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
+	}
+}
+
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-vulkan-intel
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-vulkan-intel
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-vulkan-radeon
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-vulkan-radeon

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  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
                   ` (68 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22  9:30 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-544879454

Comment:
Finished to reorganize subpackages.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (2 preceding siblings ...)
  2019-10-22  9:30 ` voidlinux-github
@ 2019-10-22  9:30 ` voidlinux-github
  2019-10-22 10:15 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (67 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22  9:30 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-544879454

Comment:
Finished to reorganize subpackages, but still WIP.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (3 preceding siblings ...)
  2019-10-22  9:30 ` voidlinux-github
@ 2019-10-22 10:15 ` voidlinux-github
  2019-10-22 10:15 ` voidlinux-github
                   ` (66 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 10:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 9098 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From eb1262c319c4f5b42fe660ad797b288478694b84 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template                        | 107 +++++++++++-------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |   0
 srcpkgs/{mesa-intel-dri => mesa-gallium-dri}  |   0
 .../{mesa-nouveau-dri => mesa-vulkan-intel}   |   0
 .../{mesa-vmwgfx-dri => mesa-vulkan-radeon}   |   0
 5 files changed, 64 insertions(+), 43 deletions(-)
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-vulkan-intel} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-vulkan-radeon} (100%)

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..ee6925e1ae6 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -33,6 +33,7 @@ subpackages="libglapi libgbm libEGL libGLES libOSMesa"
 case "$XBPS_TARGET_MACHINE" in
 i686*|x86_64*)
 	# Enable all x86 drivers.
+	# TODO: Why not the gallium version of i915?
 	configure_args+=" -Dgallium-drivers=r300,r600,radeonsi,svga,swrast,nouveau,virgl"
 	configure_args+=" -Ddri-drivers=i915,i965,r100,r200,nouveau"
 	configure_args+=" -Dgallium-xa=true -Ddri3=true -Dgallium-nine=true"
@@ -40,8 +41,8 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,21 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-tegra-dri mesa-dri mesa-gallium-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +79,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +108,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+#	TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +178,70 @@ 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-dri_package() {
+	short_desc="Mesa DRI drivers for i915/i965/nouveau/r200/radeon"
 	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 "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
 	}
 }
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-gallium-dri_package() {
+	short_desc="Mesa Gallium DRI drivers for r300/r600/radeonsi(...)"
 	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"
-	}
-}
+		case "$XBPS_TARGET_MACHINE" in
+		armv7l*) ;;
+		*)
+			vmove "usr/lib/libXvMCr[36]00.so.*"
+			vmove "usr/lib/libXvMCnouveau.so.*"
+			vmove "usr/lib/vdpau/libvdpau_r[36]00.so*"
+			vmove "usr/lib/vdpau/libvdpau_radeon*.so*"
+			vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
+			;;
+		esac
+		vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r[36]00*"
+		vmove usr/lib/dri/r*
+		vmove "usr/lib/gallium-pipe/pipe_r[36]00.so"
+		vmove usr/lib/gallium-pipe/pipe_radeonsi.so
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
-	pkg_install() {
-		vmove "usr/lib/libXvMCnouveau.so.*"
-		vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
-		vmove "usr/lib/xorg/modules/drivers/nouveau*"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
 		vmove "usr/lib/dri/nouveau*"
 		case "$XBPS_TARGET_MACHINE" in
 			aarch64*) ;;
 			*) vmove usr/lib/gallium-pipe/pipe_nouveau.so ;;
 		esac
+
+		vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
+		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+
+		vmove usr/lib/gallium-pipe/pipe_swrast.so
+# TODO: maybe we can simplify and just move /usr/lib/gallium-pipe
+
+# TODO: brace expansion doesn't work?
+		vmove "usr/lib/xorg/modules/drivers/swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/kms_swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+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/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vc4*"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -240,9 +254,16 @@ mesa-opencl_package() {
 	}
 }
 
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
+	}
+}
+
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-vulkan-intel
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-vulkan-intel
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-vulkan-radeon
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-vulkan-radeon

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (4 preceding siblings ...)
  2019-10-22 10:15 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-10-22 10:15 ` voidlinux-github
  2019-10-22 15:17 ` voidlinux-github
                   ` (65 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 10:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 9098 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From eb1262c319c4f5b42fe660ad797b288478694b84 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template                        | 107 +++++++++++-------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |   0
 srcpkgs/{mesa-intel-dri => mesa-gallium-dri}  |   0
 .../{mesa-nouveau-dri => mesa-vulkan-intel}   |   0
 .../{mesa-vmwgfx-dri => mesa-vulkan-radeon}   |   0
 5 files changed, 64 insertions(+), 43 deletions(-)
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-vulkan-intel} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-vulkan-radeon} (100%)

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..ee6925e1ae6 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -33,6 +33,7 @@ subpackages="libglapi libgbm libEGL libGLES libOSMesa"
 case "$XBPS_TARGET_MACHINE" in
 i686*|x86_64*)
 	# Enable all x86 drivers.
+	# TODO: Why not the gallium version of i915?
 	configure_args+=" -Dgallium-drivers=r300,r600,radeonsi,svga,swrast,nouveau,virgl"
 	configure_args+=" -Ddri-drivers=i915,i965,r100,r200,nouveau"
 	configure_args+=" -Dgallium-xa=true -Ddri3=true -Dgallium-nine=true"
@@ -40,8 +41,8 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,21 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-tegra-dri mesa-dri mesa-gallium-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +79,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +108,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+#	TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +178,70 @@ 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-dri_package() {
+	short_desc="Mesa DRI drivers for i915/i965/nouveau/r200/radeon"
 	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 "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
 	}
 }
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-gallium-dri_package() {
+	short_desc="Mesa Gallium DRI drivers for r300/r600/radeonsi(...)"
 	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"
-	}
-}
+		case "$XBPS_TARGET_MACHINE" in
+		armv7l*) ;;
+		*)
+			vmove "usr/lib/libXvMCr[36]00.so.*"
+			vmove "usr/lib/libXvMCnouveau.so.*"
+			vmove "usr/lib/vdpau/libvdpau_r[36]00.so*"
+			vmove "usr/lib/vdpau/libvdpau_radeon*.so*"
+			vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
+			;;
+		esac
+		vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r[36]00*"
+		vmove usr/lib/dri/r*
+		vmove "usr/lib/gallium-pipe/pipe_r[36]00.so"
+		vmove usr/lib/gallium-pipe/pipe_radeonsi.so
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
-	pkg_install() {
-		vmove "usr/lib/libXvMCnouveau.so.*"
-		vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
-		vmove "usr/lib/xorg/modules/drivers/nouveau*"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
 		vmove "usr/lib/dri/nouveau*"
 		case "$XBPS_TARGET_MACHINE" in
 			aarch64*) ;;
 			*) vmove usr/lib/gallium-pipe/pipe_nouveau.so ;;
 		esac
+
+		vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
+		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+
+		vmove usr/lib/gallium-pipe/pipe_swrast.so
+# TODO: maybe we can simplify and just move /usr/lib/gallium-pipe
+
+# TODO: brace expansion doesn't work?
+		vmove "usr/lib/xorg/modules/drivers/swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/kms_swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+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/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vc4*"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -240,9 +254,16 @@ mesa-opencl_package() {
 	}
 }
 
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
+	}
+}
+
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-vulkan-intel
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-vulkan-intel
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-vulkan-radeon
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-vulkan-radeon

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (6 preceding siblings ...)
  2019-10-22 15:17 ` voidlinux-github
@ 2019-10-22 15:17 ` voidlinux-github
  2019-10-22 22:30 ` voidlinux-github
                   ` (63 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 15:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 9087 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From 23c44f0afc6da0730ecbbae4605e39f893909a82 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template                        | 110 ++++++++++--------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |   0
 srcpkgs/{mesa-intel-dri => mesa-gallium-dri}  |   0
 .../{mesa-nouveau-dri => mesa-vulkan-intel}   |   0
 .../{mesa-vmwgfx-dri => mesa-vulkan-radeon}   |   0
 5 files changed, 63 insertions(+), 47 deletions(-)
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-vulkan-intel} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-vulkan-radeon} (100%)

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..55581de5dd1 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -33,6 +33,7 @@ subpackages="libglapi libgbm libEGL libGLES libOSMesa"
 case "$XBPS_TARGET_MACHINE" in
 i686*|x86_64*)
 	# Enable all x86 drivers.
+# TODO: Why not the gallium version of i915?
 	configure_args+=" -Dgallium-drivers=r300,r600,radeonsi,svga,swrast,nouveau,virgl"
 	configure_args+=" -Ddri-drivers=i915,i965,r100,r200,nouveau"
 	configure_args+=" -Dgallium-xa=true -Ddri3=true -Dgallium-nine=true"
@@ -40,8 +41,8 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,21 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-tegra-dri mesa-gallium-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +79,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +108,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +178,65 @@ libxatracker_package() {
 	}
 }
 
-mesa-ati-dri_package() {
-	short_desc="Mesa DRI drivers for ATI GPUs"
-	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
-	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
-	}
-}
-
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-dri_package() {
+	short_desc="Mesa classic DRI drivers"
 	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"
+		vmove "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
 	}
 }
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
+mesa-gallium-dri_package() {
+	short_desc="Mesa Gallium DRI drivers"
 	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 ;;
+		i686*|x86_64*)
+# TODO: XvMCr and vdpau probably belong to another subpackage
+			vmove "usr/lib/libXvMCr[36]00.so.*"
+			vmove "usr/lib/libXvMCnouveau.so.*"
+			vmove "usr/lib/vdpau/libvdpau_r[36]00.so*"
+			vmove "usr/lib/vdpau/libvdpau_radeon*.so*"
+			vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
+			vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/r[36]00*"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
+			vmove usr/lib/dri/r*
+			vmove "usr/lib/dri/nouveau*"
+			vmove "usr/lib/gallium-pipe/"
+			;;
+		aarch64*)
+			vmove "usr/lib/libXvMCnouveau.so.*"
+			vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			vmove "usr/lib/dri/nouveau*"
+			;;
+# TODO: the ppc*) case
 		esac
+# TODO: brace expansion doesn't work?
+		vmove "usr/lib/xorg/modules/drivers/swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/kms_swrast_dri.so"
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+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/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vc4*"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -240,9 +249,16 @@ mesa-opencl_package() {
 	}
 }
 
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
+	}
+}
+
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-vulkan-intel
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-vulkan-intel
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-vulkan-radeon
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-vulkan-radeon

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (5 preceding siblings ...)
  2019-10-22 10:15 ` voidlinux-github
@ 2019-10-22 15:17 ` voidlinux-github
  2019-10-22 15:17 ` voidlinux-github
                   ` (64 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 15:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 9087 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From 23c44f0afc6da0730ecbbae4605e39f893909a82 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template                        | 110 ++++++++++--------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |   0
 srcpkgs/{mesa-intel-dri => mesa-gallium-dri}  |   0
 .../{mesa-nouveau-dri => mesa-vulkan-intel}   |   0
 .../{mesa-vmwgfx-dri => mesa-vulkan-radeon}   |   0
 5 files changed, 63 insertions(+), 47 deletions(-)
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-vulkan-intel} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-vulkan-radeon} (100%)

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..55581de5dd1 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -33,6 +33,7 @@ subpackages="libglapi libgbm libEGL libGLES libOSMesa"
 case "$XBPS_TARGET_MACHINE" in
 i686*|x86_64*)
 	# Enable all x86 drivers.
+# TODO: Why not the gallium version of i915?
 	configure_args+=" -Dgallium-drivers=r300,r600,radeonsi,svga,swrast,nouveau,virgl"
 	configure_args+=" -Ddri-drivers=i915,i965,r100,r200,nouveau"
 	configure_args+=" -Dgallium-xa=true -Ddri3=true -Dgallium-nine=true"
@@ -40,8 +41,8 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,21 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-tegra-dri mesa-gallium-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +79,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +108,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +178,65 @@ libxatracker_package() {
 	}
 }
 
-mesa-ati-dri_package() {
-	short_desc="Mesa DRI drivers for ATI GPUs"
-	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
-	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
-	}
-}
-
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-dri_package() {
+	short_desc="Mesa classic DRI drivers"
 	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"
+		vmove "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
 	}
 }
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
+mesa-gallium-dri_package() {
+	short_desc="Mesa Gallium DRI drivers"
 	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 ;;
+		i686*|x86_64*)
+# TODO: XvMCr and vdpau probably belong to another subpackage
+			vmove "usr/lib/libXvMCr[36]00.so.*"
+			vmove "usr/lib/libXvMCnouveau.so.*"
+			vmove "usr/lib/vdpau/libvdpau_r[36]00.so*"
+			vmove "usr/lib/vdpau/libvdpau_radeon*.so*"
+			vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
+			vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/r[36]00*"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
+			vmove usr/lib/dri/r*
+			vmove "usr/lib/dri/nouveau*"
+			vmove "usr/lib/gallium-pipe/"
+			;;
+		aarch64*)
+			vmove "usr/lib/libXvMCnouveau.so.*"
+			vmove "usr/lib/vdpau/libvdpau_nouveau.so*"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			vmove "usr/lib/dri/nouveau*"
+			;;
+# TODO: the ppc*) case
 		esac
+# TODO: brace expansion doesn't work?
+		vmove "usr/lib/xorg/modules/drivers/swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/kms_swrast_dri.so"
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+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/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vc4*"
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -240,9 +249,16 @@ mesa-opencl_package() {
 	}
 }
 
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
+	}
+}
+
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-vulkan-intel
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-vulkan-intel
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-vulkan-radeon
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-vulkan-radeon

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (8 preceding siblings ...)
  2019-10-22 22:30 ` voidlinux-github
@ 2019-10-22 22:30 ` voidlinux-github
  2019-10-22 23:32 ` voidlinux-github
                   ` (61 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 22:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 9648 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From ec8d90e5ba7ca0b1777514b8132b01cbb8f17f2f Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template                        | 122 +++++++++++-------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |   0
 srcpkgs/{mesa-intel-dri => mesa-gallium-XvMC} |   0
 .../{mesa-nouveau-dri => mesa-gallium-dri}    |   0
 .../{mesa-vmwgfx-dri => mesa-gallium-vdpau}   |   0
 srcpkgs/mesa-vulkan-intel                     |   1 +
 srcpkgs/mesa-vulkan-radeon                    |   1 +
 7 files changed, 80 insertions(+), 44 deletions(-)
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-XvMC} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-gallium-vdpau} (100%)
 create mode 120000 srcpkgs/mesa-vulkan-intel
 create mode 120000 srcpkgs/mesa-vulkan-radeon

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..c129a34c656 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -40,8 +40,9 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,23 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-tegra-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +81,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +110,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +180,81 @@ 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-dri_package() {
+	short_desc="Mesa classic DRI drivers"
 	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 "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
 	}
 }
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-gallium-dri_package() {
+	short_desc="Mesa Gallium DRI drivers"
 	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"
+		case "$XBPS_TARGET_MACHINE" in
+		i686*|x86_64*)
+			vmove "usr/lib/dri/*_drv_video.so"
+			vmove "usr/lib/gallium-pipe/pipe_*.so"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/r[36]00_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/vmwgfx_dri.so"
+			;;
+		aarch64*)
+			vmove "usr/lib/dri/nouveau_drv_video.so"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			;;
+# TODO: the ppc*) case
+		esac
+		vmove "usr/lib/xorg/modules/drivers/*swrast_dri.so"
 	}
 }
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
+mesa-gallium-vdpau_package() {
+	short_desc="Mesa Gallium VDPAU"
 	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 ;;
+		i686*|x86_64*)
+			vmove "usr/lib/vdpau/libvdpau_*.so.*"
+			;;
+		aarch64*)
+			vmove "usr/lib/vdpau/libvdpau_nouveau.so.*"
+			;;
 		esac
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+mesa-gallium-XvMC_package() {
+	short_desc="Mesa Gallium XvMC"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		case "$XBPS_TARGET_MACHINE" in
+		i686*|x86_64*)
+			vmove "usr/lib/libXvMC*.so.*"
+			;;
+		aarch64*)
+			vmove "usr/lib/libXvMCnouveau.so.*"
+		esac
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+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/vc4*"
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
+	}
+}
+
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -236,13 +263,20 @@ mesa-opencl_package() {
 	depends="libclc libOpenCL"
 	pkg_install() {
 		vmove etc/OpenCL
-		vmove "usr/lib/libMesaOpenCL*"
+		vmove "usr/lib/libMesaOpenCL.so.*"
+	}
+}
+
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
 	}
 }
 
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-XvMC
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-XvMC
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-gallium-vdpau
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-gallium-vdpau
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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (7 preceding siblings ...)
  2019-10-22 15:17 ` voidlinux-github
@ 2019-10-22 22:30 ` voidlinux-github
  2019-10-22 22:30 ` voidlinux-github
                   ` (62 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 22:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 9648 bytes --]

From fb9cc86cc393bd0d39dc55583d405e2b82abace3 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:44:41 +0200
Subject: [PATCH 1/2] xbps-src: strip hard links once

---
 common/hooks/post-install/06-strip-and-debug-pkgs.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hooks/post-install/06-strip-and-debug-pkgs.sh b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
index a15dd1a96c3..34ed3553aef 100644
--- a/common/hooks/post-install/06-strip-and-debug-pkgs.sh
+++ b/common/hooks/post-install/06-strip-and-debug-pkgs.sh
@@ -65,7 +65,7 @@ hook() {
 
 	STRIPCMD=/usr/bin/$STRIP
 
-	find ${PKGDESTDIR} -type f | while read f; do
+	find ${PKGDESTDIR} -type f -printf '%p %i\n' | awk '!seen[$2]++' | cut -d ' ' -f1 | while read f; do
 		if [[ $f =~ ^${PKGDESTDIR}/usr/lib/debug/ ]]; then
 			continue
 		fi

From ec8d90e5ba7ca0b1777514b8132b01cbb8f17f2f Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH 2/2] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 srcpkgs/libGL/template                        | 122 +++++++++++-------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |   0
 srcpkgs/{mesa-intel-dri => mesa-gallium-XvMC} |   0
 .../{mesa-nouveau-dri => mesa-gallium-dri}    |   0
 .../{mesa-vmwgfx-dri => mesa-gallium-vdpau}   |   0
 srcpkgs/mesa-vulkan-intel                     |   1 +
 srcpkgs/mesa-vulkan-radeon                    |   1 +
 7 files changed, 80 insertions(+), 44 deletions(-)
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-XvMC} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-gallium-vdpau} (100%)
 create mode 120000 srcpkgs/mesa-vulkan-intel
 create mode 120000 srcpkgs/mesa-vulkan-radeon

diff --git a/srcpkgs/libGL/template b/srcpkgs/libGL/template
index 3ce62fe073f..c129a34c656 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -40,8 +40,9 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,23 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-tegra-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +81,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +110,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +180,81 @@ 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-dri_package() {
+	short_desc="Mesa classic DRI drivers"
 	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 "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
 	}
 }
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-gallium-dri_package() {
+	short_desc="Mesa Gallium DRI drivers"
 	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"
+		case "$XBPS_TARGET_MACHINE" in
+		i686*|x86_64*)
+			vmove "usr/lib/dri/*_drv_video.so"
+			vmove "usr/lib/gallium-pipe/pipe_*.so"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/r[36]00_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/vmwgfx_dri.so"
+			;;
+		aarch64*)
+			vmove "usr/lib/dri/nouveau_drv_video.so"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			;;
+# TODO: the ppc*) case
+		esac
+		vmove "usr/lib/xorg/modules/drivers/*swrast_dri.so"
 	}
 }
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
+mesa-gallium-vdpau_package() {
+	short_desc="Mesa Gallium VDPAU"
 	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 ;;
+		i686*|x86_64*)
+			vmove "usr/lib/vdpau/libvdpau_*.so.*"
+			;;
+		aarch64*)
+			vmove "usr/lib/vdpau/libvdpau_nouveau.so.*"
+			;;
 		esac
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+mesa-gallium-XvMC_package() {
+	short_desc="Mesa Gallium XvMC"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		case "$XBPS_TARGET_MACHINE" in
+		i686*|x86_64*)
+			vmove "usr/lib/libXvMC*.so.*"
+			;;
+		aarch64*)
+			vmove "usr/lib/libXvMCnouveau.so.*"
+		esac
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+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/vc4*"
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
+	}
+}
+
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -236,13 +263,20 @@ mesa-opencl_package() {
 	depends="libclc libOpenCL"
 	pkg_install() {
 		vmove etc/OpenCL
-		vmove "usr/lib/libMesaOpenCL*"
+		vmove "usr/lib/libMesaOpenCL.so.*"
+	}
+}
+
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
 	}
 }
 
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-XvMC
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-XvMC
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-gallium-vdpau
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-gallium-vdpau
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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (9 preceding siblings ...)
  2019-10-22 22:30 ` voidlinux-github
@ 2019-10-22 23:32 ` voidlinux-github
  2019-10-22 23:34 ` voidlinux-github
                   ` (60 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 23:32 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545199281

Comment:
I didn't see that there is a variable `nostrip_files` that can be put in the template, then the best thing would be to explicitly list all the hard links there rather than patching `xbps-src` for such a corner case. I still think that the `-dri` subpackages reorganization needs to be done though.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (10 preceding siblings ...)
  2019-10-22 23:32 ` voidlinux-github
@ 2019-10-22 23:34 ` voidlinux-github
  2019-10-22 23:39 ` voidlinux-github
                   ` (59 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 23:34 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545199281

Comment:
I didn't see that there is a variable `nostrip_files` that can be put in the template, then the best thing would be to explicitly list all the hard links there rather than patching `xbps-src` for such a corner case. I still think that the reorganization of `-dri` subpackages needs to be done though.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (11 preceding siblings ...)
  2019-10-22 23:34 ` voidlinux-github
@ 2019-10-22 23:39 ` voidlinux-github
  2019-10-23 11:39 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (58 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-22 23:39 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545199281

Comment:
I didn't see that there is a variable `nostrip_files` that can be put in the template, then the best thing would be to explicitly list all the hard links there rather than patching `xbps-src` for such a corner case. I still think that the reorganization of `-dri` subpackages needs to be done though, because otherwise there is ambiguity in which package to install to get the debug symbols.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (13 preceding siblings ...)
  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
                   ` (56 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 11:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 10324 bytes --]

From cc0dbbfc3484506c6d49243fe33ebdce6980c815 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 .../libGL/patches/no-unlink-megadrivers.patch |  13 ++
 srcpkgs/libGL/template                        | 140 ++++++++++++------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |   0
 srcpkgs/{mesa-intel-dri => mesa-gallium-XvMC} |   0
 .../{mesa-nouveau-dri => mesa-gallium-dri}    |   0
 .../{mesa-vmwgfx-dri => mesa-gallium-vdpau}   |   0
 srcpkgs/mesa-vulkan-intel                     |   1 +
 srcpkgs/mesa-vulkan-radeon                    |   1 +
 8 files changed, 109 insertions(+), 46 deletions(-)
 create mode 100644 srcpkgs/libGL/patches/no-unlink-megadrivers.patch
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-XvMC} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-gallium-vdpau} (100%)
 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..b11e857b9c7
--- /dev/null
+++ b/srcpkgs/libGL/patches/no-unlink-megadrivers.patch
@@ -0,0 +1,13 @@
+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 3ce62fe073f..825fc79e460 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -40,8 +40,9 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,23 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-tegra-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +81,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +110,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +180,95 @@ 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-dri_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/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 "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/libmesa_dri_drivers.so"
 	}
 }
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-gallium-dri_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 vmwgfx_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/xorg/modules/drivers/i9[16]5_dri.*"
-		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
-		vmove "usr/lib/libvulkan_intel.so"
+		case "$XBPS_TARGET_MACHINE" in
+		i686*|x86_64*)
+			vmove "usr/lib/dri/*_drv_video.so"
+			vmove "usr/lib/gallium-pipe/pipe_*.so"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/r[36]00_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/vmwgfx_dri.so"
+			;;
+		aarch64*)
+			vmove "usr/lib/dri/*_drv_video.so"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			;;
+# TODO: the ppc*) case
+		esac
+		vmove "usr/lib/xorg/modules/drivers/*swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/libgallium_dri.so"
 	}
 }
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
+mesa-gallium-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/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
+		vmove "usr/lib/vdpau/libvdpau_*.so.*"
+#		case "$XBPS_TARGET_MACHINE" in
+#		i686*|x86_64*)
+#			vmove "usr/lib/vdpau/libvdpau_*.so.*"
+#			;;
+#		aarch64*)
+#			vmove "usr/lib/vdpau/libvdpau_nouveau.so.*"
+#			;;
+#		esac
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+mesa-gallium-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/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/lib/libXvMC*.so.*"
+#		case "$XBPS_TARGET_MACHINE" in
+#		i686*|x86_64*)
+#			vmove "usr/lib/libXvMC*.so.*"
+#			;;
+#		aarch64*)
+#			vmove "usr/lib/libXvMCnouveau.so.*"
+#		esac
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+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/vc4*"
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
+	}
+}
+
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -236,13 +277,20 @@ mesa-opencl_package() {
 	depends="libclc libOpenCL"
 	pkg_install() {
 		vmove etc/OpenCL
-		vmove "usr/lib/libMesaOpenCL*"
+		vmove "usr/lib/libMesaOpenCL.so.*"
+	}
+}
+
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
 	}
 }
 
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-XvMC
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-XvMC
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-gallium-vdpau
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-gallium-vdpau
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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (12 preceding siblings ...)
  2019-10-22 23:39 ` voidlinux-github
@ 2019-10-23 11:39 ` voidlinux-github
  2019-10-23 11:39 ` voidlinux-github
                   ` (57 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 11:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1155 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

[WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries
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.
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: 10324 bytes --]

From cc0dbbfc3484506c6d49243fe33ebdce6980c815 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Tue, 22 Oct 2019 00:50:52 +0200
Subject: [PATCH] libGL: reorganize subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 .../libGL/patches/no-unlink-megadrivers.patch |  13 ++
 srcpkgs/libGL/template                        | 140 ++++++++++++------
 srcpkgs/{mesa-ati-dri => mesa-dri}            |   0
 srcpkgs/{mesa-intel-dri => mesa-gallium-XvMC} |   0
 .../{mesa-nouveau-dri => mesa-gallium-dri}    |   0
 .../{mesa-vmwgfx-dri => mesa-gallium-vdpau}   |   0
 srcpkgs/mesa-vulkan-intel                     |   1 +
 srcpkgs/mesa-vulkan-radeon                    |   1 +
 8 files changed, 109 insertions(+), 46 deletions(-)
 create mode 100644 srcpkgs/libGL/patches/no-unlink-megadrivers.patch
 rename srcpkgs/{mesa-ati-dri => mesa-dri} (100%)
 rename srcpkgs/{mesa-intel-dri => mesa-gallium-XvMC} (100%)
 rename srcpkgs/{mesa-nouveau-dri => mesa-gallium-dri} (100%)
 rename srcpkgs/{mesa-vmwgfx-dri => mesa-gallium-vdpau} (100%)
 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..b11e857b9c7
--- /dev/null
+++ b/srcpkgs/libGL/patches/no-unlink-megadrivers.patch
@@ -0,0 +1,13 @@
+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 3ce62fe073f..825fc79e460 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -40,8 +40,9 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,23 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-tegra-dri mesa-vc4-dri"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-vc4-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +81,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +110,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,59 +180,95 @@ 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-dri_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/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 "usr/lib/xorg/modules/drivers/i9[16]5_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/libmesa_dri_drivers.so"
 	}
 }
 
-mesa-intel-dri_package() {
-	short_desc="Mesa DRI drivers for Intel GPUs"
-	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+mesa-gallium-dri_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 vmwgfx_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/xorg/modules/drivers/i9[16]5_dri.*"
-		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
-		vmove "usr/lib/libvulkan_intel.so"
+		case "$XBPS_TARGET_MACHINE" in
+		i686*|x86_64*)
+			vmove "usr/lib/dri/*_drv_video.so"
+			vmove "usr/lib/gallium-pipe/pipe_*.so"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/r[36]00_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
+			vmove "usr/lib/xorg/modules/drivers/vmwgfx_dri.so"
+			;;
+		aarch64*)
+			vmove "usr/lib/dri/*_drv_video.so"
+			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+			;;
+# TODO: the ppc*) case
+		esac
+		vmove "usr/lib/xorg/modules/drivers/*swrast_dri.so"
+		vmove "usr/lib/xorg/modules/drivers/libgallium_dri.so"
 	}
 }
 
-mesa-nouveau-dri_package() {
-	short_desc="Mesa DRI drivers for NVIDIA GPUs (nouveau dri)"
+mesa-gallium-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/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
+		vmove "usr/lib/vdpau/libvdpau_*.so.*"
+#		case "$XBPS_TARGET_MACHINE" in
+#		i686*|x86_64*)
+#			vmove "usr/lib/vdpau/libvdpau_*.so.*"
+#			;;
+#		aarch64*)
+#			vmove "usr/lib/vdpau/libvdpau_nouveau.so.*"
+#			;;
+#		esac
 	}
 }
 
-mesa-vmwgfx-dri_package() {
-	short_desc="Mesa DRI drivers for VMware"
+mesa-gallium-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/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/lib/libXvMC*.so.*"
+#		case "$XBPS_TARGET_MACHINE" in
+#		i686*|x86_64*)
+#			vmove "usr/lib/libXvMC*.so.*"
+#			;;
+#		aarch64*)
+#			vmove "usr/lib/libXvMCnouveau.so.*"
+#		esac
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+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/vc4*"
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
+	}
+}
+
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
 	}
 }
 
@@ -236,13 +277,20 @@ mesa-opencl_package() {
 	depends="libclc libOpenCL"
 	pkg_install() {
 		vmove etc/OpenCL
-		vmove "usr/lib/libMesaOpenCL*"
+		vmove "usr/lib/libMesaOpenCL.so.*"
+	}
+}
+
+mesa-vc4-dri_package() {
+	short_desc="Mesa DRI drivers for Videocore IV GPU"
+	pkg_install() {
+		vmove "usr/lib/xorg/modules/drivers/vc4*"
 	}
 }
 
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-ati-dri b/srcpkgs/mesa-dri
similarity index 100%
rename from srcpkgs/mesa-ati-dri
rename to srcpkgs/mesa-dri
diff --git a/srcpkgs/mesa-intel-dri b/srcpkgs/mesa-gallium-XvMC
similarity index 100%
rename from srcpkgs/mesa-intel-dri
rename to srcpkgs/mesa-gallium-XvMC
diff --git a/srcpkgs/mesa-nouveau-dri b/srcpkgs/mesa-gallium-dri
similarity index 100%
rename from srcpkgs/mesa-nouveau-dri
rename to srcpkgs/mesa-gallium-dri
diff --git a/srcpkgs/mesa-vmwgfx-dri b/srcpkgs/mesa-gallium-vdpau
similarity index 100%
rename from srcpkgs/mesa-vmwgfx-dri
rename to srcpkgs/mesa-gallium-vdpau
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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (14 preceding siblings ...)
  2019-10-23 11:39 ` voidlinux-github
@ 2019-10-23 11:47 ` voidlinux-github
  2019-10-23 11:48 ` voidlinux-github
                   ` (55 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 11:47 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (like `libmesa_dri_drivers.so`) instead of one of the hard links at random. For this I needed to introduce a single-line patch that retains the original megadriver name hard link.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (15 preceding siblings ...)
  2019-10-23 11:47 ` [WIP] " voidlinux-github
@ 2019-10-23 11:48 ` voidlinux-github
  2019-10-23 11:49 ` voidlinux-github
                   ` (54 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 11:48 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard links at random. For this I needed to introduce a single-line patch that retains the original megadriver name hard link.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (16 preceding siblings ...)
  2019-10-23 11:48 ` voidlinux-github
@ 2019-10-23 11:49 ` voidlinux-github
  2019-10-23 11:55 ` voidlinux-github
                   ` (53 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 11:49 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (17 preceding siblings ...)
  2019-10-23 11:49 ` voidlinux-github
@ 2019-10-23 11:55 ` voidlinux-github
  2019-10-23 11:57 ` voidlinux-github
                   ` (52 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 11:55 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.
Next step would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`.
Last thing, dummy packages must be set up to migrate users from the old `mesa-*-dri` packages.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (18 preceding siblings ...)
  2019-10-23 11:55 ` voidlinux-github
@ 2019-10-23 11:57 ` voidlinux-github
  2019-10-23 15:19 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (51 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 11:57 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.
An improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`.
Last thing, dummy packages must be set up to migrate users from the old `mesa-*-dri` packages.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (19 preceding siblings ...)
  2019-10-23 11:57 ` voidlinux-github
@ 2019-10-23 15:19 ` voidlinux-github
  2019-10-23 15:19 ` voidlinux-github
                   ` (50 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 15:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1173 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

[WIP] libGL: fix debug symbols generation for mesa libraries
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: 9865 bytes --]

From 017374591d8dd3bcc01d52f7bd9b87cbf49f7f31 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 subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 .../libGL/patches/no-unlink-megadrivers.patch |  13 ++
 srcpkgs/libGL/template                        | 149 +++++++++++++++---
 srcpkgs/mesa-dri                              |   1 +
 srcpkgs/mesa-gallium-XvMC                     |   1 +
 srcpkgs/mesa-gallium-dri                      |   1 +
 srcpkgs/mesa-gallium-vdpau                    |   1 +
 srcpkgs/mesa-vulkan-intel                     |   1 +
 srcpkgs/mesa-vulkan-radeon                    |   1 +
 8 files changed, 150 insertions(+), 18 deletions(-)
 create mode 100644 srcpkgs/libGL/patches/no-unlink-megadrivers.patch
 create mode 120000 srcpkgs/mesa-dri
 create mode 120000 srcpkgs/mesa-gallium-XvMC
 create mode 120000 srcpkgs/mesa-gallium-dri
 create mode 120000 srcpkgs/mesa-gallium-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..b11e857b9c7
--- /dev/null
+++ b/srcpkgs/libGL/patches/no-unlink-megadrivers.patch
@@ -0,0 +1,13 @@
+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 3ce62fe073f..2f8113ffd4a 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -40,8 +40,9 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,22 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-gallium-vdpau mesa-gallium-XvMC"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +80,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +109,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,6 +179,124 @@ libxatracker_package() {
 	}
 }
 
+mesa-opencl_package() {
+	short_desc="Mesa implementation of OpenCL (r600+ only)"
+	depends="libclc libOpenCL"
+	pkg_install() {
+		vmove etc/OpenCL
+		vmove "usr/lib/libMesaOpenCL.so.*"
+	}
+}
+
+mesa-dri_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() {
+		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/i9[16]5_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/libmesa_dri_drivers.so"
+	}
+}
+
+mesa-gallium-dri_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() {
+		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"
+#		case "$XBPS_TARGET_MACHINE" in
+#		i686*|x86_64*)
+#			vmove "usr/lib/dri/*_drv_video.so"
+#			vmove "usr/lib/gallium-pipe/pipe_*.so"
+#			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+#			vmove "usr/lib/xorg/modules/drivers/r[36]00_dri.so"
+#			vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+#			vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
+#			vmove "usr/lib/xorg/modules/drivers/vmwgfx_dri.so"
+#			;;
+#		aarch64*)
+#			vmove "usr/lib/dri/*_drv_video.so"
+#			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+#			;;
+# TODO: the ppc*) case
+#		esac
+#		vmove "usr/lib/xorg/modules/drivers/*swrast_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/libgallium_dri.so"
+	}
+}
+
+mesa-gallium-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() {
+		for f in $nostrip_files; do
+			if [ -f "$DESTDIR/usr/lib/vdpau/$f" ]; then
+				vmove "usr/lib/vdpau/$f";
+			fi
+		done
+		vmove "usr/lib/vdpau/libvdpau_gallium.so.*"
+#		vmove "usr/lib/vdpau/libvdpau_*.so.*"
+	}
+}
+
+mesa-gallium-XvMC_package() {
+	short_desc="Mesa Gallium XvMC"
+	nostrip_files="libXvMCnouveau.so.1.0.0 libXvMCr600.so.1.0.0"
+	pkg_install() {
+		for f in $nostrip_files; do
+			if [ -f "$DESTDIR/usr/lib/$f" ]; then
+				vmove "usr/lib/$f";
+			fi
+		done
+		vmove "usr/lib/libXvMCgallium.so"
+#		vmove "usr/lib/libXvMC*.so.*"
+	}
+}
+
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
+	}
+}
+
+mesa-vulkan-radeon_package() {
+	short_desc="Mesa Radeon Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
+	}
+}
+
+# The old mesa-*-dri packages to be turned into dummy packages
+
 mesa-ati-dri_package() {
 	short_desc="Mesa DRI drivers for ATI GPUs"
 	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
@@ -231,18 +353,9 @@ mesa-vc4-dri_package() {
 	}
 }
 
-mesa-opencl_package() {
-	short_desc="Mesa implementation of OpenCL (r600+ only)"
-	depends="libclc libOpenCL"
-	pkg_install() {
-		vmove etc/OpenCL
-		vmove "usr/lib/libMesaOpenCL*"
-	}
-}
-
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-dri b/srcpkgs/mesa-dri
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-dri
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-gallium-XvMC b/srcpkgs/mesa-gallium-XvMC
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-gallium-XvMC
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-gallium-dri b/srcpkgs/mesa-gallium-dri
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-gallium-dri
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-gallium-vdpau b/srcpkgs/mesa-gallium-vdpau
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-gallium-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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (20 preceding siblings ...)
  2019-10-23 15:19 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-10-23 15:19 ` voidlinux-github
  2019-10-23 15:26 ` voidlinux-github
                   ` (49 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 15:19 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1173 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

[WIP] libGL: fix debug symbols generation for mesa libraries
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: 9865 bytes --]

From 017374591d8dd3bcc01d52f7bd9b87cbf49f7f31 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 subpackages by megadrivers

Many Mesa libraries are hard links to the same file, called a
`megadriver`, so they should be grouped in the same subpackage.
---
 .../libGL/patches/no-unlink-megadrivers.patch |  13 ++
 srcpkgs/libGL/template                        | 149 +++++++++++++++---
 srcpkgs/mesa-dri                              |   1 +
 srcpkgs/mesa-gallium-XvMC                     |   1 +
 srcpkgs/mesa-gallium-dri                      |   1 +
 srcpkgs/mesa-gallium-vdpau                    |   1 +
 srcpkgs/mesa-vulkan-intel                     |   1 +
 srcpkgs/mesa-vulkan-radeon                    |   1 +
 8 files changed, 150 insertions(+), 18 deletions(-)
 create mode 100644 srcpkgs/libGL/patches/no-unlink-megadrivers.patch
 create mode 120000 srcpkgs/mesa-dri
 create mode 120000 srcpkgs/mesa-gallium-XvMC
 create mode 120000 srcpkgs/mesa-gallium-dri
 create mode 120000 srcpkgs/mesa-gallium-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..b11e857b9c7
--- /dev/null
+++ b/srcpkgs/libGL/patches/no-unlink-megadrivers.patch
@@ -0,0 +1,13 @@
+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 3ce62fe073f..2f8113ffd4a 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -40,8 +40,9 @@ 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"
+	subpackages+=" libxatracker mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-intel mesa-vulkan-radeon mesa-opencl"
 	;;
 ppc*)
 	# Enable all ppc drivers.
@@ -56,21 +57,22 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
-	subpackages+=" mesa-ati-dri mesa-nouveau-dri"
-	subpackages+=" mesa-opencl"
+	subpackages+=" mesa-dri mesa-gallium-dri"
+	subpackages+=" mesa-gallium-vdpau mesa-gallium-XvMC"
+	subpackages+=" mesa-vulkan-radeon 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-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
+	subpackages+=" mesa-gallium-dri mesa-gallium-vdpau mesa-gallium-XvMC"
 	;;
 armv7l*)
 	# Enable Videocore IV and swrast for RaspberryPi
 	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-vc4-dri"
+	subpackages+=" mesa-gallium-dri"
 	;;
 *)
 	# Enable swrast driver.
@@ -78,6 +80,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-gallium-dri"
 	;;
 esac
 
@@ -106,6 +109,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# TODO: This file is not installed in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,6 +179,124 @@ libxatracker_package() {
 	}
 }
 
+mesa-opencl_package() {
+	short_desc="Mesa implementation of OpenCL (r600+ only)"
+	depends="libclc libOpenCL"
+	pkg_install() {
+		vmove etc/OpenCL
+		vmove "usr/lib/libMesaOpenCL.so.*"
+	}
+}
+
+mesa-dri_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() {
+		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/i9[16]5_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/nouveau_vieux_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/r200_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/radeon_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/libmesa_dri_drivers.so"
+	}
+}
+
+mesa-gallium-dri_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() {
+		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"
+#		case "$XBPS_TARGET_MACHINE" in
+#		i686*|x86_64*)
+#			vmove "usr/lib/dri/*_drv_video.so"
+#			vmove "usr/lib/gallium-pipe/pipe_*.so"
+#			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+#			vmove "usr/lib/xorg/modules/drivers/r[36]00_dri.so"
+#			vmove "usr/lib/xorg/modules/drivers/radeonsi_dri.so"
+#			vmove "usr/lib/xorg/modules/drivers/virtio_gpu_dri.so"
+#			vmove "usr/lib/xorg/modules/drivers/vmwgfx_dri.so"
+#			;;
+#		aarch64*)
+#			vmove "usr/lib/dri/*_drv_video.so"
+#			vmove "usr/lib/xorg/modules/drivers/nouveau_dri.so"
+#			;;
+# TODO: the ppc*) case
+#		esac
+#		vmove "usr/lib/xorg/modules/drivers/*swrast_dri.so"
+#		vmove "usr/lib/xorg/modules/drivers/libgallium_dri.so"
+	}
+}
+
+mesa-gallium-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() {
+		for f in $nostrip_files; do
+			if [ -f "$DESTDIR/usr/lib/vdpau/$f" ]; then
+				vmove "usr/lib/vdpau/$f";
+			fi
+		done
+		vmove "usr/lib/vdpau/libvdpau_gallium.so.*"
+#		vmove "usr/lib/vdpau/libvdpau_*.so.*"
+	}
+}
+
+mesa-gallium-XvMC_package() {
+	short_desc="Mesa Gallium XvMC"
+	nostrip_files="libXvMCnouveau.so.1.0.0 libXvMCr600.so.1.0.0"
+	pkg_install() {
+		for f in $nostrip_files; do
+			if [ -f "$DESTDIR/usr/lib/$f" ]; then
+				vmove "usr/lib/$f";
+			fi
+		done
+		vmove "usr/lib/libXvMCgallium.so"
+#		vmove "usr/lib/libXvMC*.so.*"
+	}
+}
+
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
+	}
+}
+
+mesa-vulkan-radeon_package() {
+	short_desc="Mesa Radeon Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/radeon_icd*.json"
+		vmove "usr/lib/libvulkan_radeon.so"
+	}
+}
+
+# The old mesa-*-dri packages to be turned into dummy packages
+
 mesa-ati-dri_package() {
 	short_desc="Mesa DRI drivers for ATI GPUs"
 	lib32files="/usr/share/vulkan/icd.d/radeon_icd.i686.json"
@@ -231,18 +353,9 @@ mesa-vc4-dri_package() {
 	}
 }
 
-mesa-opencl_package() {
-	short_desc="Mesa implementation of OpenCL (r600+ only)"
-	depends="libclc libOpenCL"
-	pkg_install() {
-		vmove etc/OpenCL
-		vmove "usr/lib/libMesaOpenCL*"
-	}
-}
-
 mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+	short_desc="Mesa Gallium DRI drivers for Tegra GPU"
+	depends="mesa-gallium-dri"
 	pkg_install() {
 		vmove "usr/lib/xorg/modules/drivers/tegra*"
 	}
diff --git a/srcpkgs/mesa-dri b/srcpkgs/mesa-dri
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-dri
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-gallium-XvMC b/srcpkgs/mesa-gallium-XvMC
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-gallium-XvMC
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-gallium-dri b/srcpkgs/mesa-gallium-dri
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-gallium-dri
@@ -0,0 +1 @@
+libGL
\ No newline at end of file
diff --git a/srcpkgs/mesa-gallium-vdpau b/srcpkgs/mesa-gallium-vdpau
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-gallium-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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (21 preceding siblings ...)
  2019-10-23 15:19 ` voidlinux-github
@ 2019-10-23 15:26 ` voidlinux-github
  2019-10-24 12:41 ` voidlinux-github
                   ` (48 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-23 15:26 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.
~~An improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the *_package().~~ [done]
Last thing, dummy packages must be set up to migrate users from the old `mesa-*-dri` packages.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (22 preceding siblings ...)
  2019-10-23 15:26 ` voidlinux-github
@ 2019-10-24 12:41 ` voidlinux-github
  2019-10-24 12:41 ` voidlinux-github
                   ` (47 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-24 12:41 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [ ] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [ ] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [ ] update the reverse dependencies `xf86-video-*` to the new names

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (23 preceding siblings ...)
  2019-10-24 12:41 ` voidlinux-github
@ 2019-10-24 12:41 ` voidlinux-github
  2019-10-24 13:47 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (46 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-24 12:41 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [x] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [ ] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [ ] update the reverse dependencies `xf86-video-*` to the new names

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (25 preceding siblings ...)
  2019-10-24 13:47 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-10-24 13:47 ` voidlinux-github
  2019-10-24 13:47 ` voidlinux-github
                   ` (44 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-24 13:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1173 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

[WIP] libGL: fix debug symbols generation for mesa libraries
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: 11042 bytes --]

From 4191cbb0bedf2c5646e93c173163e3cc3a524ec8 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 |  13 ++
 srcpkgs/libGL/template                        | 158 ++++++++++++------
 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, 128 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..b11e857b9c7
--- /dev/null
+++ b/srcpkgs/libGL/patches/no-unlink-megadrivers.patch
@@ -0,0 +1,13 @@
+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 3ce62fe073f..0479cc3bf11 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -40,8 +40,10 @@ 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"
+	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 +58,17 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
+	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 +76,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 +86,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 +115,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# FIXME: Broken symlink in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,75 +185,125 @@ 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)"
+	depends="mesa-dri-classic>=${version}_${revision}
+	 mesa-dri-gallium>=${version}_${revision}"
+}
+
+mesa-intel-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Intel GPUs (transitional dummy
+	 package)"
+	depends="mesa-dri-classic>=${version}_${revision}"
+}
+
+mesa-nouveau-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for NVIDIA GPUs (transitional dummy
+	 package)"
+	depends="mesa-dri-classic>=${version}_${revision}
+	 mesa-dri-gallium>=${version}_${revision}"
+}
+
+mesa-vmwgfx-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for VMware (transitional dummy package)"
+	depends="mesa-dri-gallium>=${version}_${revision}"
+}
+
+mesa-vc4-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Videocore IV GPU (transitional dummy
+	 package)"
+	depends="mesa-dri-gallium>=${version}_${revision}"
+}
+
+mesa-tegra-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Tegra GPU (transitional dummy package)"
+	depends="mesa-dri-gallium>=${version}_${revision}"
+}
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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (24 preceding siblings ...)
  2019-10-24 12:41 ` voidlinux-github
@ 2019-10-24 13:47 ` voidlinux-github
  2019-10-24 13:47 ` voidlinux-github
                   ` (45 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-24 13:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1173 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

[WIP] libGL: fix debug symbols generation for mesa libraries
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: 11042 bytes --]

From 4191cbb0bedf2c5646e93c173163e3cc3a524ec8 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 |  13 ++
 srcpkgs/libGL/template                        | 158 ++++++++++++------
 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, 128 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..b11e857b9c7
--- /dev/null
+++ b/srcpkgs/libGL/patches/no-unlink-megadrivers.patch
@@ -0,0 +1,13 @@
+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 3ce62fe073f..0479cc3bf11 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.1
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dshared-glapi=true -Dgbm=true -Degl=true
@@ -40,8 +40,10 @@ 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"
+	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 +58,17 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
+	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 +76,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 +86,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 +115,7 @@ esac
 post_install() {
 	vlicense docs/license.html
 	vmkdir usr/lib/xorg/modules/extensions
+# FIXME: Broken symlink in musl
 	ln -s libglx-xorg.so ${DESTDIR}/usr/lib/xorg/modules/extensions/libglx.so
 	case "$XBPS_TARGET_MACHINE" in
 		i686*)
@@ -175,75 +185,125 @@ 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)"
+	depends="mesa-dri-classic>=${version}_${revision}
+	 mesa-dri-gallium>=${version}_${revision}"
+}
+
+mesa-intel-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Intel GPUs (transitional dummy
+	 package)"
+	depends="mesa-dri-classic>=${version}_${revision}"
+}
+
+mesa-nouveau-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for NVIDIA GPUs (transitional dummy
+	 package)"
+	depends="mesa-dri-classic>=${version}_${revision}
+	 mesa-dri-gallium>=${version}_${revision}"
+}
+
+mesa-vmwgfx-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for VMware (transitional dummy package)"
+	depends="mesa-dri-gallium>=${version}_${revision}"
+}
+
+mesa-vc4-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Videocore IV GPU (transitional dummy
+	 package)"
+	depends="mesa-dri-gallium>=${version}_${revision}"
+}
+
+mesa-tegra-dri_package() {
+	build_style=meta
+	short_desc="Mesa DRI drivers for Tegra GPU (transitional dummy package)"
+	depends="mesa-dri-gallium>=${version}_${revision}"
+}
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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [WIP] libGL: fix debug symbols generation for mesa libraries
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (26 preceding siblings ...)
  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
                   ` (43 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-24 13:47 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [x] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [x] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [ ] update the reverse dependencies `xf86-video-*` to the new names

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (27 preceding siblings ...)
  2019-10-24 13:47 ` voidlinux-github
@ 2019-10-26 12:56 ` voidlinux-github
  2019-10-26 12:56 ` voidlinux-github
                   ` (42 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-26 12:56 UTC (permalink / raw)
  To: ml

[-- 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: 11314 bytes --]

From c83f296507b5f422091949d3a0453733fa9e4ecc 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..822de04a838 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
+# FIXME: Broken symlink in musl
 	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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (28 preceding siblings ...)
  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
                   ` (41 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-26 12:56 UTC (permalink / raw)
  To: ml

[-- 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: 11314 bytes --]

From c83f296507b5f422091949d3a0453733fa9e4ecc 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..822de04a838 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
+# FIXME: Broken symlink in musl
 	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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (29 preceding siblings ...)
  2019-10-26 12:56 ` voidlinux-github
@ 2019-10-26 13:01 ` voidlinux-github
  2019-10-26 13:01 ` voidlinux-github
                   ` (40 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-26 13:01 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [x] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [x] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [ ] make the new `mesa-dri-*` packages be pulled in by `libGL` instead of `xf86-video-*`
I believe that the dri drivers are required (at runtime) by `libGL` (otherwise mesa-loader fails when opening GL applications) and not by the DDX drivers, which I see as a (legacy) replacement of the in-kernel modesetting drivers, but I might be wrong.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (30 preceding siblings ...)
  2019-10-26 13:01 ` voidlinux-github
@ 2019-10-26 13:01 ` voidlinux-github
  2019-10-26 13:03 ` voidlinux-github
                   ` (39 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-26 13:01 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [x] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [x] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [x] make the new `mesa-dri-*` packages be pulled in by `libGL` instead of `xf86-video-*`
I believe that the dri drivers are required (at runtime) by `libGL` (otherwise mesa-loader fails when opening GL applications) and not by the DDX drivers, which I see as a (legacy) replacement of the in-kernel modesetting drivers, but I might be wrong.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (31 preceding siblings ...)
  2019-10-26 13:01 ` voidlinux-github
@ 2019-10-26 13:03 ` voidlinux-github
  2019-10-26 13:16 ` voidlinux-github
                   ` (38 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-26 13:03 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [x] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [x] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [x] make the new `mesa-dri-*` packages be pulled in by `libGL` instead of `xf86-video-*`
I believe that the dri drivers are required (at runtime) by `libGL` (otherwise mesa-loader fails when opening GL applications) and not by the DDX drivers, which I see as a (legacy and optional) replacement of the in-kernel modesetting drivers, but I might be wrong.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (32 preceding siblings ...)
  2019-10-26 13:03 ` voidlinux-github
@ 2019-10-26 13:16 ` voidlinux-github
  2019-10-26 13:17 ` voidlinux-github
                   ` (37 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-26 13:16 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [x] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [x] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [x] make the new `mesa-dri-*` packages be pulled in by `libGL` instead of `xf86-video-*`
I believe that the dri drivers are required (at runtime) by `libGL` (otherwise mesa-loader fails when opening GL applications) and not by the DDX drivers, which I see as a (legacy and optional) replacement of the in-kernel modesetting drivers, but I might be wrong.

To summarize:

- `mesa-ati-dri`, `mesa-intel-dri`, `mesa-nouveau-dri`, `mesa-vmwgfx-dri`, `mesa-vc4-dri`, `mesa-tegra-dri` are now empty packages. The dri libraries they contained are replaced by `mesa-dri-classic` and `mesa-dri-gallium`
- The other files (non dri libraries) are moved in the new packages `mesa-vdpau`, `mesa-XvMC`, `mesa-vulkan-intel`, `mesa-vulkan-radeon`
- `libGL` now depends on `mesa-dri-classic` and `mesa-dri-gallium`. Actually the plan for the future would be to make `mesa-dri-classic` a legacy option, but it's not possible now because `i965` is classic-only and its Gallium replacement, `iris`, is still experimental.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (33 preceding siblings ...)
  2019-10-26 13:16 ` voidlinux-github
@ 2019-10-26 13:17 ` voidlinux-github
  2019-10-26 13:18 ` voidlinux-github
                   ` (36 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-26 13:17 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [x] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [x] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [x] make the new `mesa-dri-*` packages be pulled in by `libGL` instead of `xf86-video-*`
I believe that the dri drivers are required (at runtime) by `libGL` (otherwise mesa-loader fails when opening GL applications) and not by the DDX drivers, which I see as a (legacy and optional) replacement of the in-kernel modesetting drivers, but I might be wrong.

To summarize:

- `mesa-ati-dri`, `mesa-intel-dri`, `mesa-nouveau-dri`, `mesa-vmwgfx-dri`, `mesa-vc4-dri`, `mesa-tegra-dri` are now empty packages. The dri libraries they contained are replaced by `mesa-dri-classic` and `mesa-dri-gallium`
- The other files (non dri libraries) are moved into the new packages `mesa-vdpau`, `mesa-XvMC`, `mesa-vulkan-intel`, `mesa-vulkan-radeon`
- `libGL` now depends on `mesa-dri-classic` and `mesa-dri-gallium`. Actually the plan for the future would be to make `mesa-dri-classic` a legacy option, but it's not possible now because `i965` is classic-only and its Gallium replacement, `iris`, is still experimental.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (34 preceding siblings ...)
  2019-10-26 13:17 ` voidlinux-github
@ 2019-10-26 13:18 ` voidlinux-github
  2019-10-27  6:17 ` voidlinux-github
                   ` (35 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-26 13:18 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-545405051

Comment:
Now xbps-src doesn't need to change, and also possible user confusion is reduced because the debug info is contained in a file named as the megadriver (e.g. `libmesa_dri_drivers.so`) instead of one of the hard link names at random. For this I needed to introduce a single-line patch that retains the original megadriver hard link name.

- [x] an improvement would be to move files to subpackages only if they get created to eliminate the ugly checks for architectures inside the `*_package()`
- [x] dummy packages must be set up to migrate users from the old `mesa-*-dri` packages
- [x] make the new dri packages be pulled in by `libGL` instead of `xf86-video-*`
I believe that the dri drivers are required (at runtime) by `libGL` (otherwise mesa-loader fails when opening GL applications) and not by the DDX drivers, which I see as a (legacy and optional) replacement of the in-kernel modesetting drivers, but I might be wrong.

To summarize:

- `mesa-ati-dri`, `mesa-intel-dri`, `mesa-nouveau-dri`, `mesa-vmwgfx-dri`, `mesa-vc4-dri`, `mesa-tegra-dri` are now empty packages. The dri libraries they contained are replaced by `mesa-dri-classic` and `mesa-dri-gallium`
- The other files (non dri libraries) are moved into the new packages `mesa-vdpau`, `mesa-XvMC`, `mesa-vulkan-intel`, `mesa-vulkan-radeon`
- `libGL` now depends on `mesa-dri-classic` and `mesa-dri-gallium`. Actually the plan for the future would be to make `mesa-dri-classic` a legacy option, but it's not possible now because `i965` is classic-only and its Gallium replacement, `iris`, is still experimental.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (35 preceding siblings ...)
  2019-10-26 13:18 ` voidlinux-github
@ 2019-10-27  6:17 ` voidlinux-github
  2019-10-27 10:55 ` voidlinux-github
                   ` (34 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27  6:17 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546665368

Comment:
Looks good to me conceptually! thanks (I didn't test)

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (36 preceding siblings ...)
  2019-10-27  6:17 ` voidlinux-github
@ 2019-10-27 10:55 ` voidlinux-github
  2019-10-27 10:58 ` voidlinux-github
                   ` (33 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 10:55 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546683247

Comment:
@Duncaen @q66 @leahneukirchen any opinion? lgtm on my side

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (37 preceding siblings ...)
  2019-10-27 10:55 ` voidlinux-github
@ 2019-10-27 10:58 ` voidlinux-github
  2019-10-27 10:58 ` voidlinux-github
                   ` (32 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 10:58 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546683394

Comment:
This is the one that fixes everything and avoids the hardlinks... ok.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (38 preceding siblings ...)
  2019-10-27 10:58 ` voidlinux-github
@ 2019-10-27 10:58 ` voidlinux-github
  2019-10-27 11:00 ` voidlinux-github
                   ` (31 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 10:58 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546683421

Comment:
life is strange... part 3

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (39 preceding siblings ...)
  2019-10-27 10:58 ` voidlinux-github
@ 2019-10-27 11:00 ` voidlinux-github
  2019-10-27 11:04 ` voidlinux-github
                   ` (30 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:00 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546683565

Comment:
I still see a musl FIXME in there, otherwise vaguely lgtm but I haven't tested

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (40 preceding siblings ...)
  2019-10-27 11:00 ` voidlinux-github
@ 2019-10-27 11:04 ` voidlinux-github
  2019-10-27 11:07 ` voidlinux-github
                   ` (29 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:04 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546683799

Comment:
The FIXME is about something I found that was already present before (a broken symlink, at least on my system on musl), but it's out of the scope of this PR I think. It's more like a TODO.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (41 preceding siblings ...)
  2019-10-27 11:04 ` voidlinux-github
@ 2019-10-27 11:07 ` voidlinux-github
  2019-10-27 11:10 ` voidlinux-github
                   ` (28 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:07 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546684011

Comment:
Sounds ok

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (42 preceding siblings ...)
  2019-10-27 11:07 ` voidlinux-github
@ 2019-10-27 11:10 ` voidlinux-github
  2019-10-27 11:23 ` voidlinux-github
                   ` (27 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:10 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546683799

Comment:
The FIXME is about something I found that was already present before (a broken symlink, at least on my system on musl), but it's out of the scope of this PR I think. It's more like "to investigate", but unrelated to the changes done here.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (43 preceding siblings ...)
  2019-10-27 11:10 ` voidlinux-github
@ 2019-10-27 11:23 ` voidlinux-github
  2019-10-27 11:24 ` voidlinux-github
                   ` (26 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:23 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546685172

Comment:
@st3r4g maybe lstat? 

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (44 preceding siblings ...)
  2019-10-27 11:23 ` voidlinux-github
@ 2019-10-27 11:24 ` voidlinux-github
  2019-10-27 11:34 ` voidlinux-github
                   ` (25 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:24 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546685220

Comment:
lstat aka lestat.... the vampire

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (45 preceding siblings ...)
  2019-10-27 11:24 ` voidlinux-github
@ 2019-10-27 11:34 ` voidlinux-github
  2019-10-27 11:36 ` voidlinux-github
                   ` (24 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:34 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546685926

Comment:
Ah, that symlink is broken because the file it points to is installed by `xorg-server`, which I didn't have installed some days ago.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (46 preceding siblings ...)
  2019-10-27 11:34 ` voidlinux-github
@ 2019-10-27 11:36 ` voidlinux-github
  2019-10-27 11:51 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (23 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:36 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546685926

Comment:
Ah, that symlink is broken because the file it points to is installed by `xorg-server`, which I didn't have installed some days ago. So not related at all with musl.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (47 preceding siblings ...)
  2019-10-27 11:36 ` voidlinux-github
@ 2019-10-27 11:51 ` voidlinux-github
  2019-10-27 11:51 ` voidlinux-github
                   ` (22 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:51 UTC (permalink / raw)
  To: ml

[-- 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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (48 preceding siblings ...)
  2019-10-27 11:51 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-10-27 11:51 ` voidlinux-github
  2019-10-27 12:00 ` voidlinux-github
                   ` (21 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 11:51 UTC (permalink / raw)
  To: ml

[-- 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

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (49 preceding siblings ...)
  2019-10-27 11:51 ` voidlinux-github
@ 2019-10-27 12:00 ` voidlinux-github
  2019-10-27 15:24 ` voidlinux-github
                   ` (20 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 12:00 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546685926

Comment:
Ah, that symlink is broken because the file it points to is installed by `xorg-server`, which I didn't have installed some days ago. So not related at all with musl.
But that's not important. Please check (at least mentally) that I have handled correctly the transition for all the archs, I could only test Intel on x86_64.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (50 preceding siblings ...)
  2019-10-27 12:00 ` voidlinux-github
@ 2019-10-27 15:24 ` voidlinux-github
  2019-11-02 10:14 ` voidlinux-github
                   ` (19 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-10-27 15:24 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-546685926

Comment:
Ah, that symlink was broken because the file it points to is installed by `xorg-server`, which I didn't have installed some days ago. So not related at all with musl.
But that's not important. Please check (at least mentally) that I have handled correctly the transition for all the arches, I could only test Intel on x86_64.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (51 preceding siblings ...)
  2019-10-27 15:24 ` voidlinux-github
@ 2019-11-02 10:14 ` voidlinux-github
  2019-11-02 12:55 ` voidlinux-github
                   ` (18 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-02 10:14 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-549029892

Comment:
@Duncaen @leahneukirchen @Gottox @Chocimier @jnbr @Johnnynator ?

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (52 preceding siblings ...)
  2019-11-02 10:14 ` voidlinux-github
@ 2019-11-02 12:55 ` voidlinux-github
  2019-11-10 10:15 ` voidlinux-github
                   ` (17 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-02 12:55 UTC (permalink / raw)
  To: ml

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

New comment by Gottox on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-549041221

Comment:
lgtm, but haven't tested either.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (53 preceding siblings ...)
  2019-11-02 12:55 ` voidlinux-github
@ 2019-11-10 10:15 ` voidlinux-github
  2019-11-10 10:17 ` voidlinux-github
                   ` (16 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-10 10:15 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-552181227

Comment:
The only possible thing that could "surprise" users that I'm seeing is that the `mesa-vdpau` and `mesa-XvMC` won't be provided by default anymore (they were part of the `dri` packages), but have to be manually installed if needed. These are `radeon` and `nouveau` libraries for hardware video acceleration, used by programs like `vlc` and `mpv`. I can't directly test, but I don't think their absence breaks anything, seeing that e.g. on archlinux `mesa-vdpau` is optional and `mesa-XvMC` is disabled altogether.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (54 preceding siblings ...)
  2019-11-10 10:15 ` voidlinux-github
@ 2019-11-10 10:17 ` voidlinux-github
  2019-11-10 10:36 ` voidlinux-github
                   ` (15 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-10 10:17 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-552181227

Comment:
The only possible thing that could "surprise" users that I'm seeing is that `mesa-vdpau` and `mesa-XvMC` won't be provided by default anymore (they were part of the `dri` packages), but have to be manually installed if needed. These are `radeon` and `nouveau` libraries for hardware video acceleration, used by programs like `vlc` and `mpv`. I can't directly test, but I don't think their absence breaks anything, seeing that e.g. on archlinux `mesa-vdpau` is optional and `mesa-XvMC` is disabled altogether.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (55 preceding siblings ...)
  2019-11-10 10:17 ` voidlinux-github
@ 2019-11-10 10:36 ` voidlinux-github
  2019-11-11 20:13 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (14 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-10 10:36 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-552181227

Comment:
The only possible thing that could "surprise" users that I'm seeing is that `mesa-vdpau` and `mesa-XvMC` won't be provided by default anymore (they were part of the `dri` packages), but have to be manually installed if needed. These are `radeon` and `nouveau` libraries for hardware video acceleration, used by programs like `vlc` and `mpv`. I can't directly test, but I don't think their absence breaks anything, seeing that e.g. on archlinux `mesa-vdpau` is optional and `mesa-XvMC` is disabled altogether.

Also, I've just seen that `common/shlibs` has entries for the `XvMC` libs:

> libXvMCr600.so.1 mesa-ati-dri-10.1.0_1
> libXvMCnouveau.so.1 mesa-nouveau-dri-10.1.0_1

but they don't appear to be used by other packages. I guess they can be removed.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Updated] [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (56 preceding siblings ...)
  2019-11-10 10:36 ` voidlinux-github
@ 2019-11-11 20:13 ` voidlinux-github
  2019-11-11 20:19 ` voidlinux-github
                   ` (13 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-11 20:13 UTC (permalink / raw)
  To: ml

[-- 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: 12531 bytes --]

From 3ab966fe072909e028c1f9e6f47085b477fe4278 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Mon, 11 Nov 2019 20:55:57 +0100
Subject: [PATCH 1/2] 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                        | 156 ++++++++++++------
 srcpkgs/mesa-XvMC                             |   1 +
 srcpkgs/mesa-dri-classic                      |   1 +
 srcpkgs/mesa-dri-gallium                      |   1 +
 srcpkgs/mesa-vaapi                            |   1 +
 srcpkgs/mesa-vdpau                            |   1 +
 srcpkgs/mesa-vulkan-intel                     |   1 +
 srcpkgs/mesa-vulkan-radeon                    |   1 +
 9 files changed, 129 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-vaapi
 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 7f00cef1a52..58f92541d2a 100644
--- a/srcpkgs/libGL/template
+++ b/srcpkgs/libGL/template
@@ -1,7 +1,7 @@
 # Template file for 'libGL'
 pkgname=libGL
 version=19.2.3
-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,12 @@ 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-vaapi"
+	subpackages+=" mesa-vdpau mesa-XvMC mesa-vulkan-intel mesa-vulkan-radeon"
+	subpackages+=" 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 +61,18 @@ ppc*)
 	esac
 	hostmakedepends+=" clang"
 	makedepends+=" libclc-git"
+	depends+=" mesa-dri-classic>=${version}_${revision}"
+	subpackages+=" mesa-dri-classic mesa-dri-gallium mesa-vaapi mesa-vdpau"
+	subpackages+=" mesa-XvMC 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-vaapi mesa-vdpau mesa-XvMC"
+	# Transitional dummy packages
 	subpackages+=" mesa-tegra-dri mesa-nouveau-dri mesa-vc4-dri"
 	;;
 armv7l*)
@@ -70,6 +80,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 +90,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 +119,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 +189,119 @@ 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"
 	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
+		done
+		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-vaapi_package() {
+	short_desc="Mesa VA-API drivers"
+	nostrip_files="nouveau_drv_video.so r600_drv_video.so
+	 radeonsi_drv_video.so"
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vmwgfx*"
-		vmove usr/lib/gallium-pipe/pipe_vmwgfx.so
+		vmove "usr/lib/dri/*_drv_video.so"
 	}
 }
 
-mesa-vc4-dri_package() {
-	short_desc="Mesa DRI drivers for Videocore IV GPU"
+mesa-vdpau_package() {
+	short_desc="Mesa VDPAU drivers"
+	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"
+	noshlibprovides=yes # manually set them in case they are needed
 	pkg_install() {
-		vmove "usr/lib/xorg/modules/drivers/vc4*"
+		vmove "usr/lib/vdpau/libvdpau_*"
 	}
 }
 
-mesa-opencl_package() {
-	short_desc="Mesa implementation of OpenCL (r600+ only)"
-	depends="libclc libOpenCL"
+mesa-XvMC_package() {
+	short_desc="Mesa XvMC drivers"
+	nostrip_files="libXvMCnouveau.so.1.0.0 libXvMCr600.so.1.0.0"
+	noshlibprovides=yes # manually set them in case they are needed
 	pkg_install() {
-		vmove etc/OpenCL
-		vmove "usr/lib/libMesaOpenCL*"
+		vmove "usr/lib/libXvMC*"
 	}
 }
 
-mesa-tegra-dri_package() {
-	short_desc="Mesa DRI drivers for Tegra GPU"
-	depends="mesa-nouveau-dri"
+mesa-vulkan-intel_package() {
+	short_desc="Mesa Intel Vulkan driver"
+	lib32files="/usr/share/vulkan/icd.d/intel_icd.i686.json"
+	pkg_install() {
+		vmove "usr/share/vulkan/icd.d/intel_icd*.json"
+		vmove "usr/lib/libvulkan_intel.so"
+	}
+}
+
+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-vaapi b/srcpkgs/mesa-vaapi
new file mode 120000
index 00000000000..5ef01dc565e
--- /dev/null
+++ b/srcpkgs/mesa-vaapi
@@ -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

From 6ce8f43380d3dee0795d0a663964197795880f21 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Mon, 11 Nov 2019 21:08:54 +0100
Subject: [PATCH 2/2] common/shlibs: remove unused mesa XvMC libs

---
 common/shlibs | 2 --
 1 file changed, 2 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 75e5418b687..2b9b0ab8058 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -305,8 +305,6 @@ libXfontcache.so.1 libXfontcache-1.0.4_1
 libXv.so.1 libXv-1.0.4_1
 libXvMC.so.1 libXvMC-1.0.4_1
 libXvMCW.so.1 libXvMC-1.0.4_1
-libXvMCr600.so.1 mesa-ati-dri-10.1.0_1
-libXvMCnouveau.so.1 mesa-nouveau-dri-10.1.0_1
 libxcb-errors.so.0 xcb-util-errors-1.0_1
 libxcb-icccm.so.4 xcb-util-wm-0.3.9_1
 libxcb-ewmh.so.2 xcb-util-wm-0.3.9_1

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (57 preceding siblings ...)
  2019-11-11 20:13 ` [PR PATCH] [Updated] " voidlinux-github
@ 2019-11-11 20:19 ` voidlinux-github
  2019-11-11 20:20 ` voidlinux-github
                   ` (12 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-11 20:19 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-552598580

Comment:
Improvements:

- `VA-API` stuff (`*_drv_video.so`) was split from `mesa-dri-gallium`
- Disabled automatic detection of provided shlibs for `mesa-vdpau` and `mesa-XvMC` (another thing that was broken due to the hard links)
- Removed mesa XvMC libs that were specified in `common/shlibs` but not actually used

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (58 preceding siblings ...)
  2019-11-11 20:19 ` voidlinux-github
@ 2019-11-11 20:20 ` voidlinux-github
  2019-11-11 20:21 ` voidlinux-github
                   ` (11 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-11 20:20 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-552598580

Comment:
Improvements:

- `VA-API` stuff (`*_drv_video.so`) was separated from `mesa-dri-gallium`
- Disabled automatic detection of provided shlibs for `mesa-vdpau` and `mesa-XvMC` (another thing that was broken due to the hard links)
- Removed mesa XvMC libs that were specified in `common/shlibs` but not actually used

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] libGL: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (59 preceding siblings ...)
  2019-11-11 20:20 ` voidlinux-github
@ 2019-11-11 20:21 ` voidlinux-github
  2019-12-25  7:40 ` [RFC] mesa: " voidlinux-github
                   ` (10 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-11-11 20:21 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-552599203

Comment:
Nice one buddy

El lun., 11 nov. 2019 21:19, Stefano Ragni <notifications@github.com>
escribió:

> Improvements:
>
>    - VA-API stuff (*_drv_video.so) was split from mesa-dri-gallium
>    - Disabled automatic detection of provided shlibs for mesa-vdpau and
>    mesa-XvMC (another thing that was broken due to the hard links)
>    - Removed mesa XvMC libs that were specified in common/shlibs but not
>    actually used
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <https://github.com/void-linux/void-packages/pull/15683?email_source=notifications&email_token=AAGR7KJXGTUV4TMEAKM3PVDQTG45TA5CNFSM4JDIFFHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDX7YNA#issuecomment-552598580>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AAGR7KJXWZ5NYZK64ZFHGCTQTG45TANCNFSM4JDIFFHA>
> .
>


^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (60 preceding siblings ...)
  2019-11-11 20:21 ` voidlinux-github
@ 2019-12-25  7:40 ` voidlinux-github
  2019-12-25  7:41 ` voidlinux-github
                   ` (9 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-25  7:40 UTC (permalink / raw)
  To: ml

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

New comment by q66 on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-568858280

Comment:
please rebase for 19.3.1, i think we can merge this then

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (61 preceding siblings ...)
  2019-12-25  7:40 ` [RFC] mesa: " voidlinux-github
@ 2019-12-25  7:41 ` voidlinux-github
  2019-12-25 15:48 ` voidlinux-github
                   ` (8 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-25  7:41 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-568858491

Comment:
yeah, this one is also good to have 

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (62 preceding siblings ...)
  2019-12-25  7:41 ` voidlinux-github
@ 2019-12-25 15:48 ` voidlinux-github
  2019-12-25 19:05 ` [PR PATCH] [Closed]: " voidlinux-github
                   ` (7 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-25 15:48 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-568910602

Comment:
no pc until the 27th

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [PR PATCH] [Closed]: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (63 preceding siblings ...)
  2019-12-25 15:48 ` voidlinux-github
@ 2019-12-25 19:05 ` voidlinux-github
  2019-12-27 17:03 ` voidlinux-github
                   ` (6 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-25 19:05 UTC (permalink / raw)
  To: ml

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

There's a closed pull request on the void-packages repository

[RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
https://github.com/void-linux/void-packages/pull/15683

Description:
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.


^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (64 preceding siblings ...)
  2019-12-25 19:05 ` [PR PATCH] [Closed]: " voidlinux-github
@ 2019-12-27 17:03 ` voidlinux-github
  2019-12-27 17:06 ` voidlinux-github
                   ` (5 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-27 17:03 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-569307621

Comment:
Why was this closed?

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (65 preceding siblings ...)
  2019-12-27 17:03 ` voidlinux-github
@ 2019-12-27 17:06 ` voidlinux-github
  2019-12-27 17:06 ` voidlinux-github
                   ` (4 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-27 17:06 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-569307621

Comment:
I rebased, but why was this closed?

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (66 preceding siblings ...)
  2019-12-27 17:06 ` voidlinux-github
@ 2019-12-27 17:06 ` voidlinux-github
  2019-12-27 17:09 ` voidlinux-github
                   ` (3 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-27 17:06 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-569307621

Comment:
I rebased now, but why was this closed?

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (67 preceding siblings ...)
  2019-12-27 17:06 ` voidlinux-github
@ 2019-12-27 17:09 ` voidlinux-github
  2019-12-27 17:53 ` voidlinux-github
                   ` (2 subsequent siblings)
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-27 17:09 UTC (permalink / raw)
  To: ml

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

New comment by xtraeme on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-569308793

Comment:
no idea :-)

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (68 preceding siblings ...)
  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
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-27 17:53 UTC (permalink / raw)
  To: ml

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

New comment by Johnnynator on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-569316034

Comment:
Also no idea, I probably missclicked somewhere :man_shrugging: , but I can't reopen because of the forced push. You need to open a new PR.

^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (69 preceding siblings ...)
  2019-12-27 17:53 ` voidlinux-github
@ 2019-12-27 18:42 ` voidlinux-github
  2019-12-27 18:42 ` voidlinux-github
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-27 18:42 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-569323855

Comment:
> but I can't reopen because of the forced push.
Ah, didn't know this. Well, no problem


^ permalink raw reply	[flat|nested] 73+ messages in thread

* Re: [RFC] mesa: reorganize dri drivers subpkgs (fixes debug info)
  2019-10-21 23:34 [PR PATCH] [WIP] xbps-src, libGL: fix debug symbols generation for mesa libraries voidlinux-github
                   ` (70 preceding siblings ...)
  2019-12-27 18:42 ` voidlinux-github
@ 2019-12-27 18:42 ` voidlinux-github
  71 siblings, 0 replies; 73+ messages in thread
From: voidlinux-github @ 2019-12-27 18:42 UTC (permalink / raw)
  To: ml

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

New comment by st3r4g on void-packages repository

https://github.com/void-linux/void-packages/pull/15683#issuecomment-569323855

Comment:
> but I can't reopen because of the forced push.

Ah, didn't know this. Well, no problem


^ permalink raw reply	[flat|nested] 73+ messages in thread

end of thread, other threads:[~2019-12-27 18:42 UTC | newest]

Thread overview: 73+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PR PATCH] [Updated] " voidlinux-github
2019-10-27 11:51 ` 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

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).