193.2. libglvnd-1.7.0
GL Vendor-Neutral Dispatch: libGL, libGLX, libOpenGL, libEGL and libGLES
| Version | 1.7.0, release 2 |
| Shelf | gpu — The GPU stack: Mesa, DRM, GL and Vulkan loaders and headers, shader compilers, VA-API, OpenCL |
| Phase | 42_graphics (Graphics Stack), 4 of 189 in build order |
| Licence | MIT |
| Homepage | https://gitlab.freedesktop.org/glvnd/libglvnd |
| Build time | 0.1 SBU |
| Installed size | 4.5 MiB in 45 files |
| Recipe | ports/core/gpu/libglvnd/kpkgbuild |
About
libglvnd, the GL Vendor-Neutral Dispatch library, is what a program links when it links OpenGL: libGL, libOpenGL, libGLX, libEGL and libGLESv2 are libglvnd’s, and each passes the program’s calls on to the vendor library that owns the current context. In KDOS that vendor is Mesa, built -D glvnd=enabled, which installs libEGL_mesa and libGLX_mesa behind these. libglvnd also installs the gl.pc, glx.pc, egl.pc and glesv2.pc files the rest of the tree builds against. How a Wayland client and an X11 client under Xwayland each reach Mesa through it is in Desktop GL and GLX.
Sources
libglvnd-1.7.0.tar.gz(820.1 KiB)
sha256073e7292788d4d3eeb45ea6c7bdcce9bfdb3b3eef8d7dbd47f2f30dce046ef98
upstream: https://github.com/NVIDIA/libglvnd/archive/v1.7.0/libglvnd-v1.7.0.tar.gz
archive copy: sources-2/gpu--libglvnd-1.7.0.tar.gz
Dependencies
Depends on: meson, libX11, libXext, xorgproto.
Required by (97): amiberry, analitza, avidemux, avogadrolibs, blender, candle2, celestia, coin, crawl-tiles, cubicsdr, ddnet, digikam, dosbox-staging, dosbox-x, dsda-doom, endless-sky, fastfetch, fltk, freecad, freeglut, frei0r-plugins, furnace, gl2ps, glew, glfw, glmark2, glu, gmsh, goxel, gst-plugins-base, imhex, ioquake3, ironwail, kicad, kinfocenter, kodi, kpipewire, ksudoku, kubrick, kwayland, kwin, librepcb, libretro-beetle-psx, libretro-melonds, libretro-mupen64plus-next, limesuite-gui, linuxcnc, luanti, mesa, mgba, mlt, mupdf, mupen64plus, neverball, obs-studio, octave, opencascade, opencolorio, opencpn, opencsg, openmsx, openrct2, openscad, opensubdiv, openttd, orcaslicer, pioneer, ppsspp, prusaslicer, python3-kivy, python3-opengl, qcad, qt5-qtbase, qt5-qtmultimedia, qt5-qtwayland, qt6-qtbase, qt6-qtmultimedia, qv4l2, retroarch, satdump, sauerbraten, scummvm, sdrangel, sdrpp, solvespace, soqt, srb2, supertux, supertuxkart, surfer, vtk, waylandpp, widelands, wine, wxwidgets, xwayland, yamagi-quake2.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install libglvnd'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/gpu/libglvnd.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/gpu/libglvnd
echo '073e7292788d4d3eeb45ea6c7bdcce9bfdb3b3eef8d7dbd47f2f30dce046ef98 libglvnd-1.7.0.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/libglvnd
SRC=$SRC_ROOT/libglvnd-1.7.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libglvnd-1.7.0.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
meson setup build --buildtype=release \
--prefix=/usr --sysconfdir=/etc --libdir=lib \
-D x11=enabled \
-D glx=enabled \
-D gles1=false \
-D egl=true \
-D tls=false \
-D hgl=false \
-D asm=enabled \
-D entrypoint-patching=enabled
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build
install -Dm644 "$SRC/README.md" "$PKG/usr/share/licenses/$name/README.md"
The switches, and why each is set:
-D x11=enabled,-D glx=enabled— BuildslibGLX, the GLX front end, and the X11 platform oflibEGL, against libX11, libXext and xorgproto. Without them there is nolibGLand nogl.pcorglx.pc: an X11 client under Xwayland draws through GLX, and every build that asks forOpenGL::GLor-lGLlinkslibGL.enabledturns the probe into a requirement.-D gles1=false— Builds nolibGLESv1_CM, the OpenGL ES 1.x library. mesa is built-D gles1=disabled, so there would be no vendor behind it.-D egl=true— BuildslibEGL, upstream’s default.-D tls=false— Keeps each thread’s current dispatch table through POSIX thread-specific data instead of a__threadvariable. Upstream’s default is on.-D hgl=false— Builds no Haiku GL front end; the option has an effect only on Haiku.-D asm=enabled— Uses the assembly entry-point stubs for x86-64, and makes their absence a configure error. On musl the stubs are the TSD variant (x86_64_tsd): upstream builds the TLS stubs only on glibc and FreeBSD, because they need the initial-exec TLS model.-D entrypoint-patching=enabled— Lets a vendor library rewrite the assembly entry points with its own code, so that a GL call skips libGLdispatch’s dispatch table. It needs the assembly stubs.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/libglvnd, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf libglvnd-1.7.0-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/libglvnd, and runs the triggers its paths call for.
Contents
Installed libraries: libEGL.so, libGL.so, libGLESv2.so, libGLX.so, libGLdispatch.so, libOpenGL.so.
Installed directories: /usr/include/GLES2, /usr/include/GLES3, /usr/include/KHR, /usr/include/glvnd, /usr/share/licenses/libglvnd.
Short descriptions
egl.pc |
EGL library and headers |
gl.pc |
Legacy OpenGL and GLX library and headers. |
glesv2.pc |
OpenGL ES v2/v3 library and headers. |
glx.pc |
GLX library and headers. |
libglvnd.pc |
Vendor-neutral OpenGL dispatch library vendor interface |
opengl.pc |
OpenGL (without GLX) library and headers. |
Notes
gles1=false and Mesa’s gles1=disabled go together: turning on one without the other gives either a front end with no driver or a driver with no front end.