Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] mesa: use symlinks for megadrivers + correctness fixes
@ 2021-11-04 15:10 q66
  2021-11-04 15:30 ` [PR PATCH] [Updated] " q66
  2021-11-04 15:55 ` [PR PATCH] [Merged]: " q66
  0 siblings, 2 replies; 3+ messages in thread
From: q66 @ 2021-11-04 15:10 UTC (permalink / raw)
  To: ml

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

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages mesa-symlinks
https://github.com/void-linux/void-packages/pull/33899

mesa: use symlinks for megadrivers + correctness fixes
This is now using symlinks for megadrivers, which should eliminate
pretty much all of the sketchy strip stuff. In addition:

1) pipe drivers are now installed in opencl where they should be
2) ditched redundant devel dependencies (most of those were made
   redundant by glvnd, some of them were always redundant)

cc @HadetTheUndying 

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

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

From a5d95423abc34b63a84e00e9b5ca825036400ae9 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Thu, 4 Nov 2021 16:05:41 +0100
Subject: [PATCH] mesa: use symlinks for megadrivers + correctness fixes

This is now using symlinks for megadrivers, which should eliminate
pretty much all of the sketchy strip stuff. In addition:

1) pipe drivers are now installed in opencl where they should be
2) ditched redundant devel dependencies (most of those were made
   redundant by glvnd, some of them were always redundant)
---
 .../mesa/patches/megadriver-symlinks.patch    | 25 ++++++++++++++++++
 .../mesa/patches/no-unlink-megadrivers.patch  | 15 -----------
 srcpkgs/mesa/template                         | 26 +++++--------------
 3 files changed, 31 insertions(+), 35 deletions(-)
 create mode 100644 srcpkgs/mesa/patches/megadriver-symlinks.patch
 delete mode 100644 srcpkgs/mesa/patches/no-unlink-megadrivers.patch

