Date: Fri, 18 Jun 2021 15:46:05 -0700 From: Kevin Bowling <kevin.bowling@kev009.com> To: Baptiste Daroussin <bapt@freebsd.org> Cc: Kevin Bowling <kbowling@freebsd.org>, ports-committers <ports-committers@freebsd.org>, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org Subject: Re: git: b44acc9409bd - main - graphics/mesa-libs: enable libglvnd support Message-ID: <CAK7dMtBSkTujvQogs0W4rSzbU%2BU=1z05u3OEukdcPObrCdi7Uw@mail.gmail.com> In-Reply-To: <1ac24e08-fe77-4cb1-934a-50439a71c72e@FreeBSD.org> References: <202106170426.15H4Q4kS068821@gitrepo.freebsd.org> <1ac24e08-fe77-4cb1-934a-50439a71c72e@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 18, 2021 at 1:25 PM Baptiste Daroussin <bapt@freebsd.org> wrote= : > > > 17 juin 2021 06:26:08 Kevin Bowling <kbowling@FreeBSD.org>: > > > The branch main has been updated by kbowling: > > > > URL: https://cgit.FreeBSD.org/ports/commit/?id=3Db44acc9409bd3bdd92e86e= 35c06d50e2134b02f2 > > > > commit b44acc9409bd3bdd92e86e35c06d50e2134b02f2 > > Author: Jan Beich <jbeich@FreeBSD.org> > > AuthorDate: 2021-06-16 15:48:02 +0000 > > Commit: Kevin Bowling <kbowling@FreeBSD.org> > > CommitDate: 2021-06-17 04:25:27 +0000 > > > > graphics/mesa-libs: enable libglvnd support > > > > PR: 246767 > > Reviewed by: kbowling > > Tested by: kbowling > > Differential Revision: https://reviews.freebsd.org/D25020 > > > As I privately told Kevin, I am now replying here as it can be useful for= other committers. > > This commit causes a situation I would call an impossible upgrades. If yo= u have an ancient version of mesa-libs installed you cannot uograde to the = new version of mesa-libs you need to first remove mesa-libs then install li= bglvnd then install mesa-libs. Pkg knows how to deal with such situation up= to a limit. > > So first it is complicated because during that manipulation the system is= in an instable situation: lack of mesa-libs while things still depends on = it. > > Second if anything installed depends on mesa-libs but does not itself has= to be reinstall from the repo it will block the removal (sat solver blabla= bla message) > > To help it when you do such modification please bump portrevision of all = reverse dependencies! It should have be done anyway but most committers oft= en miss doing it. > > Best regards, > Bapt I'm fine prepping a review of this, I just want to be clear, increment PORTREVISION on around 800 ports that depended on mesa-libs? I've only seen the one report of SAT failures with xephyr so far. The SAT solver worked fine on my kde5 desktops. But I'd like to facilitate a smooth transition for everyone so happy to do whatever is needed. Regards, Kevin > > --- > > Mk/Uses/gl.mk | 10 ++--- > > Mk/bsd.default-versions.mk | 4 +- > > graphics/glad/Makefile | 2 +- > > graphics/libglvnd/Makefile | 4 +- > > graphics/mesa-devel/Makefile | 1 + > > graphics/mesa-libs/Makefile | 9 ++++- > > graphics/mesa-libs/pkg-plist | 76 +++++++++++++++++++------------= ------- > > misc/raspberrypi-userland/Makefile | 2 +- > > x11/nvidia-driver/Makefile | 30 +++++++++------ > > x11/nvidia-driver/pkg-plist | 6 +-- > > 10 files changed, 81 insertions(+), 63 deletions(-) > > > > diff --git a/Mk/Uses/gl.mk b/Mk/Uses/gl.mk > > index eb8850774b29..7d71d9724d92 100644 > > --- a/Mk/Uses/gl.mk > > +++ b/Mk/Uses/gl.mk > > @@ -13,12 +13,12 @@ > > .if !defined(_INCLUDE_USES_GL_MK) > > _INCLUDE_USES_GL_MK=3Dyes > > > > -_GL_egl_LIB_DEPENDS=3D libEGL.so:graphics/mesa-libs > > -_GL_gbm_LIB_DEPENDS=3D libgbm.so:graphics/mesa-libs > > -_GL_gl_LIB_DEPENDS=3D libGL.so:graphics/mesa-libs > > +_GL_egl_LIB_DEPENDS=3D libEGL.so:graphics/${GL_DEFAULT:S/,/ /g:[1]} > > +_GL_gbm_LIB_DEPENDS=3D libgbm.so:graphics/${GL_DEFAULT:S/,/ /g:[-1]} > > +_GL_gl_LIB_DEPENDS=3D libGL.so:graphics/${GL_DEFAULT:S/,/ /g:[1]} > > _GL_gl_USE_XORG=3D xorgproto > > -_GL_glesv1_LIB_DEPENDS=3D libGLESv1_CM.so:graphics/mesa-libs > > -_GL_glesv2_LIB_DEPENDS=3D libGLESv2.so:graphics/mesa-libs > > +_GL_glesv1_LIB_DEPENDS=3D libGLESv1_CM.so:graphics/${GL_DEFAULT:S/,= / /g:[1]} > > +_GL_glesv2_LIB_DEPENDS=3D libGLESv2.so:graphics/${GL_DEFAULT:S/,/ /= g:[1]} > > _GL_glew_LIB_DEPENDS=3D libGLEW.so:graphics/glew > > _GL_glu_LIB_DEPENDS=3D libGLU.so:graphics/libGLU > > _GL_glu_USE_XORG=3D xorgproto > > diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk > > index f923ca84ff36..a3b836ea2fee 100644 > > --- a/Mk/bsd.default-versions.mk > > +++ b/Mk/bsd.default-versions.mk > > @@ -17,7 +17,7 @@ _INCLUDE_BSD_DEFAULT_VERSIONS_MK=3D yes > > > > LOCALBASE?=3D /usr/local > > > > -.for lang in APACHE BDB COROSYNC EMACS FIREBIRD FORTRAN FPC GCC GHOSTS= CRIPT \ > > +.for lang in APACHE BDB COROSYNC EMACS FIREBIRD FORTRAN FPC GCC GHOSTS= CRIPT GL \ > > IMAGEMAGICK JAVA LAZARUS LIBRSVG2 LINUX LLVM LUA MYSQL NINJA PERL5 \ > > PGSQL PHP PYTHON PYTHON2 PYTHON3 RUBY RUST SAMBA SSL TCLTK VARNISH > > .if defined(${lang}_DEFAULT) > > @@ -51,6 +51,8 @@ GCC_DEFAULT?=3D 8 > > .else > > GCC_DEFAULT?=3D 10 > > .endif > > +# Possible values (tuple): libglvnd, mesa-libs, mesa-devel > > +GL_DEFAULT?=3D libglvnd,mesa-libs > > # Possible values: 7, 8, 9, agpl > > GHOSTSCRIPT_DEFAULT?=3D agpl > > # Possible values: 6, 6-nox11, 7, 7-nox11 > > diff --git a/graphics/glad/Makefile b/graphics/glad/Makefile > > index df7f0cb77d73..e1508f82da6e 100644 > > --- a/graphics/glad/Makefile > > +++ b/graphics/glad/Makefile > > @@ -16,6 +16,6 @@ USE_LDCONFIG=3D yes > > > > CMAKE_ON=3D GLAD_INSTALL BUILD_SHARED_LIBS GLAD_REPRODUCIBLE > > > > -CONFLICTS_INSTALL=3D mesa-libs # include/KHR/khrplatform.h, see https:= //github.com/Dav1dde/glad/issues/260 > > +CONFLICTS_INSTALL=3D libglvnd # include/KHR/khrplatform.h, see https:/= /github.com/Dav1dde/glad/issues/260 > > > > .include <bsd.port.mk> > > diff --git a/graphics/libglvnd/Makefile b/graphics/libglvnd/Makefile > > index f0f2e55f8c1d..c8babe24ac12 100644 > > --- a/graphics/libglvnd/Makefile > > +++ b/graphics/libglvnd/Makefile > > @@ -2,14 +2,12 @@ PORTNAME=3D libglvnd > > DISTVERSION=3D 1.3.2 > > CATEGORIES=3D graphics > > > > -MAINTAINER=3D greg@unrelenting.technology > > +MAINTAINER=3D x11@FreeBSD.org > > COMMENT=3D GL Vendor-Neutral Dispatch library > > > > LICENSE=3D APACHE20 MIT > > LICENSE_COMB=3D multi > > > > -CONFLICTS_INSTALL=3D mesa-libs # include/GL/gl.h > > - > > USES=3D localbase meson pkgconfig > > USE_LDCONFIG=3D yes > > > > diff --git a/graphics/mesa-devel/Makefile b/graphics/mesa-devel/Makefil= e > > index 55792878a42d..07eec60ddd30 100644 > > --- a/graphics/mesa-devel/Makefile > > +++ b/graphics/mesa-devel/Makefile > > @@ -1,6 +1,7 @@ > > PORTNAME=3D mesa > > DISTVERSION=3D 21.1-branchpoint-3077 > > DISTVERSIONSUFFIX=3D -geb272f65715 > > +PORTREVISION=3D 1 > > CATEGORIES=3D graphics > > PKGNAMESUFFIX=3D -devel > > > > diff --git a/graphics/mesa-libs/Makefile b/graphics/mesa-libs/Makefile > > index 02155a2ace99..5ebe41c1078e 100644 > > --- a/graphics/mesa-libs/Makefile > > +++ b/graphics/mesa-libs/Makefile > > @@ -2,11 +2,12 @@ > > > > PORTNAME=3D mesa-libs > > PORTVERSION=3D ${MESAVERSION} > > +PORTREVISION=3D 1 > > CATEGORIES=3D graphics > > > > COMMENT=3D OpenGL libraries that support GLX and EGL clients > > > > -CONFLICTS_INSTALL=3D libglvnd # include/GL/gl.h > > +BUILD_DEPENDS=3D libglvnd>0:graphics/libglvnd > > > > OPTIONS_GROUP=3D PLATFORM > > OPTIONS_GROUP_PLATFORM=3D PLATFORM_X11 PLATFORM_WAYLAND > > @@ -43,6 +44,7 @@ MESON_ARGS+=3D -Dgallium-drivers=3D"" \ > > -Degl=3Denabled \ > > -Dgbm=3Denabled \ > > -Dvulkan-drivers=3D"" \ > > + -Dglvnd=3Dtrue \ > > -Dprefer-iris=3Dtrue > > # Building EGL and GBM requires a dri driver so add swrast > > MESON_ARGS+=3D -Ddri-drivers=3D"swrast" > > @@ -72,4 +74,9 @@ USE_GCC=3D yes > > > > .include "${MASTERDIR}/Makefile.targets" > > > > +post-install: > > +# Fallback if GLX_EXT_libglvnd is missing or vendor library doesn't ex= ist > > + @${ECHO_CMD} "libGLX_indirect.so.0 libGLX_mesa.so.0" \ > > + >${STAGEDIR}${PREFIX}/etc/libmap.d/mesa.conf > > + > > .include <bsd.port.post.mk> > > diff --git a/graphics/mesa-libs/pkg-plist b/graphics/mesa-libs/pkg-plis= t > > index 04dcaa4f87a5..4f4924cfd8b1 100644 > > --- a/graphics/mesa-libs/pkg-plist > > +++ b/graphics/mesa-libs/pkg-plist > > @@ -1,41 +1,42 @@ > > -include/EGL/egl.h > > -include/EGL/eglext.h > > +etc/libmap.d/mesa.conf > > +@comment include/EGL/egl.h > > +@comment include/EGL/eglext.h > > include/EGL/eglextchromium.h > > include/EGL/eglmesaext.h > > -include/EGL/eglplatform.h > > -include/GL/gl.h > > -include/GL/glcorearb.h > > -include/GL/glext.h > > -%%GLX%%include/GL/glx.h > > -%%GLX%%include/GL/glxext.h > > +@comment include/EGL/eglplatform.h > > +@comment include/GL/gl.h > > +@comment include/GL/glcorearb.h > > +@comment include/GL/glext.h > > +%%GLX%%@comment include/GL/glx.h > > +%%GLX%%@comment include/GL/glxext.h > > @comment include/GL/internal/dri_interface.h > > -include/GLES/egl.h > > -include/GLES/gl.h > > -include/GLES/glext.h > > -include/GLES/glplatform.h > > -include/GLES2/gl2.h > > -include/GLES2/gl2ext.h > > -include/GLES2/gl2platform.h > > -include/GLES3/gl3.h > > -include/GLES3/gl31.h > > -include/GLES3/gl32.h > > -include/GLES3/gl3ext.h > > -include/GLES3/gl3platform.h > > -include/KHR/khrplatform.h > > +@comment include/GLES/egl.h > > +@comment include/GLES/gl.h > > +@comment include/GLES/glext.h > > +@comment include/GLES/glplatform.h > > +@comment include/GLES2/gl2.h > > +@comment include/GLES2/gl2ext.h > > +@comment include/GLES2/gl2platform.h > > +@comment include/GLES3/gl3.h > > +@comment include/GLES3/gl31.h > > +@comment include/GLES3/gl32.h > > +@comment include/GLES3/gl3ext.h > > +@comment include/GLES3/gl3platform.h > > +@comment include/KHR/khrplatform.h > > include/gbm.h > > @comment lib/dri/swrast_dri.so > > -lib/libEGL.so > > -lib/libEGL.so.1 > > -lib/libEGL.so.1.0.0 > > -%%GLX%%lib/libGL.so > > -%%GLX%%lib/libGL.so.1 > > -%%GLX%%lib/libGL.so.1.2.0 > > -lib/libGLESv1_CM.so > > -lib/libGLESv1_CM.so.1 > > -lib/libGLESv1_CM.so.1.1.0 > > -lib/libGLESv2.so > > -lib/libGLESv2.so.2 > > -lib/libGLESv2.so.2.0.0 > > +lib/libEGL_mesa.so > > +lib/libEGL_mesa.so.0 > > +lib/libEGL_mesa.so.0.0.0 > > +@comment lib/libGLESv1_CM.so > > +@comment lib/libGLESv1_CM.so.1 > > +@comment lib/libGLESv1_CM.so.1.1.0 > > +@comment lib/libGLESv2.so > > +@comment lib/libGLESv2.so.2 > > +@comment lib/libGLESv2.so.2.0.0 > > +%%GLX%%lib/libGLX_mesa.so > > +%%GLX%%lib/libGLX_mesa.so.0 > > +%%GLX%%lib/libGLX_mesa.so.0.0.0 > > lib/libgbm.so > > lib/libgbm.so.1 > > lib/libgbm.so.1.0.0 > > @@ -43,9 +44,10 @@ lib/libglapi.so > > lib/libglapi.so.0 > > lib/libglapi.so.0.0.0 > > @comment libdata/pkgconfig/dri.pc > > -libdata/pkgconfig/egl.pc > > +@comment libdata/pkgconfig/egl.pc > > libdata/pkgconfig/gbm.pc > > -%%GLX%%libdata/pkgconfig/gl.pc > > -libdata/pkgconfig/glesv1_cm.pc > > -libdata/pkgconfig/glesv2.pc > > +%%GLX%%@comment libdata/pkgconfig/gl.pc > > +@comment libdata/pkgconfig/glesv1_cm.pc > > +@comment libdata/pkgconfig/glesv2.pc > > @comment share/drirc.d/00-mesa-defaults.conf > > +share/glvnd/egl_vendor.d/50_mesa.json > > diff --git a/misc/raspberrypi-userland/Makefile b/misc/raspberrypi-user= land/Makefile > > index 5dfa743da18c..42fad99b9736 100644 > > --- a/misc/raspberrypi-userland/Makefile > > +++ b/misc/raspberrypi-userland/Makefile > > @@ -11,7 +11,7 @@ LICENSE=3D BSD3CLAUSE > > > > ONLY_FOR_ARCHS=3D armv6 armv7 > > > > -CONFLICTS_INSTALL=3D mesa-libs > > +CONFLICTS_INSTALL=3D libglvnd > > > > USES=3D cmake pkgconfig shebangfix > > > > diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile > > index daa727149404..23efd76bbbda 100644 > > --- a/x11/nvidia-driver/Makefile > > +++ b/x11/nvidia-driver/Makefile > > @@ -16,7 +16,7 @@ > > PORTNAME?=3D nvidia-driver > > DISTVERSION?=3D 460.80 > > # Always try to set PORTREVISION as it can be overridden by the slave p= orts > > -PORTREVISION?=3D 0 > > +PORTREVISION?=3D 1 > > CATEGORIES=3D x11 > > MASTER_SITES=3D NVIDIA/XFree86/FreeBSD-${ARCH_SUFX}/${DISTVERSION} > > DISTNAME=3D NVIDIA-FreeBSD-${ARCH_SUFX}-${DISTVERSION} > > @@ -32,6 +32,7 @@ LICENSE_FILE=3D ${WRKSRC}/doc/license.txt > > # obj/libEGL_nvidia.so.0 (see below) > > .if ${NVVERSION} >=3D 410.057 > > PATCH_DEPENDS=3D gsed:textproc/gsed > > +BUILD_DEPENDS=3D pkg-config:devel/pkgconf libglvnd>0:graphics/libglvnd > > .endif > > > > USES=3D kmod uidfix xorg > > @@ -281,6 +282,7 @@ post-install: .SILENT > > .elif ${NVVERSION} < 465.01901 > > ${REINPLACE_CMD} -e '/lib32\/libnvidia-glvkspirv\.so/d' ${TMPPLIST} > > .endif > > +.if ${NVVERSION} < 410.057 > > # Rename some libraries and install a libmap file to resolve conflict w= ith > > # Mesa libraries. > > ${LN} -sf libGL-NVIDIA.so.1 \ > > @@ -288,7 +290,7 @@ post-install: .SILENT > > ${MV} -f ${STAGEDIR}${PREFIX}/lib/libGL.so.1 \ > > ${STAGEDIR}${PREFIX}/lib/libGL-NVIDIA.so.1 > > ${RM} ${STAGEDIR}${PREFIX}/lib/libGL.so > > -.if ${NVVERSION} >=3D 331.013 > > +. if ${NVVERSION} >=3D 331.013 > > ${LN} -sf libEGL-NVIDIA.so.1 \ > > ${STAGEDIR}${PREFIX}/lib/libEGL-NVIDIA.so > > ${MV} -f ${STAGEDIR}${PREFIX}/lib/libEGL.so.1 \ > > @@ -301,14 +303,14 @@ post-install: .SILENT > > ${MV} -f ${STAGEDIR}${PREFIX}/lib/libGLESv2.so.2 \ > > ${STAGEDIR}${PREFIX}/lib/libGLESv2-NVIDIA.so.2 > > ${RM} ${STAGEDIR}${PREFIX}/lib/libGLESv2.so > > -.endif > > -# Configuration of Nvidia as secondary GPU requires preserving Mesa li= braries > > -# as default implementation; a libmap must not override in this case. > > -.if !defined(LIBGLDIR) > > +. endif > > +# Configuration of Nvidia as secondary GPU requires preserving libglvn= d or mesa > > +# libraries as default implementation; a libmap must not override in t= his case. > > +. if !defined(LIBGLDIR) > > @${MKDIR} ${STAGEDIR}${PREFIX}/etc/libmap.d/ > > ${INSTALL_DATA} ${WRKDIR}/nvidia.conf \ > > ${STAGEDIR}${PREFIX}/etc/libmap.d/ > > -.else > > +. else > > # libgl proxies require a library path containing unrenamed lib*GL*.so > > ${MKDIR} ${STAGEDIR}${PREFIX}/${LIBGLDIR} > > ${RLN} ${STAGEDIR}${PREFIX}/lib/libGL-NVIDIA.so.1 \ > > @@ -317,17 +319,23 @@ post-install: .SILENT > > ${STAGEDIR}${PREFIX}/${LIBGLDIR}/libEGL.so.1 > > ${RLN} ${STAGEDIR}${PREFIX}/lib/libGLESv2-NVIDIA.so.2 \ > > ${STAGEDIR}${PREFIX}/${LIBGLDIR}/libGLESv2.so.2 > > -.endif > > +. endif > > # Configuration of Nvidia as secondary GPU requires preserving xorg-ser= ver's > > # libglx.so and moving Nvidia's glx to where it can be found by a secon= dary > > # Xorg instance. > > # Not needed since 410.057: Nvidia driver finds libglxserver_nvidia.so = instead. > > -.if ${NVVERSION} < 410.057 > > -.if ${EXTENSIONSDIR} !=3D ${MODULESDIR}/extensions/.nvidia > > +. if ${EXTENSIONSDIR} !=3D ${MODULESDIR}/extensions/.nvidia > > ${MKDIR} ${STAGEDIR}${PREFIX}/${EXTENSIONSDIR} > > ${MV} ${STAGEDIR}${PREFIX}/${MODULESDIR}/extensions/.nvidia/* \ > > ${STAGEDIR}${PREFIX}/${EXTENSIONSDIR}/ > > -.endif > > +. endif > > +.else > > + ${REINPLACE_CMD} -E '/-NVIDIA/d ; \ > > + /lib(Open)?E?GLX?(ESv[12](_CM)?|dispatch)?\.so/d' \ > > + ${TMPPLIST} > > +# Override mesa.conf if GLX_EXT_libglvnd is missing > > + @${ECHO_CMD} "libGLX_indirect.so.0 libGLX_nvidia.so.0" \ > > + >${STAGEDIR}${PREFIX}/etc/libmap.d/nvidia.conf > > .endif > > > > .include <bsd.port.post.mk> > > diff --git a/x11/nvidia-driver/pkg-plist b/x11/nvidia-driver/pkg-plist > > index 85156cdb6eff..caa1dc84ae52 100644 > > --- a/x11/nvidia-driver/pkg-plist > > +++ b/x11/nvidia-driver/pkg-plist > > @@ -17,9 +17,9 @@ lib/libGLESv2-NVIDIA.so > > lib/libGLESv2-NVIDIA.so.2 > > lib/libGLESv2_nvidia.so > > lib/libGLESv2_nvidia.so.2 > > -lib/libGLX.so > > -lib/libGLX.so.0 > > -lib/libGLX_indirect.so.0 > > +%%LIBGLDIR%%/libGLX.so > > +%%LIBGLDIR%%/libGLX.so.0 > > +@comment lib/libGLX_indirect.so.0 > > lib/libGLX_nvidia.so > > lib/libGLX_nvidia.so.0 > > lib/libGLdispatch.so
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAK7dMtBSkTujvQogs0W4rSzbU%2BU=1z05u3OEukdcPObrCdi7Uw>