Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [RFC] libglvnd: depend on mesa
@ 2020-02-01 13:59 voidlinux-github
  2020-02-01 14:01 ` voidlinux-github
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: voidlinux-github @ 2020-02-01 13:59 UTC (permalink / raw)
  To: ml

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

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

https://github.com/st3r4g/void-packages libglvnd-depend-on-mesa
https://github.com/void-linux/void-packages/pull/18712

[RFC] libglvnd: depend on mesa
`libglvnd` doesn't currently install any OpenGL implementation, which makes GL unavailable ootb until the mesa drivers (package `mesa-dri`) are installed. This happens when installing `xorg-minimal` (which doesn't pull in the graphics drivers) or a Wayland compositor. Previously, `libGL` shipped the software rendering driver, so that GL was available (but not optimal), and users were expected to install the `mesa-...-dri` matching their GPU. Now that all dri drivers are in a single package, it is possible to provide hardware acceleration by default as soon as any program which links with GL is installed.
This PR modifies dependencies so that:
GL app -> libglvnd -> mesa -> mesa-dri

Caveats:

- Due to how xbps-src works (i.e. to avoid loops), a second libglvnd package must be introduced specifically to compile mesa (and kept in sync with the other one)
- xbps-src is not currently trying to build dependencies of subpackages. If it is changed to do so, loops will happen again as `libglvnd` appears as dependency in some subpackages (maybe those deps can be removed?)
- This will pull in the drivers also when building GL programs in chroot, which is unnecessary. Can it be avoided?

I initially thought about making `libglvnd` depend on a virtual `gl-vendor` which would be provided by `mesa` and `nvidia*`, but the nvidia packages required non-trivial modifications. Nvidia-only users can uninstall the mesa drivers via `ignorepkg` anyway.

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-libglvnd-depend-on-mesa-18712.patch --]
[-- Type: text/x-diff, Size: 4563 bytes --]

From 07880b12e2facda4c6595fe68138569c03b8665f Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Sat, 1 Feb 2020 13:40:21 +0100
Subject: [PATCH 1/3] New package: libglvnd-core-devel-1.3.0

---
 srcpkgs/libglvnd-core-devel/template | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 srcpkgs/libglvnd-core-devel/template

diff --git a/srcpkgs/libglvnd-core-devel/template b/srcpkgs/libglvnd-core-devel/template
new file mode 100644
index 00000000000..230fa3994c1
--- /dev/null
+++ b/srcpkgs/libglvnd-core-devel/template
@@ -0,0 +1,24 @@
+# Template file for 'libglvnd-core-devel'
+pkgname=libglvnd-core-devel
+version=1.3.0
+revision=1
+wrksrc="libglvnd-v${version}"
+build_style=meson
+configure_args="-Dasm=disabled -Dx11=disabled -Degl=false -Dglx=disabled
+ -Dgles1=false -Dgles2=false -Dheaders=false"
+short_desc="GL Vendor-Neutral Dispatch library - core headers for vendors"
+maintainer="Stefano Ragni <st3r4g@protonmail.com>"
+license="custom:MIT-alike"
+homepage="https://gitlab.freedesktop.org/glvnd/libglvnd"
+distfiles="https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v${version}/libglvnd-v${version}.tar.gz"
+checksum=e336ac2340105c4f21412260e5b1db17a9ce1cef27aa708a63aed293c670c1b4
+
+conflicts="libglvnd libglvnd-devel"
+
+post_install() {
+	rm ${DESTDIR}/usr/lib/lib*.so*
+	rm ${DESTDIR}/usr/lib/pkgconfig/opengl.pc
+
+	grep -A 25 "Copyright (c) 2013, NVIDIA CORPORATION." README.md > LICENSE
+	vlicense LICENSE
+}

From 8a179dca8281385403cd1d4b0a3775330453d6cb Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Sat, 1 Feb 2020 13:42:50 +0100
Subject: [PATCH 2/3] mesa: adapt to be pulled by libglvnd

---
 srcpkgs/mesa/template | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/mesa/template b/srcpkgs/mesa/template
index 56ef2db18f3..a1895db32e8 100644
--- a/srcpkgs/mesa/template
+++ b/srcpkgs/mesa/template
@@ -1,7 +1,7 @@
 # Template file for 'mesa'
 pkgname=mesa
 version=19.3.3
-revision=1
+revision=2
 wrksrc="mesa-${version}"
 build_style=meson
 configure_args="-Dglvnd=true -Dshared-glapi=true -Dgbm=true -Degl=true
@@ -16,8 +16,8 @@ makedepends="elfutils-devel expat-devel libXdamage-devel libXvMC-devel
  libXxf86vm-devel libatomic-devel libdrm-devel libffi-devel libva-devel
  libvdpau-devel libxshmfence-devel ncurses-devel talloc-devel zlib-devel
  $(vopt_if wayland 'wayland-devel wayland-protocols') llvm
- libsensors-devel libXrandr-devel libglvnd-devel"
-depends="libglvnd"
+ libsensors-devel libXrandr-devel libglvnd-core-devel"
+depends="mesa-dri-${version}_${revision}"
 short_desc="Graphics library similar to SGI's OpenGL"
 maintainer="Juan RP <xtraeme@gmail.com>"
 license="MIT, LGPL-2.1-or-later"
@@ -142,6 +142,8 @@ post_install() {
 }
 
 libglapi_package() {
+	# this is not a real dependency, just a hack for 32bit to allow the
+	# transition to libglvnd-32bit (e.g. for steam)
 	depends="libglvnd"
 	short_desc="Free implementation of the GL API - shared library"
 	pkg_install() {
@@ -198,7 +200,6 @@ mesa-opencl_package() {
 
 mesa-dri_package() {
 	short_desc="Mesa DRI drivers"
-	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

From 9edf4b939ba9798e49836865e8ce57112ad665d9 Mon Sep 17 00:00:00 2001
From: Stefano Ragni <st3r4g@protonmail.com>
Date: Sat, 1 Feb 2020 13:43:40 +0100
Subject: [PATCH 3/3] libglvnd: depend on mesa

Also grep license from README
---
 srcpkgs/libglvnd/template | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/libglvnd/template b/srcpkgs/libglvnd/template
index b66208f2a3e..f28e51b8d11 100644
--- a/srcpkgs/libglvnd/template
+++ b/srcpkgs/libglvnd/template
@@ -1,11 +1,13 @@
 # Template file for 'libglvnd'
+# on updates,'libglvnd-core-devel' must also be updated
 pkgname=libglvnd
 version=1.3.0
-revision=1
+revision=2
 wrksrc="libglvnd-v${version}"
 build_style=meson
 hostmakedepends="pkg-config"
 makedepends="libXext-devel libX11-devel xorgproto"
+depends="mesa"
 short_desc="GL Vendor-Neutral Dispatch library"
 maintainer="Stefano Ragni <st3r4g@protonmail.com>"
 license="custom:MIT-alike"
@@ -27,7 +29,7 @@ case "$XBPS_TARGET_MACHINE" in
 esac
 
 post_install() {
-	$XBPS_FETCH_CMD "https://git.archlinux.org/svntogit/packages.git/plain/trunk/LICENSE?h=packages/libglvnd>LICENSE"
+	grep -A 25 "Copyright (c) 2013, NVIDIA CORPORATION." README.md > LICENSE
 	vlicense LICENSE
 }
 

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

end of thread, other threads:[~2022-04-29  2:13 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-01 13:59 [PR PATCH] [RFC] libglvnd: depend on mesa voidlinux-github
2020-02-01 14:01 ` voidlinux-github
2020-02-01 14:02 ` voidlinux-github
2020-02-01 16:58 ` voidlinux-github
2020-02-01 17:15 ` voidlinux-github
2020-02-03  7:13 ` voidlinux-github
2020-02-03 10:57 ` voidlinux-github
2020-11-01  2:30 ` ericonr
2020-11-01  6:53 ` st3r4g
2020-11-02  0:12 ` ericonr
2021-01-04 13:55 ` st3r4g
2021-01-04 14:10 ` ericonr
2022-04-15  2:13 ` github-actions
2022-04-29  2:13 ` [PR PATCH] [Closed]: " github-actions

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