diff --git a/srcpkgs/mesa/patches/megadriver-symlinks.patch b/srcpkgs/mesa/patches/megadriver-symlinks.patch
new file mode 100644
index 000000000000..c19c42719422
--- /dev/null
+++ b/srcpkgs/mesa/patches/megadriver-symlinks.patch
@@ -0,0 +1,25 @@
+This converts megadriver installation to use symlinks so that we do
+not have to deal with skipping the strip stage for some files, as
+a result simplifying our template greatly.
+
+--- a/bin/install_megadrivers.py
++++ b/bin/install_megadrivers.py
+@@ -56,7 +56,7 @@ def main():
+         if os.path.lexists(abs_driver):
+             os.unlink(abs_driver)
+         print('installing {} to {}'.format(args.megadriver, abs_driver))
+-        os.link(master, abs_driver)
++        os.symlink(os.path.basename(master), abs_driver)
+ 
+         try:
+             ret = os.getcwd()
+@@ -71,8 +71,7 @@ def main():
+         finally:
+             os.chdir(ret)
+ 
+-    # Remove meson-created master .so and symlinks
+-    os.unlink(master)
++    # Remove meson-created symlinks
+     name, ext = os.path.splitext(master)
+     while ext != '.so':
+         if os.path.lexists(name):
diff --git a/srcpkgs/mesa/patches/no-unlink-megadrivers.patch b/srcpkgs/mesa/patches/no-unlink-megadrivers.patch
deleted file mode 100644
index acad4dd6390e..000000000000
--- a/srcpkgs/mesa/patches/no-unlink-megadrivers.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-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
---- a/bin/install_megadrivers.py
-+++ b/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/mesa/template b/srcpkgs/mesa/template
index d6f47316bdc1..066dec7f9e69 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=21.2.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
@@ -254,17 +254,15 @@ libOSMesa_package() {
 }
 
 MesaLib-devel_package() {
-	depends="xorgproto libxshmfence-devel libXext-devel libXxf86vm-devel
-	 libXdamage-devel expat-devel libXfixes-devel libX11-devel libxcb-devel
-	 libdrm-devel libglvnd-devel
-	 libOSMesa>=${version}_${revision} libgbm>=${version}_${revision}
-	 mesa>=${version}_${revision}"
+	depends="mesa>=${version}_${revision} libOSMesa>=${version}_${revision}
+	 libgbm>=${version}_${revision}"
 	if [ "$_have_vmware" ]; then
 		depends+=" libxatracker>=${version}_${revision}"
 	fi
 	if [ "$_have_opencl" ]; then
 		depends+=" mesa-opencl>=${version}_${revision}"
 	fi
+	depends+=" libdrm-devel libglvnd-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include
@@ -295,6 +293,7 @@ mesa-opencl_package() {
 	depends="libclc"
 	pkg_install() {
 		vmove etc/OpenCL
+		vmove usr/lib/gallium-pipe
 		vmove "usr/lib/libMesaOpenCL.so.*"
 	}
 }
@@ -304,14 +303,7 @@ mesa-dri_package() {
 	depends="mesa-${version}_${revision}"
 	shlib_provides="libgallium_dri.so" # workaround for mesa-dri-32bit
 	pkg_install() {
-		# Only strip each megadriver once, via its master filename
-		nostrip_files=$(find "${DESTDIR}/usr/lib/dri" \
-		 ! -name 'libmesa_dri_drivers.so' ! -name 'libgallium_dri.so' \
-		  -type f -printf '%f ')
-		vmove "usr/lib/dri"
-		if [ -d "$DESTDIR/usr/lib/gallium-pipe" ]; then
-			vmove "usr/lib/gallium-pipe/pipe_*.so"
-		fi
+		vmove usr/lib/dri
 	}
 }
 
@@ -319,8 +311,6 @@ mesa-vaapi_package() {
 	short_desc="Mesa VA-API drivers"
 	shlib_provides="libgallium_drv_video.so" # workaround for mesa-vaapi-32bit
 	pkg_install() {
-		nostrip_files=$(find "${DESTDIR}/usr/lib/dri" \
-		 ! -name 'libgallium_drv_video.so' -type f -printf '%f ')
 		vmove "usr/lib/dri/*_drv_video.so"
 	}
 }
@@ -328,8 +318,6 @@ mesa-vaapi_package() {
 mesa-vdpau_package() {
 	short_desc="Mesa VDPAU drivers"
 	pkg_install() {
-		nostrip_files=$(find "${DESTDIR}/usr/lib/vdpau" \
-		 ! -name 'libvdpau_gallium.so*' -type f -printf '%f ')
 		vmove "usr/lib/vdpau/libvdpau_*"
 	}
 }
@@ -337,8 +325,6 @@ mesa-vdpau_package() {
 mesa-XvMC_package() {
 	short_desc="Mesa XvMC drivers"
 	pkg_install() {
-		nostrip_files=$(find "${DESTDIR}/usr/lib/libXvMC"* \
-		 ! -name 'libXvMCgallium.so' -type f -printf '%f ')
 		vmove "usr/lib/libXvMC*"
 	}
 }

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

* Re: [PR PATCH] [Updated] mesa: use symlinks for megadrivers + correctness fixes
  2021-11-04 15:10 [PR PATCH] mesa: use symlinks for megadrivers + correctness fixes q66
@ 2021-11-04 15:30 ` q66
  2021-11-04 15:55 ` [PR PATCH] [Merged]: " q66
  1 sibling, 0 replies; 3+ messages in thread
From: q66 @ 2021-11-04 15:30 UTC (permalink / raw)
  To: ml

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

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

https://github.com/void-ppc/void-packages mesa-symlinks
https://github.com/void-linux/void-packages/pull/33899

mesa: use symlinks for megadrivers + correctness fixes
This is now using symlinks for megadrivers, which should eliminate
pretty much all of the sketchy strip stuff. In addition:

1) pipe drivers are now installed in opencl where they should be
2) ditched redundant devel dependencies (most of those were made
   redundant by glvnd, some of them were always redundant)

cc @HadetTheUndying 

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

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

From 6bc4841ca57e6459f8db6898202aca77c4e97005 Mon Sep 17 00:00:00 2001
From: Hill Ma <maahiuzeon@gmail.com>
Date: Thu, 4 Nov 2021 16:28:41 +0100
Subject: [PATCH 1/3] mesa: separate out libgbm-devel

---
 srcpkgs/libgbm-devel  |  1 +
 srcpkgs/mesa/template | 15 ++++++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)
 create mode 120000 srcpkgs/libgbm-devel

