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
pipewire
libva
libdrm wayland mesa.drivers libxkbcommon
libdrm wayland libxkbcommon
curl
libepoxy
libffi
@ -227,7 +227,7 @@ let
pciutils protobuf speechd libXdamage at-spi2-core
pipewire
libva
libdrm wayland mesa.drivers libxkbcommon
libdrm wayland libxkbcommon
curl
libepoxy
libffi

View File

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

View File

@ -97,7 +97,7 @@ rustPlatform.buildRustPackage rec {
wrapProgram "$out/bin/${pname}" \
--suffix XDG_DATA_DIRS : "${cosmic-icons}/share" \
--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
libxkbcommon
vulkan-loader
mesa.drivers
]
}
'';

View File

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

View File

@ -149,11 +149,13 @@ clangStdenv.mkDerivation rec {
"-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld"
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
];
doCheck = true;
checkPhase = ''
# 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 LIBGL_DRIVERS_PATH=${mesa.drivers}/lib:${mesa.drivers}/lib/dri
# some fontconfig issues cause pdf output to have wrong font
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";
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
# 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" ];
installFlags = [ "dummy_drv_video_ladir=$(out)/lib/dri" ];

View File

@ -33,9 +33,9 @@ stdenv.mkDerivation (finalAttrs: {
buildInputs = [ libdrm ]
++ lib.optionals (!minimal) [ libX11 libXext libXfixes wayland libffi libGL ];
mesonFlags = [
mesonFlags = lib.optionals stdenv.isLinux [
# 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 = {

View File

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

View File

@ -5,9 +5,9 @@
buildPythonPackage,
appdirs,
cffi,
darwin,
decorator,
mako,
mesa_drivers,
numpy,
ocl-icd,
oldest-supported-numpy,
@ -22,7 +22,7 @@
}:
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
buildPythonPackage rec {
pname = "pyopencl";

View File

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

View File

@ -94,7 +94,7 @@ stdenv.mkDerivation (finalAttrs: {
# to the swrast dri driver in Mesa.
# Can also be given at runtime to its `Xvnc` as:
# -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.
"-DTJPEG_JAR=${libjpeg_turbo.out}/share/java/turbojpeg.jar"
"-DTJPEG_JNILIBRARY=${libjpeg_turbo.out}/lib/libturbojpeg.so"

View File

@ -1,7 +1,7 @@
{ lib, stdenv, fetchurl
, autoreconfHook, bison, glm, flex, wrapQtAppsHook, cmake, pkg-config
, 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
, zlib, perl, curl
, texinfo
@ -46,7 +46,7 @@ stdenv.mkDerivation (finalAttrs: {
propagatedBuildInputs = [
glm
] ++ lib.optionals stdenv.isLinux [
freeglut libGLU libGL mesa.osmesa
freeglut libGLU libGL
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
OpenGL GLUT Cocoa
]);

View File

@ -54,14 +54,12 @@ stdenv.mkDerivation rec {
vulkan-loader
libxkbcommon
libdecor
] ++ lib.optional (mesa ? osmesa) mesa.osmesa;
];
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"
"-Dgles1=disabled"
"-Dosmesa=disabled"
];
meta = with lib; {

View File

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

View File

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

View File

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