treewide: get rid of ~all mesa.{drivers,osmesa,libdrm} references

mesa.drivers is basically an implementation detail and should never be used
as a dependency of other expressions. It also no longer exists on Darwin.

mesa.osmesa is very niche and should generally be avoided.

mesa.libdrm is used in exactly one place and it's irrelevant there.
This commit is contained in:
K900 2024-06-11 21:29:33 +03:00
parent 4d950563ff
commit f9723bc4de
18 changed files with 20 additions and 30 deletions

View File

@ -199,7 +199,7 @@ let
pciutils protobuf speechd libXdamage at-spi2-core pciutils protobuf speechd libXdamage at-spi2-core
pipewire pipewire
libva libva
libdrm wayland mesa.drivers libxkbcommon libdrm wayland libxkbcommon
curl curl
libepoxy libepoxy
libffi libffi
@ -227,7 +227,7 @@ let
pciutils protobuf speechd libXdamage at-spi2-core pciutils protobuf speechd libXdamage at-spi2-core
pipewire pipewire
libva libva
libdrm wayland mesa.drivers libxkbcommon libdrm wayland libxkbcommon
curl curl
libepoxy libepoxy
libffi libffi

View File

@ -52,7 +52,6 @@ stdenv.mkDerivation rec {
libnotify libnotify
libpulseaudio libpulseaudio
libxkbcommon libxkbcommon
mesa.drivers
nss nss
xorg.libX11 xorg.libX11
xorg.libXScrnSaver xorg.libXScrnSaver

View File

@ -97,7 +97,7 @@ rustPlatform.buildRustPackage rec {
wrapProgram "$out/bin/${pname}" \ wrapProgram "$out/bin/${pname}" \
--suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \ --suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr vulkan-loader libxkbcommon mesa.drivers wayland xorg.libX11 xorg.libXcursor xorg.libXi xorg.libXrandr vulkan-loader libxkbcommon wayland
]} ]}
''; '';

View File

@ -86,7 +86,6 @@ rustPlatform.buildRustPackage rec {
xorg.libXrandr xorg.libXrandr
libxkbcommon libxkbcommon
vulkan-loader vulkan-loader
mesa.drivers
] ]
} }
''; '';

View File

@ -99,7 +99,6 @@ rustPlatform.buildRustPackage rec {
--suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \ --suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
libxkbcommon libxkbcommon
mesa.drivers
vulkan-loader vulkan-loader
xorg.libX11 xorg.libX11
xorg.libXcursor xorg.libXcursor

View File

@ -149,11 +149,13 @@ clangStdenv.mkDerivation rec {
"-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld" "-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld"
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
]; ];
doCheck = true; doCheck = true;
checkPhase = '' checkPhase = ''
# for running mesa llvmpipe # for running mesa llvmpipe
export LIBGL_DRIVERS_PATH=${mesa.drivers}/lib/dri
export __EGL_VENDOR_LIBRARY_FILENAMES=${mesa.drivers}/share/glvnd/egl_vendor.d/50_mesa.json export __EGL_VENDOR_LIBRARY_FILENAMES=${mesa.drivers}/share/glvnd/egl_vendor.d/50_mesa.json
export LIBGL_DRIVERS_PATH=${mesa.drivers}/lib:${mesa.drivers}/lib/dri
# some fontconfig issues cause pdf output to have wrong font # some fontconfig issues cause pdf output to have wrong font
ctest -j$NIX_BUILD_CORES -E pdfexporttest.\* ctest -j$NIX_BUILD_CORES -E pdfexporttest.\*
''; '';

View File

@ -313,7 +313,7 @@ stdenv.mkDerivation (rec {
) )
''; '';
# E.g. mesa.drivers use the build-id as a cache key (see #93946): # E.g. Mesa uses the build-id as a cache key (see #93946):
LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1"; LDFLAGS = optionalString (enableSharedLibraries && !stdenv.isDarwin) "-Wl,--build-id=sha1";
cmakeBuildType = if debugVersion then "Debug" else "Release"; cmakeBuildType = if debugVersion then "Debug" else "Release";

