Github messages for voidlinux
 help / color / mirror / Atom feed
From: q66 <q66@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] mesa: use symlinks for megadrivers + correctness fixes
Date: Thu, 04 Nov 2021 16:10:33 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-33899@inbox.vuxu.org> (raw)

[-- 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*"
 	}
 }

             reply	other threads:[~2021-11-04 15:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 15:10 q66 [this message]
2021-11-04 15:30 ` [PR PATCH] [Updated] " q66
2021-11-04 15:55 ` [PR PATCH] [Merged]: " q66

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-33899@inbox.vuxu.org \
    --to=q66@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).