diff --git a/srcpkgs/libgbm-devel b/srcpkgs/libgbm-devel
new file mode 120000
index 000000000000..1ad1bbec7ab3
--- /dev/null
+++ b/srcpkgs/libgbm-devel
@@ -0,0 +1 @@
+mesa
\ No newline at end of file
diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index d6f47316bdc1..37ba69371a46 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -37,7 +37,7 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 
 # Set subpackages manually to set proper rdeps in 32bit pkgs.
-subpackages="libglapi libgbm libOSMesa"
+subpackages="libglapi libgbm libgbm-devel libOSMesa"
 
 # Replace old mesa pkgs, superseded by libglvnd.
 replaces="libGL>=10_1<19.2.5_2 libEGL>=10_1<19.2.5_2 libGLES>=10_1<19.2.5_2"
@@ -246,6 +246,16 @@ libgbm_package() {
 	}
 }
 
+libgbm-devel_package() {
+	short_desc="Mesa Generic buffer management API - development files"
+	depends="libgbm>=${version}_${revision}"
+	pkg_install() {
+		vmove usr/include/gbm.h
+		vmove usr/lib/libgbm.so
+		vmove usr/lib/pkgconfig/gbm.pc
+	}
+}
+
 libOSMesa_package() {
 	short_desc="Mesa Off-Screen interface library"
 	pkg_install() {
@@ -257,7 +267,7 @@ MesaLib-devel_package() {
 	depends="xorgproto libxshmfence-devel libXext-devel libXxf86vm-devel
 	 libXdamage-devel expat-devel libXfixes-devel libX11-devel libxcb-devel
 	 libdrm-devel libglvnd-devel
-	 libOSMesa>=${version}_${revision} libgbm>=${version}_${revision}
+	 libOSMesa>=${version}_${revision} libgbm-devel>=${version}_${revision}
 	 mesa>=${version}_${revision}"
 	if [ "$_have_vmware" ]; then
 		depends+=" libxatracker>=${version}_${revision}"
@@ -272,7 +282,6 @@ MesaLib-devel_package() {
 		vmove usr/lib/libEGL_mesa.so
 		vmove usr/lib/libGLX_mesa.so
 		vmove usr/lib/libOSMesa.so
-		vmove usr/lib/libgbm.so
 		vmove usr/lib/libglapi.so
 		if [ "$_have_vmware" ]; then
 			vmove usr/lib/libxatracker.so

From a1494575295f4161747f6c47022bd316bfe60770 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Thu, 4 Nov 2021 16:05:41 +0100
Subject: [PATCH 2/3] mesa: use symlinks for megadrivers + correctness fixes

This is now using symlinks for megadrivers, which should eliminate
pretty much all of the sketchy strip stuff. In addition:

1) pipe drivers are now installed in opencl where they should be
2) ditched redundant devel dependencies (most of those were made
   redundant by glvnd, some of them were always redundant)
---
 .../mesa/patches/megadriver-symlinks.patch    | 25 ++++++++++++++++++
 .../mesa/patches/no-unlink-megadrivers.patch  | 15 -----------
 srcpkgs/mesa/template                         | 26 +++++--------------
 3 files changed, 31 insertions(+), 35 deletions(-)
 create mode 100644 srcpkgs/mesa/patches/megadriver-symlinks.patch
 delete mode 100644 srcpkgs/mesa/patches/no-unlink-megadrivers.patch

diff --git a/srcpkgs/mesa/patches/megadriver-symlinks.patch b/srcpkgs/mesa/patches/megadriver-symlinks.patch
new file mode 100644
index 000000000000..c19c42719422
--- /dev/null
+++ b/srcpkgs/mesa/patches/megadriver-symlinks.patch
@@ -0,0 +1,25 @@
+This converts megadriver installation to use symlinks so that we do
+not have to deal with skipping the strip stage for some files, as
+a result simplifying our template greatly.
+
+--- a/bin/install_megadrivers.py
++++ b/bin/install_megadrivers.py
+@@ -56,7 +56,7 @@ def main():
+         if os.path.lexists(abs_driver):
+             os.unlink(abs_driver)
+         print('installing {} to {}'.format(args.megadriver, abs_driver))
+-        os.link(master, abs_driver)
++        os.symlink(os.path.basename(master), abs_driver)
+ 
+         try:
+             ret = os.getcwd()
+@@ -71,8 +71,7 @@ def main():
+         finally:
+             os.chdir(ret)
+ 
+-    # Remove meson-created master .so and symlinks
+-    os.unlink(master)
++    # Remove meson-created symlinks
+     name, ext = os.path.splitext(master)
+     while ext != '.so':
+         if os.path.lexists(name):
diff --git a/srcpkgs/mesa/patches/no-unlink-megadrivers.patch b/srcpkgs/mesa/patches/no-unlink-megadrivers.patch
deleted file mode 100644
index acad4dd6390e..000000000000
--- a/srcpkgs/mesa/patches/no-unlink-megadrivers.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-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
---- a/bin/install_megadrivers.py
-+++ b/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/mesa/template b/srcpkgs/mesa/template
index 37ba69371a46..6c3b705002cb 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=21.2.5
-revision=1
+revision=2
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=enabled -Dgbm=enabled -Degl=enabled
  -Dosmesa=true -Dgles1=enabled -Dgles2=enabled -Dglx=dri -Ddri3=enabled
@@ -264,17 +264,15 @@ libOSMesa_package() {
 }
 
 MesaLib-devel_package() {
-	depends="xorgproto libxshmfence-devel libXext-devel libXxf86vm-devel
-	 libXdamage-devel expat-devel libXfixes-devel libX11-devel libxcb-devel
-	 libdrm-devel libglvnd-devel
-	 libOSMesa>=${version}_${revision} libgbm-devel>=${version}_${revision}
-	 mesa>=${version}_${revision}"
+	depends="mesa>=${version}_${revision} libOSMesa>=${version}_${revision}
+	 libgbm-devel>=${version}_${revision}"
 	if [ "$_have_vmware" ]; then
 		depends+=" libxatracker>=${version}_${revision}"
 	fi
 	if [ "$_have_opencl" ]; then
 		depends+=" mesa-opencl>=${version}_${revision}"
 	fi
+	depends+=" libdrm-devel libglvnd-devel"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include
@@ -304,6 +302,7 @@ mesa-opencl_package() {
 	depends="libclc"
 	pkg_install() {
 		vmove etc/OpenCL
+		vmove usr/lib/gallium-pipe
 		vmove "usr/lib/libMesaOpenCL.so.*"
 	}
 }
@@ -313,14 +312,7 @@ mesa-dri_package() {
 	depends="mesa-${version}_${revision}"
 	shlib_provides="libgallium_dri.so" # workaround for mesa-dri-32bit
 	pkg_install() {
-		# Only strip each megadriver once, via its master filename
-		nostrip_files=$(find "${DESTDIR}/usr/lib/dri" \
-		 ! -name 'libmesa_dri_drivers.so' ! -name 'libgallium_dri.so' \
-		  -type f -printf '%f ')
-		vmove "usr/lib/dri"
-		if [ -d "$DESTDIR/usr/lib/gallium-pipe" ]; then
-			vmove "usr/lib/gallium-pipe/pipe_*.so"
-		fi
+		vmove usr/lib/dri
 	}
 }
 
@@ -328,8 +320,6 @@ mesa-vaapi_package() {
 	short_desc="Mesa VA-API drivers"
 	shlib_provides="libgallium_drv_video.so" # workaround for mesa-vaapi-32bit
 	pkg_install() {
-		nostrip_files=$(find "${DESTDIR}/usr/lib/dri" \
-		 ! -name 'libgallium_drv_video.so' -type f -printf '%f ')
 		vmove "usr/lib/dri/*_drv_video.so"
 	}
 }
@@ -337,8 +327,6 @@ mesa-vaapi_package() {
 mesa-vdpau_package() {
 	short_desc="Mesa VDPAU drivers"
 	pkg_install() {
-		nostrip_files=$(find "${DESTDIR}/usr/lib/vdpau" \
-		 ! -name 'libvdpau_gallium.so*' -type f -printf '%f ')
 		vmove "usr/lib/vdpau/libvdpau_*"
 	}
 }
@@ -346,8 +334,6 @@ mesa-vdpau_package() {
 mesa-XvMC_package() {
 	short_desc="Mesa XvMC drivers"
 	pkg_install() {
-		nostrip_files=$(find "${DESTDIR}/usr/lib/libXvMC"* \
-		 ! -name 'libXvMCgallium.so' -type f -printf '%f ')
 		vmove "usr/lib/libXvMC*"
 	}
 }

From f4b603da5d710fd3cf941c1361fd67935db8247d Mon Sep 17 00:00:00 2001
From: Hill Ma <maahiuzeon@gmail.com>
Date: Thu, 15 Apr 2021 19:44:16 -0700
Subject: [PATCH 3/3] wlroots: replace MesaLib-devel with libgbm-devel and
 libglvnd-devel.

---
 srcpkgs/wlroots/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/wlroots/template b/srcpkgs/wlroots/template
index da514da32304..8fdc2ba6ab40 100644
--- a/srcpkgs/wlroots/template
+++ b/srcpkgs/wlroots/template
@@ -7,7 +7,7 @@ build_style=meson
 # https://github.com/swaywm/wlroots/wiki/Packaging-recommendations
 configure_args="--auto-features=enabled -Dexamples=false -Dwerror=false -Db_ndebug=false"
 hostmakedepends="pkg-config wayland-devel"
-_devel_depends="MesaLib-devel libseat-devel eudev-libudev-devel libdrm-devel
+_devel_depends="libgbm-devel libglvnd-devel libseat-devel eudev-libudev-devel libdrm-devel
  libinput-devel libxkbcommon-devel pixman-devel wayland-devel wayland-protocols
  xcb-util-errors-devel xcb-util-wm-devel xcb-util-renderutil-devel"
 makedepends="${_devel_depends}

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

* Re: [PR PATCH] [Merged]: mesa: use symlinks for megadrivers + correctness fixes
  2021-11-04 15:10 [PR PATCH] mesa: use symlinks for megadrivers + correctness fixes q66
  2021-11-04 15:30 ` [PR PATCH] [Updated] " q66
@ 2021-11-04 15:55 ` q66
  1 sibling, 0 replies; 3+ messages in thread
From: q66 @ 2021-11-04 15:55 UTC (permalink / raw)
  To: ml

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

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

mesa: use symlinks for megadrivers + correctness fixes
https://github.com/void-linux/void-packages/pull/33899

Description:
This is now using symlinks for megadrivers, which should eliminate
pretty much all of the sketchy strip stuff. In addition:

1) pipe drivers are now installed in opencl where they should be
2) ditched redundant devel dependencies (most of those were made
   redundant by glvnd, some of them were always redundant)

cc @HadetTheUndying 

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

end of thread, other threads:[~2021-11-04 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04 15:10 [PR PATCH] mesa: use symlinks for megadrivers + correctness fixes q66
2021-11-04 15:30 ` [PR PATCH] [Updated] " q66
2021-11-04 15:55 ` [PR PATCH] [Merged]: " q66

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