View File

@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
# TODO: share libs between minimal and !minimal - perhaps just symlink them # TODO: share libs between minimal and !minimal - perhaps just symlink them
# Add FHS paths for non-NixOS applications. # Add FHS paths for non-NixOS applications.
configureFlags = [ "--with-drivers-path=${mesa.drivers.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri" ] configureFlags = lib.optionals stdenv.isLinux [ "--with-drivers-path=${mesa.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri" ]
++ lib.optionals (!minimal) [ "--enable-glx" ]; ++ lib.optionals (!minimal) [ "--enable-glx" ];
installFlags = [ "dummy_drv_video_ladir=$(out)/lib/dri" ]; installFlags = [ "dummy_drv_video_ladir=$(out)/lib/dri" ];

View File

@ -33,9 +33,9 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ libdrm ] buildInputs = [ libdrm ]
++ lib.optionals (!minimal) [ libX11 libXext libXfixes wayland libffi libGL ]; ++ lib.optionals (!minimal) [ libX11 libXext libXfixes wayland libffi libGL ];
mesonFlags = [ mesonFlags = lib.optionals stdenv.isLinux [
# Add FHS and Debian paths for non-NixOS applications # Add FHS and Debian paths for non-NixOS applications
"-Ddriverdir=${mesa.drivers.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/i386-linux-gnu/dri" "-Ddriverdir=${mesa.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri:/usr/lib/x86_64-linux-gnu/dri:/usr/lib/i386-linux-gnu/dri"
]; ];
passthru.tests = { passthru.tests = {

View File

@ -17,8 +17,7 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [ xorg.libX11 ]; propagatedBuildInputs = [ xorg.libX11 ];
mesonFlags = lib.optionals stdenv.isLinux mesonFlags = lib.optionals stdenv.isLinux [ "-Dmoduledir=${mesa.driverLink}/lib/vdpau" ];
[ "-Dmoduledir=${mesa.drivers.driverLink}/lib/vdpau" ];
NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lX11"; NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lX11";

View File

@ -5,9 +5,9 @@
buildPythonPackage, buildPythonPackage,
appdirs, appdirs,
cffi, cffi,
darwin,
decorator, decorator,
mako, mako,
mesa_drivers,
numpy, numpy,
ocl-icd, ocl-icd,
oldest-supported-numpy, oldest-supported-numpy,
@ -22,7 +22,7 @@
}: }:
let let
os-specific-buildInputs = if stdenv.isDarwin then [ mesa_drivers.dev ] else [ ocl-icd ]; os-specific-buildInputs = if stdenv.isDarwin then [ darwin.apple_sdk.frameworks.OpenCL ] else [ ocl-icd ];
in in
buildPythonPackage rec { buildPythonPackage rec {
pname = "pyopencl"; pname = "pyopencl";

View File

@ -53,11 +53,9 @@ stdenv.mkDerivation rec {
] ++ lib.optionals (backend == "cuda") [ ] ++ lib.optionals (backend == "cuda") [
cudaPackages.cudnn cudaPackages.cudnn
cudaPackages.cudatoolkit cudaPackages.cudatoolkit
mesa.drivers
] ++ lib.optionals (backend == "tensorrt") [ ] ++ lib.optionals (backend == "tensorrt") [
cudaPackages.cudatoolkit cudaPackages.cudatoolkit
cudaPackages.tensorrt cudaPackages.tensorrt
mesa.drivers
] ++ lib.optionals (backend == "opencl") [ ] ++ lib.optionals (backend == "opencl") [
opencl-headers opencl-headers
ocl-icd ocl-icd

View File

@ -94,7 +94,7 @@ stdenv.mkDerivation (finalAttrs: {
# to the swrast dri driver in Mesa. # to the swrast dri driver in Mesa.
# Can also be given at runtime to its `Xvnc` as: # Can also be given at runtime to its `Xvnc` as:
# -dridir /nix/store/...-mesa-20.1.10-drivers/lib/dri/ # -dridir /nix/store/...-mesa-20.1.10-drivers/lib/dri/
"-DXORG_DRI_DRIVER_PATH=${mesa.drivers}/lib/dri" "-DXORG_DRI_DRIVER_PATH=${mesa.driverLink}/lib/dri"
# The build system doesn't find these files automatically. # The build system doesn't find these files automatically.
"-DTJPEG_JAR=${libjpeg_turbo.out}/share/java/turbojpeg.jar" "-DTJPEG_JAR=${libjpeg_turbo.out}/share/java/turbojpeg.jar"
"-DTJPEG_JNILIBRARY=${libjpeg_turbo.out}/lib/libturbojpeg.so" "-DTJPEG_JNILIBRARY=${libjpeg_turbo.out}/lib/libturbojpeg.so"

View File

@ -1,7 +1,7 @@
{ lib, stdenv, fetchurl { lib, stdenv, fetchurl
, autoreconfHook, bison, glm, flex, wrapQtAppsHook, cmake, pkg-config , autoreconfHook, bison, glm, flex, wrapQtAppsHook, cmake, pkg-config
, freeglut, ghostscriptX, imagemagick, fftw, eigen, libtirpc , freeglut, ghostscriptX, imagemagick, fftw, eigen, libtirpc
, boehmgc, libGLU, libGL, mesa, ncurses, readline, gsl, libsigsegv , boehmgc, libGLU, libGL, ncurses, readline, gsl, libsigsegv
, python3, qtbase, qtsvg, boost , python3, qtbase, qtsvg, boost
, zlib, perl, curl , zlib, perl, curl
, texinfo , texinfo
@ -46,7 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
propagatedBuildInputs = [ propagatedBuildInputs = [
glm glm
] ++ lib.optionals stdenv.isLinux [ ] ++ lib.optionals stdenv.isLinux [
freeglut libGLU libGL mesa.osmesa freeglut libGLU libGL
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
OpenGL GLUT Cocoa OpenGL GLUT Cocoa
]); ]);

View File

@ -54,14 +54,12 @@ stdenv.mkDerivation rec {
vulkan-loader vulkan-loader
libxkbcommon libxkbcommon
libdecor libdecor
] ++ lib.optional (mesa ? osmesa) mesa.osmesa; ];
mesonFlags = [ mesonFlags = [
"-Degl=${if stdenv.isDarwin then "disabled" else "auto"}"
"-Dlibdrm=${if mesa.libdrm == null then "disabled" else "enabled"}"
"-Dosmesa=${if mesa ? osmesa then "enabled" else "disabled"}"
"-Dwayland=${if wayland.withLibraries then "enabled" else "disabled"}"
"-Dwith-system-data-files=true" "-Dwith-system-data-files=true"
"-Dgles1=disabled"
"-Dosmesa=disabled"
]; ];
meta = with lib; { meta = with lib; {

View File

@ -52,7 +52,6 @@ buildFHSEnv {
libdrm libdrm
libudev0-shim libudev0-shim
libxkbcommon libxkbcommon
mesa.drivers
nspr nspr
nss nss
pango pango

View File

@ -18,7 +18,6 @@ let
# used of both wrappers and libpath # used of both wrappers and libpath
libPath = lib.makeLibraryPath (with xorg; [ libPath = lib.makeLibraryPath (with xorg; [
mesa.drivers
libGLU libGL libGLU libGL
fontconfig fontconfig
freetype freetype

View File

@ -11554,9 +11554,7 @@ self: super: with self; {
phonemizer = callPackage ../development/python-modules/phonemizer { }; phonemizer = callPackage ../development/python-modules/phonemizer { };
pyopencl = callPackage ../development/python-modules/pyopencl { pyopencl = callPackage ../development/python-modules/pyopencl { };
mesa_drivers = pkgs.mesa.drivers;
};
pyopengl = callPackage ../development/python-modules/pyopengl { }; pyopengl = callPackage ../development/python-modules/pyopengl { };