diff --git a/nixos/modules/programs/nix-required-mounts.nix b/nixos/modules/programs/nix-required-mounts.nix index 5d25958a7698d..5064d6aaf575d 100644 --- a/nixos/modules/programs/nix-required-mounts.nix +++ b/nixos/modules/programs/nix-required-mounts.nix @@ -47,7 +47,7 @@ let ); driverPaths = [ - pkgs.addOpenGLRunpath.driverLink + pkgs.addDriverRunpath.driverLink # mesa: config.hardware.opengl.package @@ -84,7 +84,7 @@ in { opengl.paths = config.hardware.opengl.extraPackages ++ [ config.hardware.opengl.package - pkgs.addOpenGLRunpath.driverLink + pkgs.addDriverRunpath.driverLink "/dev/dri" ]; } diff --git a/pkgs/applications/emulators/darling/default.nix b/pkgs/applications/emulators/darling/default.nix index a5fe1021e9171..3d396e07e3597 100644 --- a/pkgs/applications/emulators/darling/default.nix +++ b/pkgs/applications/emulators/darling/default.nix @@ -38,7 +38,7 @@ , xdg-user-dirs -, addOpenGLRunpath +, addDriverRunpath # Whether to pre-compile Python 2 bytecode for performance. , compilePy2Bytecode ? false @@ -217,7 +217,7 @@ in stdenv.mkDerivation { exit 1 fi - patchelf --add-rpath "${lib.makeLibraryPath wrappedLibs}:${addOpenGLRunpath.driverLink}/lib" \ + patchelf --add-rpath "${lib.makeLibraryPath wrappedLibs}:${addDriverRunpath.driverLink}/lib" \ $out/libexec/darling/usr/libexec/darling/mldr ''; diff --git a/pkgs/applications/graphics/seamly2d/default.nix b/pkgs/applications/graphics/seamly2d/default.nix index bd8316b953f02..5742d58d0af95 100644 --- a/pkgs/applications/graphics/seamly2d/default.nix +++ b/pkgs/applications/graphics/seamly2d/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, qtbase, wrapQtAppsHook, fetchFromGitHub, - addOpenGLRunpath, poppler_utils, qtxmlpatterns, qtsvg, mesa, gcc, xvfb-run, + addDriverRunpath, poppler_utils, qtxmlpatterns, qtsvg, mesa, gcc, xvfb-run, fontconfig, freetype, xorg, ccache, qmake, python3, qttools, git }: let @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ - addOpenGLRunpath + addDriverRunpath xvfb-run fontconfig wrapQtAppsHook diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index 0033d3e1bd2ab..31eaef04912fe 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -5,7 +5,7 @@ OpenAL, OpenGL, SDL, - addOpenGLRunpath, + addDriverRunpath, alembic, blender, boost, @@ -200,7 +200,7 @@ stdenv.mkDerivation (finalAttrs: { python3Packages.wrapPython ] ++ lib.optionals cudaSupport [ - addOpenGLRunpath + addDriverRunpath cudaPackages.cuda_nvcc ] ++ lib.optionals waylandSupport [ pkg-config ]; @@ -323,7 +323,7 @@ stdenv.mkDerivation (finalAttrs: { postFixup = lib.optionalString cudaSupport '' for program in $out/bin/blender $out/bin/.blender-wrapped; do isELF "$program" || continue - addOpenGLRunpath "$program" + addDriverRunpath "$program" done '' + lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/applications/misc/firestarter/default.nix b/pkgs/applications/misc/firestarter/default.nix index a8372b643bd36..8eb001e9c93bb 100644 --- a/pkgs/applications/misc/firestarter/default.nix +++ b/pkgs/applications/misc/firestarter/default.nix @@ -2,7 +2,7 @@ , lib , fetchFromGitHub , fetchzip -, addOpenGLRunpath +, addDriverRunpath , cmake , glibc_multi , glibc @@ -67,7 +67,7 @@ stdenv.mkDerivation rec { git pkg-config ] ++ lib.optionals withCuda [ - addOpenGLRunpath + addDriverRunpath ]; buildInputs = [ hwloc ] ++ (if withCuda then @@ -95,7 +95,7 @@ stdenv.mkDerivation rec { ''; postFixup = lib.optionalString withCuda '' - addOpenGLRunpath $out/bin/FIRESTARTER_CUDA + addDriverRunpath $out/bin/FIRESTARTER_CUDA ''; meta = with lib; { diff --git a/pkgs/applications/misc/gpu-burn/default.nix b/pkgs/applications/misc/gpu-burn/default.nix index eaf0fc44d29dd..97d6b674d5e57 100644 --- a/pkgs/applications/misc/gpu-burn/default.nix +++ b/pkgs/applications/misc/gpu-burn/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, addOpenGLRunpath, cudatoolkit }: +{ lib, stdenv, fetchFromGitHub, addDriverRunpath, cudatoolkit }: stdenv.mkDerivation { pname = "gpu-burn"; @@ -19,7 +19,7 @@ stdenv.mkDerivation { buildInputs = [ cudatoolkit ]; - nativeBuildInputs = [ addOpenGLRunpath ]; + nativeBuildInputs = [ addDriverRunpath ]; makeFlags = [ "CUDAPATH=${cudatoolkit}" ]; @@ -32,7 +32,7 @@ stdenv.mkDerivation { ''; postFixup = '' - addOpenGLRunpath $out/bin/gpu_burn + addDriverRunpath $out/bin/gpu_burn ''; meta = with lib; { diff --git a/pkgs/applications/networking/browsers/brave/make-brave.nix b/pkgs/applications/networking/browsers/brave/make-brave.nix index f0b9fb6cf0c6e..e0590b193fdab 100644 --- a/pkgs/applications/networking/browsers/brave/make-brave.nix +++ b/pkgs/applications/networking/browsers/brave/make-brave.nix @@ -62,7 +62,7 @@ # For Vulkan support (--enable-features=Vulkan); disabled by default as it seems to break VA-API , vulkanSupport ? false -, addOpenGLRunpath +, addDriverRunpath , enableVulkan ? vulkanSupport }: @@ -187,7 +187,7 @@ stdenv.mkDerivation { ''} --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto}}" ${optionalString vulkanSupport '' - --prefix XDG_DATA_DIRS : "${addOpenGLRunpath.driverLink}/share" + --prefix XDG_DATA_DIRS : "${addDriverRunpath.driverLink}/share" ''} --add-flags ${escapeShellArg commandLineArgs} ) diff --git a/pkgs/applications/networking/instant-messengers/feishu/default.nix b/pkgs/applications/networking/instant-messengers/feishu/default.nix index d43320558b2a8..db708da35e45b 100644 --- a/pkgs/applications/networking/instant-messengers/feishu/default.nix +++ b/pkgs/applications/networking/instant-messengers/feishu/default.nix @@ -1,4 +1,4 @@ -{ addOpenGLRunpath +{ addDriverRunpath , alsa-lib , at-spi2-atk , at-spi2-core @@ -179,7 +179,7 @@ stdenv.mkDerivation { # FIXME: Add back NIXOS_OZONE_WL support once upstream fixes the crash on native Wayland (see #318035) wrapProgram $executable \ --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \ - --prefix LD_LIBRARY_PATH : ${rpath}:$out/opt/bytedance/feishu:${addOpenGLRunpath.driverLink}/share \ + --prefix LD_LIBRARY_PATH : ${rpath}:$out/opt/bytedance/feishu:${addDriverRunpath.driverLink}/share \ ${lib.optionalString (commandLineArgs!="") "--add-flags ${lib.escapeShellArg commandLineArgs}"} done diff --git a/pkgs/applications/science/math/mathematica/generic.nix b/pkgs/applications/science/math/mathematica/generic.nix index 5a96bf1a26252..c1c10f8937ce0 100644 --- a/pkgs/applications/science/math/mathematica/generic.nix +++ b/pkgs/applications/science/math/mathematica/generic.nix @@ -1,4 +1,4 @@ -{ addOpenGLRunpath +{ addDriverRunpath , autoPatchelfHook , lib , makeWrapper @@ -57,7 +57,7 @@ let cudaEnv = symlinkJoin { ]; postBuild = '' if [ ! -e $out/lib/libcuda.so ]; then - ln -s ${addOpenGLRunpath.driverLink}/lib/libcuda.so $out/lib + ln -s ${addDriverRunpath.driverLink}/lib/libcuda.so $out/lib fi ln -s lib $out/lib64 ''; @@ -69,7 +69,7 @@ in stdenv.mkDerivation { nativeBuildInputs = [ autoPatchelfHook makeWrapper - ] ++ lib.optional cudaSupport addOpenGLRunpath; + ] ++ lib.optional cudaSupport addDriverRunpath; buildInputs = [ alsa-lib @@ -136,8 +136,8 @@ in stdenv.mkDerivation { "--set QT_QPA_PLATFORM wayland;xcb" ] ++ lib.optionals cudaSupport [ "--set CUDA_PATH ${cudaEnv}" - "--set NVIDIA_DRIVER_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib/libnvidia-tls.so" - "--set CUDA_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib/libcuda.so" + "--set NVIDIA_DRIVER_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib/libnvidia-tls.so" + "--set CUDA_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib/libcuda.so" ]; unpackPhase = '' diff --git a/pkgs/applications/video/davinci-resolve/default.nix b/pkgs/applications/video/davinci-resolve/default.nix index be18304386cbd..574de6f427b1f 100644 --- a/pkgs/applications/video/davinci-resolve/default.nix +++ b/pkgs/applications/video/davinci-resolve/default.nix @@ -5,7 +5,7 @@ , runCommandLocal , unzip , appimage-run -, addOpenGLRunpath +, addDriverRunpath , dbus , libGLU , xorg @@ -38,7 +38,7 @@ let nativeBuildInputs = [ (appimage-run.override { buildFHSEnv = buildFHSEnvChroot; } ) - addOpenGLRunpath + addDriverRunpath copyDesktopItems unzip ]; @@ -150,14 +150,14 @@ let postFixup = '' for program in $out/bin/*; do isELF "$program" || continue - addOpenGLRunpath "$program" + addDriverRunpath "$program" done for program in $out/libs/*; do isELF "$program" || continue if [[ "$program" != *"libcudnn_cnn_infer"* ]];then echo $program - addOpenGLRunpath "$program" + addDriverRunpath "$program" fi done ln -s $out/libs/libcrypto.so.1.1 $out/libs/libcrypt.so.1 diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix index 0f9cec9c409bd..9ccb79dcba2e9 100644 --- a/pkgs/applications/video/mpv/default.nix +++ b/pkgs/applications/video/mpv/default.nix @@ -1,7 +1,7 @@ { lib, SDL2, - addOpenGLRunpath, + addDriverRunpath, alsa-lib, bash, buildPackages, @@ -203,7 +203,7 @@ stdenv'.mkDerivation (finalAttrs: { nativeBuildInputs = [ - addOpenGLRunpath + addDriverRunpath docutils # for rst2man meson ninja @@ -329,9 +329,9 @@ stdenv'.mkDerivation (finalAttrs: { ''; # Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found. - # See the explanation in addOpenGLRunpath. + # See the explanation in addDriverRunpath. postFixup = lib.optionalString stdenv.isLinux '' - addOpenGLRunpath $out/bin/mpv + addDriverRunpath $out/bin/mpv patchShebangs --update --host $out/bin/umpv $out/bin/mpv_identify.sh ''; diff --git a/pkgs/applications/video/obs-studio/default.nix b/pkgs/applications/video/obs-studio/default.nix index 418d9adf8263b..f7f1c322d2529 100644 --- a/pkgs/applications/video/obs-studio/default.nix +++ b/pkgs/applications/video/obs-studio/default.nix @@ -3,7 +3,7 @@ , stdenv , fetchFromGitHub , fetchpatch -, addOpenGLRunpath +, addDriverRunpath , cmake , fdk_aac , ffmpeg @@ -87,7 +87,7 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ - addOpenGLRunpath + addDriverRunpath cmake pkg-config wrapGAppsHook3 @@ -181,8 +181,8 @@ stdenv.mkDerivation (finalAttrs: { ''; postFixup = lib.optionalString stdenv.isLinux '' - addOpenGLRunpath $out/lib/lib*.so - addOpenGLRunpath $out/lib/obs-plugins/*.so + addDriverRunpath $out/lib/lib*.so + addDriverRunpath $out/lib/obs-plugins/*.so # Link libcef again after patchelfing other libs ln -s ${libcef}/lib/* $out/lib/obs-plugins/ diff --git a/pkgs/applications/virtualization/libnvidia-container/default.nix b/pkgs/applications/virtualization/libnvidia-container/default.nix index b462b24711de5..28ea0a675b17b 100644 --- a/pkgs/applications/virtualization/libnvidia-container/default.nix +++ b/pkgs/applications/virtualization/libnvidia-container/default.nix @@ -1,6 +1,6 @@ { stdenv , lib -, addOpenGLRunpath +, addDriverRunpath , fetchFromGitHub , pkg-config , elfutils @@ -102,7 +102,7 @@ stdenv.mkDerivation rec { postInstall = let - inherit (addOpenGLRunpath) driverLink; + inherit (addDriverRunpath) driverLink; libraryPath = lib.makeLibraryPath [ "$out" driverLink "${driverLink}-32" ]; in '' diff --git a/pkgs/build-support/add-opengl-runpath/default.nix b/pkgs/build-support/add-opengl-runpath/default.nix deleted file mode 100644 index 5cab0937e0747..0000000000000 --- a/pkgs/build-support/add-opengl-runpath/default.nix +++ /dev/null @@ -1,12 +0,0 @@ -{ lib, stdenv }: - -stdenv.mkDerivation { - name = "add-opengl-runpath"; - - driverLink = "/run/opengl-driver" + lib.optionalString stdenv.isi686 "-32"; - - buildCommand = '' - mkdir -p $out/nix-support - substituteAll ${./setup-hook.sh} $out/nix-support/setup-hook - ''; -} diff --git a/pkgs/build-support/add-opengl-runpath/setup-hook.sh b/pkgs/build-support/add-opengl-runpath/setup-hook.sh deleted file mode 100644 index e556e7ead2a78..0000000000000 --- a/pkgs/build-support/add-opengl-runpath/setup-hook.sh +++ /dev/null @@ -1,29 +0,0 @@ -# Set RUNPATH so that driver libraries in /run/opengl-driver(-32)/lib can be found. -# This is needed to not rely on LD_LIBRARY_PATH which does not work with setuid -# executables. Fixes https://github.com/NixOS/nixpkgs/issues/22760. It must be run -# in postFixup because RUNPATH stripping in fixup would undo it. Note that patchelf -# actually sets RUNPATH not RPATH, which applies only to dependencies of the binary -# it set on (including for dlopen), so the RUNPATH must indeed be set on these -# libraries and would not work if set only on executables. -addOpenGLRunpath() { - local forceRpath= - - while [ $# -gt 0 ]; do - case "$1" in - --) shift; break;; - --force-rpath) shift; forceRpath=1;; - --*) - echo "addOpenGLRunpath: ERROR: Invalid command line" \ - "argument: $1" >&2 - return 1;; - *) break;; - esac - done - - for file in "$@"; do - if ! isELF "$file"; then continue; fi - local origRpath="$(patchelf --print-rpath "$file")" - patchelf --set-rpath "@driverLink@/lib:$origRpath" ${forceRpath:+--force-rpath} "$file" - done -} - diff --git a/pkgs/by-name/ce/cemu/package.nix b/pkgs/by-name/ce/cemu/package.nix index 3a009ea0cb3be..4ceffd77c664d 100644 --- a/pkgs/by-name/ce/cemu/package.nix +++ b/pkgs/by-name/ce/cemu/package.nix @@ -1,7 +1,7 @@ { lib, SDL2, - addOpenGLRunpath, + addDriverRunpath, boost, cmake, cubeb, @@ -66,7 +66,7 @@ in stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ SDL2 - addOpenGLRunpath + addDriverRunpath wrapGAppsHook3 cmake glslang diff --git a/pkgs/by-name/go/google-chrome/package.nix b/pkgs/by-name/go/google-chrome/package.nix index 15b444728b26e..6678821c3c1f4 100644 --- a/pkgs/by-name/go/google-chrome/package.nix +++ b/pkgs/by-name/go/google-chrome/package.nix @@ -38,7 +38,7 @@ , libvaSupport ? true, libva # For Vulkan support (--enable-features=Vulkan) -, addOpenGLRunpath +, addDriverRunpath }: let @@ -129,7 +129,7 @@ in stdenv.mkDerivation (finalAttrs: { --prefix LD_LIBRARY_PATH : "$rpath" \ --prefix PATH : "$binpath" \ --suffix PATH : "${lib.makeBinPath [ xdg-utils ]}" \ - --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:${addOpenGLRunpath.driverLink}/share" \ + --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:${addDriverRunpath.driverLink}/share" \ --set CHROME_WRAPPER "google-chrome-$dist" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ --add-flags ${lib.escapeShellArg commandLineArgs} diff --git a/pkgs/by-name/mo/modrinth-app/package.nix b/pkgs/by-name/mo/modrinth-app/package.nix index 23fd1adf19597..12e13017ad331 100644 --- a/pkgs/by-name/mo/modrinth-app/package.nix +++ b/pkgs/by-name/mo/modrinth-app/package.nix @@ -4,7 +4,7 @@ symlinkJoin, modrinth-app-unwrapped, wrapGAppsHook3, - addOpenGLRunpath, + addDriverRunpath, flite, glib, glib-networking, @@ -38,7 +38,7 @@ symlinkJoin rec { ]; runtimeDependencies = lib.optionalString stdenv.isLinux (lib.makeLibraryPath [ - addOpenGLRunpath.driverLink + addDriverRunpath.driverLink flite # narrator support udev # oshi diff --git a/pkgs/by-name/ni/nix-required-mounts/package.nix b/pkgs/by-name/ni/nix-required-mounts/package.nix index 197e0812a8ec5..2da30a868854c 100644 --- a/pkgs/by-name/ni/nix-required-mounts/package.nix +++ b/pkgs/by-name/ni/nix-required-mounts/package.nix @@ -1,5 +1,5 @@ { - addOpenGLRunpath, + addDriverRunpath, allowedPatternsPath ? callPackage ./closure.nix { inherit allowedPatterns; }, allowedPatterns ? rec { # This config is just an example. @@ -12,7 +12,7 @@ ]; # It exposes these paths in the sandbox: nvidia-gpu.paths = [ - addOpenGLRunpath.driverLink + addDriverRunpath.driverLink "/dev/dri" "/dev/nvidia*" ]; diff --git a/pkgs/by-name/pr/prismlauncher/package.nix b/pkgs/by-name/pr/prismlauncher/package.nix index c6ff6894389d5..27b66966d42ee 100644 --- a/pkgs/by-name/pr/prismlauncher/package.nix +++ b/pkgs/by-name/pr/prismlauncher/package.nix @@ -3,7 +3,7 @@ stdenv, symlinkJoin, prismlauncher-unwrapped, - addOpenGLRunpath, + addDriverRunpath, flite, gamemode, glfw, @@ -132,7 +132,7 @@ symlinkJoin { in [ "--prefix PRISMLAUNCHER_JAVA_PATHS : ${lib.makeSearchPath "bin/java" jdks}" ] ++ lib.optionals stdenv.isLinux [ - "--set LD_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}" + "--set LD_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib:${lib.makeLibraryPath runtimeLibs}" "--prefix PATH : ${lib.makeBinPath runtimePrograms}" ]; diff --git a/pkgs/by-name/te/tetrio-desktop/package.nix b/pkgs/by-name/te/tetrio-desktop/package.nix index f07299b37cc39..56e2f60acc862 100644 --- a/pkgs/by-name/te/tetrio-desktop/package.nix +++ b/pkgs/by-name/te/tetrio-desktop/package.nix @@ -4,7 +4,7 @@ , dpkg , makeWrapper , callPackage -, addOpenGLRunpath +, addDriverRunpath , electron , withTetrioPlus ? false , tetrio-plus ? null @@ -58,7 +58,7 @@ stdenv.mkDerivation (finalAttrs: { postFixup = '' makeShellWrapper '${lib.getExe electron}' $out/bin/tetrio \ - --prefix LD_LIBRARY_PATH : ${addOpenGLRunpath.driverLink}/lib \ + --prefix LD_LIBRARY_PATH : ${addDriverRunpath.driverLink}/lib \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ --add-flags $out/share/TETR.IO/app.asar ''; diff --git a/pkgs/development/cuda-modules/cuda-library-samples/generic.nix b/pkgs/development/cuda-modules/cuda-library-samples/generic.nix index 64131ab59b82e..f5d1c250cfca4 100644 --- a/pkgs/development/cuda-modules/cuda-library-samples/generic.nix +++ b/pkgs/development/cuda-modules/cuda-library-samples/generic.nix @@ -3,7 +3,7 @@ backendStdenv, fetchFromGitHub, cmake, - addOpenGLRunpath, + addDriverRunpath, cudatoolkit, cutensor, }: @@ -20,12 +20,12 @@ let version = lib.strings.substring 0 7 rev + "-" + lib.versions.majorMinor cudatoolkit.version; nativeBuildInputs = [ cmake - addOpenGLRunpath + addDriverRunpath ]; buildInputs = [ cudatoolkit ]; postFixup = '' for exe in $out/bin/*; do - addOpenGLRunpath $exe + addDriverRunpath $exe done ''; meta = { diff --git a/pkgs/development/cuda-modules/cudatoolkit/default.nix b/pkgs/development/cuda-modules/cudatoolkit/default.nix index d2f8e2ce3fdf8..f7be0aa9f4fd2 100644 --- a/pkgs/development/cuda-modules/cudatoolkit/default.nix +++ b/pkgs/development/cuda-modules/cudatoolkit/default.nix @@ -3,7 +3,7 @@ runPatches ? [ ], autoPatchelfHook, autoAddDriverRunpath, - addOpenGLRunpath, + addDriverRunpath, alsa-lib, curlMinimal, expat, @@ -74,7 +74,7 @@ backendStdenv.mkDerivation rec { perl makeWrapper rsync - addOpenGLRunpath + addDriverRunpath autoPatchelfHook autoAddDriverRunpath markForCudatoolkitRootHook diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix index 91d210d639782..3fb94f5986983 100644 --- a/pkgs/development/libraries/ffmpeg/generic.nix +++ b/pkgs/development/libraries/ffmpeg/generic.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, buildPackages, removeReferencesTo, addOpenGLRunpath, pkg-config, perl, texinfo, yasm +{ lib, stdenv, buildPackages, removeReferencesTo, addDriverRunpath, pkg-config, perl, texinfo, yasm # You can fetch any upstream version using this derivation by specifying version and hash # NOTICE: Always use this argument to override the version. Do not use overrideAttrs. @@ -751,7 +751,7 @@ stdenv.mkDerivation (finalAttrs: { strictDeps = true; - nativeBuildInputs = [ removeReferencesTo addOpenGLRunpath perl pkg-config texinfo yasm ] + nativeBuildInputs = [ removeReferencesTo addDriverRunpath perl pkg-config texinfo yasm ] ++ optionals withCudaLLVM [ clang ]; buildInputs = [] @@ -884,10 +884,10 @@ stdenv.mkDerivation (finalAttrs: { ''; # Set RUNPATH so that libnvcuvid and libcuda in /run/opengl-driver(-32)/lib can be found. - # See the explanation in addOpenGLRunpath. + # See the explanation in addDriverRunpath. postFixup = optionalString (stdenv.isLinux && withLib) '' - addOpenGLRunpath ${placeholder "lib"}/lib/libavcodec.so - addOpenGLRunpath ${placeholder "lib"}/lib/libavutil.so + addDriverRunpath ${placeholder "lib"}/lib/libavcodec.so + addDriverRunpath ${placeholder "lib"}/lib/libavutil.so '' # https://trac.ffmpeg.org/ticket/10809 + optionalString (versionAtLeast version "5.0" && withVulkan && !stdenv.hostPlatform.isMinGW) '' diff --git a/pkgs/development/libraries/gstreamer/bad/default.nix b/pkgs/development/libraries/gstreamer/bad/default.nix index 91639c441b481..e5caebca83f35 100644 --- a/pkgs/development/libraries/gstreamer/bad/default.nix +++ b/pkgs/development/libraries/gstreamer/bad/default.nix @@ -81,7 +81,7 @@ , mjpegtools , libGLU , libGL -, addOpenGLRunpath +, addDriverRunpath , gtk3 , libintl , game-music-emu @@ -125,7 +125,7 @@ stdenv.mkDerivation rec { # Add fallback paths for nvidia userspace libraries (substituteAll { src = ./fix-paths.patch; - inherit (addOpenGLRunpath) driverLink; + inherit (addDriverRunpath) driverLink; }) ]; diff --git a/pkgs/development/libraries/level-zero/default.nix b/pkgs/development/libraries/level-zero/default.nix index db99f73cd796b..17218c6e68ad6 100644 --- a/pkgs/development/libraries/level-zero/default.nix +++ b/pkgs/development/libraries/level-zero/default.nix @@ -1,5 +1,5 @@ { lib -, addOpenGLRunpath +, addDriverRunpath , cmake , fetchFromGitHub , intel-compute-runtime @@ -18,10 +18,10 @@ stdenv.mkDerivation rec { hash = "sha256-vtijha0nXHEp5oLnmdtbD80Qa2dgMykZXhQ2yfbk+mY="; }; - nativeBuildInputs = [ cmake addOpenGLRunpath ]; + nativeBuildInputs = [ cmake addDriverRunpath ]; postFixup = '' - addOpenGLRunpath $out/lib/libze_loader.so + addDriverRunpath $out/lib/libze_loader.so ''; passthru.tests = { diff --git a/pkgs/development/libraries/libglvnd/default.nix b/pkgs/development/libraries/libglvnd/default.nix index 9a9c3b861d6d4..d3e85c012cf11 100644 --- a/pkgs/development/libraries/libglvnd/default.nix +++ b/pkgs/development/libraries/libglvnd/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchFromGitLab , fetchpatch -, autoreconfHook, pkg-config, python3, addOpenGLRunpath +, autoreconfHook, pkg-config, python3, addDriverRunpath , libX11, libXext, xorgproto }: @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { }) ]; - nativeBuildInputs = [ autoreconfHook pkg-config python3 addOpenGLRunpath ]; + nativeBuildInputs = [ autoreconfHook pkg-config python3 addDriverRunpath ]; buildInputs = [ libX11 libXext xorgproto ]; postPatch = lib.optionalString stdenv.isDarwin '' @@ -41,7 +41,7 @@ stdenv.mkDerivation rec { env.NIX_CFLAGS_COMPILE = toString ([ "-UDEFAULT_EGL_VENDOR_CONFIG_DIRS" # FHS paths are added so that non-NixOS applications can find vendor files. - "-DDEFAULT_EGL_VENDOR_CONFIG_DIRS=\"${addOpenGLRunpath.driverLink}/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d\"" + "-DDEFAULT_EGL_VENDOR_CONFIG_DIRS=\"${addDriverRunpath.driverLink}/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d\"" "-Wno-error=array-bounds" ] ++ lib.optionals stdenv.cc.isClang [ @@ -61,10 +61,10 @@ stdenv.mkDerivation rec { # Note that libEGL does not need it because it uses driver config files which should # contain absolute paths to libraries. postFixup = '' - addOpenGLRunpath $out/lib/libGLX.so + addDriverRunpath $out/lib/libGLX.so ''; - passthru = { inherit (addOpenGLRunpath) driverLink; }; + passthru = { inherit (addDriverRunpath) driverLink; }; meta = with lib; { description = "GL Vendor-Neutral Dispatch library"; diff --git a/pkgs/development/libraries/mdk-sdk/default.nix b/pkgs/development/libraries/mdk-sdk/default.nix index 89038628f2f91..bcda5a993d785 100644 --- a/pkgs/development/libraries/mdk-sdk/default.nix +++ b/pkgs/development/libraries/mdk-sdk/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, autoPatchelfHook , alsa-lib, gcc-unwrapped, libX11, libcxx, libdrm, libglvnd, libpulseaudio, libxcb, mesa, wayland, xz, zlib -, libva, libvdpau, addOpenGLRunpath +, libva, libvdpau, addDriverRunpath }: stdenv.mkDerivation rec { @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { ]; appendRunpaths = lib.makeLibraryPath [ - libva libvdpau addOpenGLRunpath.driverLink + libva libvdpau addDriverRunpath.driverLink ]; installPhase = '' diff --git a/pkgs/development/libraries/nvidia-vaapi-driver/default.nix b/pkgs/development/libraries/nvidia-vaapi-driver/default.nix index 92f447a32422e..786a11f482046 100644 --- a/pkgs/development/libraries/nvidia-vaapi-driver/default.nix +++ b/pkgs/development/libraries/nvidia-vaapi-driver/default.nix @@ -9,7 +9,7 @@ , gst_all_1 , nv-codec-headers-11 , libva -, addOpenGLRunpath +, addDriverRunpath }: stdenv.mkDerivation rec { @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { meson ninja pkg-config - addOpenGLRunpath + addDriverRunpath ]; buildInputs = [ @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { ]; postFixup = '' - addOpenGLRunpath "$out/lib/dri/nvidia_drv_video.so" + addDriverRunpath "$out/lib/dri/nvidia_drv_video.so" ''; meta = with lib;{ diff --git a/pkgs/development/libraries/ocl-icd/default.nix b/pkgs/development/libraries/ocl-icd/default.nix index 0930b8904bdf8..f5cdc9f4841a4 100644 --- a/pkgs/development/libraries/ocl-icd/default.nix +++ b/pkgs/development/libraries/ocl-icd/default.nix @@ -3,7 +3,7 @@ , fetchFromGitHub , ruby , opencl-headers -, addOpenGLRunpath +, addDriverRunpath , autoreconfHook , windows }: diff --git a/pkgs/development/libraries/openvino/default.nix b/pkgs/development/libraries/openvino/default.nix index 14ad6c166e551..8ae90599585f0 100644 --- a/pkgs/development/libraries/openvino/default.nix +++ b/pkgs/development/libraries/openvino/default.nix @@ -6,7 +6,7 @@ # build , scons -, addOpenGLRunpath +, addDriverRunpath , autoPatchelfHook , cmake , git @@ -74,7 +74,7 @@ stdenv.mkDerivation rec { ]; nativeBuildInputs = [ - addOpenGLRunpath + addDriverRunpath autoPatchelfHook cmake git @@ -161,7 +161,7 @@ stdenv.mkDerivation rec { postFixup = '' # Link to OpenCL find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" done ''; diff --git a/pkgs/development/libraries/science/chemistry/openmm/default.nix b/pkgs/development/libraries/science/chemistry/openmm/default.nix index 723ced8b2a590..445a45e72b550 100644 --- a/pkgs/development/libraries/science/chemistry/openmm/default.nix +++ b/pkgs/development/libraries/science/chemistry/openmm/default.nix @@ -14,7 +14,7 @@ , config , enableCuda ? config.cudaSupport , cudaPackages -, addOpenGLRunpath +, addDriverRunpath }: stdenv.mkDerivation rec { @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { python3Packages.build python3Packages.installer python3Packages.wheel - ] ++ lib.optional enableCuda addOpenGLRunpath; + ] ++ lib.optional enableCuda addDriverRunpath; buildInputs = [ fftwSinglePrec ] ++ lib.optionals enableOpencl [ ocl-icd opencl-headers ] @@ -94,7 +94,7 @@ stdenv.mkDerivation rec { postFixup = '' for lib in $out/lib/plugins/*CUDA.so $out/lib/plugins/*Cuda*.so; do - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" done ''; diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index 5af73735fdf60..7471ffe07db28 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -12,7 +12,7 @@ , boost , blas , swig -, addOpenGLRunpath +, addDriverRunpath , optLevel ? let optLevels = lib.optionals stdenv.hostPlatform.avx2Support [ "avx2" ] @@ -78,7 +78,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ] ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc - addOpenGLRunpath + addDriverRunpath ] ++ lib.optionals pythonSupport [ pythonPackages.python ]; @@ -119,8 +119,8 @@ stdenv.mkDerivation { ''; postFixup = lib.optionalString (pythonSupport && cudaSupport) '' - addOpenGLRunpath $out/${pythonPackages.python.sitePackages}/faiss/*.so - addOpenGLRunpath $demos/bin/* + addDriverRunpath $out/${pythonPackages.python.sitePackages}/faiss/*.so + addDriverRunpath $demos/bin/* ''; # Need buildPythonPackage for this one diff --git a/pkgs/development/libraries/science/math/libtorch/bin.nix b/pkgs/development/libraries/science/math/libtorch/bin.nix index 5b08cfa7dcf07..e62e621a00437 100644 --- a/pkgs/development/libraries/science/math/libtorch/bin.nix +++ b/pkgs/development/libraries/science/math/libtorch/bin.nix @@ -5,7 +5,7 @@ , libcxx , llvmPackages -, addOpenGLRunpath +, addDriverRunpath , patchelf , fixDarwinDylibNames @@ -31,7 +31,7 @@ in stdenv.mkDerivation { nativeBuildInputs = if stdenv.isDarwin then [ fixDarwinDylibNames ] - else [ patchelf ] ++ lib.optionals cudaSupport [ addOpenGLRunpath ]; + else [ patchelf ] ++ lib.optionals cudaSupport [ addDriverRunpath ]; dontBuild = true; dontConfigure = true; @@ -64,7 +64,7 @@ in stdenv.mkDerivation { echo "setting rpath for $lib..." patchelf --set-rpath "${rpath}:$out/lib" "$lib" ${lib.optionalString cudaSupport '' - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" ''} done '' + lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix index 023bba6ee8e87..97e5131078256 100644 --- a/pkgs/development/libraries/vulkan-loader/default.nix +++ b/pkgs/development/libraries/vulkan-loader/default.nix @@ -1,5 +1,5 @@ { lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libxcb -, libXrandr, wayland, moltenvk, vulkan-headers, addOpenGLRunpath +, libXrandr, wayland, moltenvk, vulkan-headers, addDriverRunpath , testers }: stdenv.mkDerivation (finalAttrs: { @@ -21,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include" ] ++ lib.optional stdenv.isDarwin "-DSYSCONFDIR=${moltenvk}/share" - ++ lib.optional stdenv.isLinux "-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share" + ++ lib.optional stdenv.isLinux "-DSYSCONFDIR=${addDriverRunpath.driverLink}/share" ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "-DUSE_GAS=OFF"; outputs = [ "out" "dev" ]; diff --git a/pkgs/development/libraries/webkitgtk/default.nix b/pkgs/development/libraries/webkitgtk/default.nix index 98c28ca67997d..31bb96dd976cf 100644 --- a/pkgs/development/libraries/webkitgtk/default.nix +++ b/pkgs/development/libraries/webkitgtk/default.nix @@ -62,7 +62,7 @@ , substituteAll , glib , unifdef -, addOpenGLRunpath +, addDriverRunpath , enableGeoLocation ? true , enableExperimental ? false , withLibsecret ? true @@ -90,7 +90,7 @@ stdenv.mkDerivation (finalAttrs: { (substituteAll { src = ./fix-bubblewrap-paths.patch; inherit (builtins) storeDir; - inherit (addOpenGLRunpath) driverLink; + inherit (addDriverRunpath) driverLink; }) ]; diff --git a/pkgs/development/python-modules/cupy/default.nix b/pkgs/development/python-modules/cupy/default.nix index 7212e2d379024..45a192974c33a 100644 --- a/pkgs/development/python-modules/cupy/default.nix +++ b/pkgs/development/python-modules/cupy/default.nix @@ -10,7 +10,7 @@ mock, setuptools, cudaPackages, - addOpenGLRunpath, + addDriverRunpath, pythonOlder, symlinkJoin, }: @@ -64,7 +64,7 @@ buildPythonPackage rec { nativeBuildInputs = [ setuptools wheel - addOpenGLRunpath + addDriverRunpath cython cudaPackages.cuda_nvcc ]; @@ -96,7 +96,7 @@ buildPythonPackage rec { postFixup = '' find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" done ''; diff --git a/pkgs/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index b77a7de7b3575..fbc780c4af270 100644 --- a/pkgs/development/python-modules/jaxlib/default.nix +++ b/pkgs/development/python-modules/jaxlib/default.nix @@ -4,7 +4,7 @@ stdenv, # Build-time dependencies: - addOpenGLRunpath, + addDriverRunpath, autoAddDriverRunpath, bazel_6, binutils, diff --git a/pkgs/development/python-modules/libgpuarray/default.nix b/pkgs/development/python-modules/libgpuarray/default.nix index 7645f8bc74276..751d9b2f706d9 100644 --- a/pkgs/development/python-modules/libgpuarray/default.nix +++ b/pkgs/development/python-modules/libgpuarray/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, - addOpenGLRunpath, + addDriverRunpath, buildPythonPackage, fetchFromGitHub, cmake, @@ -68,7 +68,7 @@ buildPythonPackage rec { fixRunPath $out/lib/libgpuarray.so '' + lib.optionalString cudaSupport '' - addOpenGLRunpath $out/lib/libgpuarray.so + addDriverRunpath $out/lib/libgpuarray.so ''; propagatedBuildInputs = [ @@ -80,7 +80,7 @@ buildPythonPackage rec { nativeBuildInputs = [ cmake cython_0 - ] ++ lib.optionals cudaSupport [ addOpenGLRunpath ]; + ] ++ lib.optionals cudaSupport [ addDriverRunpath ]; buildInputs = [ nose ]; diff --git a/pkgs/development/python-modules/nvidia-ml-py/default.nix b/pkgs/development/python-modules/nvidia-ml-py/default.nix index 52e7c04ca060f..b620f209337eb 100644 --- a/pkgs/development/python-modules/nvidia-ml-py/default.nix +++ b/pkgs/development/python-modules/nvidia-ml-py/default.nix @@ -3,7 +3,7 @@ fetchPypi, buildPythonPackage, substituteAll, - addOpenGLRunpath, + addDriverRunpath, }: buildPythonPackage rec { @@ -20,7 +20,7 @@ buildPythonPackage rec { patches = [ (substituteAll { src = ./0001-locate-libnvidia-ml.so.1-on-NixOS.patch; - inherit (addOpenGLRunpath) driverLink; + inherit (addDriverRunpath) driverLink; }) ]; diff --git a/pkgs/development/python-modules/openai-triton/bin.nix b/pkgs/development/python-modules/openai-triton/bin.nix index bdf722bbc0fca..bb6a7ce99c0fb 100644 --- a/pkgs/development/python-modules/openai-triton/bin.nix +++ b/pkgs/development/python-modules/openai-triton/bin.nix @@ -1,7 +1,7 @@ { lib, stdenv, - addOpenGLRunpath, + addDriverRunpath, cudaPackages, buildPythonPackage, fetchurl, @@ -64,7 +64,7 @@ buildPythonPackage rec { old = [ "-lcuda" ]; new = [ "-lcuda" - "-L${addOpenGLRunpath.driverLink}" + "-L${addDriverRunpath.driverLink}" "-L${cudaPackages.cuda_cudart}/lib/stubs/" ]; diff --git a/pkgs/development/python-modules/paddlepaddle/default.nix b/pkgs/development/python-modules/paddlepaddle/default.nix index b263cdc8e1b99..2388807940429 100644 --- a/pkgs/development/python-modules/paddlepaddle/default.nix +++ b/pkgs/development/python-modules/paddlepaddle/default.nix @@ -12,7 +12,7 @@ setuptools, cudaSupport ? config.cudaSupport or false, cudaPackages_11 ? { }, - addOpenGLRunpath, + addDriverRunpath, # runtime dependencies httpx, numpy, @@ -81,13 +81,13 @@ buildPythonPackage { p=$(patchelf --print-rpath $1) patchelf --set-rpath "$p:$libraryPath" $1 ${lib.optionalString cudaSupport '' - addOpenGLRunpath $1 + addDriverRunpath $1 ''} } fixRunPath $out/${python.sitePackages}/paddle/fluid/libpaddle.so ''; - nativeBuildInputs = [ addOpenGLRunpath ]; + nativeBuildInputs = [ addDriverRunpath ]; propagatedBuildInputs = [ setuptools diff --git a/pkgs/development/python-modules/pycuda/default.nix b/pkgs/development/python-modules/pycuda/default.nix index 145bdcaad36b8..90d71bf7e47c2 100644 --- a/pkgs/development/python-modules/pycuda/default.nix +++ b/pkgs/development/python-modules/pycuda/default.nix @@ -1,6 +1,6 @@ { buildPythonPackage, - addOpenGLRunpath, + addDriverRunpath, fetchPypi, fetchFromGitHub, mako, @@ -46,7 +46,7 @@ buildPythonPackage rec { postFixup = '' find $out/lib -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do echo "setting opengl runpath for $lib..." - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" done ''; @@ -57,7 +57,7 @@ buildPythonPackage rec { py.test ''; - nativeBuildInputs = [ addOpenGLRunpath ]; + nativeBuildInputs = [ addDriverRunpath ]; propagatedBuildInputs = [ numpy diff --git a/pkgs/development/python-modules/pynvml/default.nix b/pkgs/development/python-modules/pynvml/default.nix index 762771c66a2bb..936a4f5ce8476 100644 --- a/pkgs/development/python-modules/pynvml/default.nix +++ b/pkgs/development/python-modules/pynvml/default.nix @@ -5,7 +5,7 @@ fetchFromGitHub, substituteAll, pythonOlder, - addOpenGLRunpath, + addDriverRunpath, setuptools, pytestCheckHook, versioneer, @@ -28,7 +28,7 @@ buildPythonPackage rec { patches = [ (substituteAll { src = ./0001-locate-libnvidia-ml.so.1-on-NixOS.patch; - inherit (addOpenGLRunpath) driverLink; + inherit (addDriverRunpath) driverLink; }) ]; diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index 0f54cade00cd6..d184fd2cb79fb 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -31,7 +31,7 @@ python, keras-applications, keras-preprocessing, - addOpenGLRunpath, + addDriverRunpath, astunparse, flatbuffers, h5py, @@ -91,7 +91,7 @@ buildPythonPackage { h5py ] ++ lib.optional (!isPy3k) mock; - build-system = [ wheel ] ++ lib.optionals cudaSupport [ addOpenGLRunpath ]; + build-system = [ wheel ] ++ lib.optionals cudaSupport [ addDriverRunpath ]; preConfigure = '' unset SOURCE_DATE_EPOCH @@ -189,7 +189,7 @@ buildPythonPackage { chmod a+rx "$lib" patchelf --set-rpath "$rrPath" "$lib" ${lib.optionalString cudaSupport '' - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" ''} done ''; diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index d311edc188ad6..f98b9999da993 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -5,7 +5,7 @@ lib, fetchFromGitHub, symlinkJoin, - addOpenGLRunpath, + addDriverRunpath, fetchpatch, fetchzip, linkFarm, @@ -291,7 +291,7 @@ let perl protobuf-core protobuf-extra - ] ++ lib.optional cudaSupport addOpenGLRunpath; + ] ++ lib.optional cudaSupport addDriverRunpath; buildInputs = [ @@ -564,7 +564,7 @@ let postFixup = lib.optionalString cudaSupport '' find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" done ''; @@ -647,11 +647,11 @@ buildPythonPackage { wrapt ] ++ lib.optionals withTensorboard [ tensorboard ]; - nativeBuildInputs = lib.optionals cudaSupport [ addOpenGLRunpath ]; + nativeBuildInputs = lib.optionals cudaSupport [ addDriverRunpath ]; postFixup = lib.optionalString cudaSupport '' find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do - addOpenGLRunpath "$lib" + addDriverRunpath "$lib" patchelf --set-rpath "${cudatoolkit}/lib:${cudatoolkit.lib}/lib:${cudnn}/lib:${nccl}/lib:$(patchelf --print-rpath "$lib")" "$lib" done diff --git a/pkgs/development/python-modules/torch/bin.nix b/pkgs/development/python-modules/torch/bin.nix index e2899c081e08b..118fa6c824a49 100644 --- a/pkgs/development/python-modules/torch/bin.nix +++ b/pkgs/development/python-modules/torch/bin.nix @@ -7,7 +7,7 @@ python, pythonAtLeast, pythonOlder, - addOpenGLRunpath, + addDriverRunpath, callPackage, cudaPackages, future, @@ -44,7 +44,7 @@ buildPythonPackage { src = fetchurl srcs."${stdenv.system}-${pyVerNoDot}" or unsupported; nativeBuildInputs = lib.optionals stdenv.isLinux [ - addOpenGLRunpath + addDriverRunpath autoPatchelfHook autoAddDriverRunpath ]; diff --git a/pkgs/development/python-modules/torchaudio/bin.nix b/pkgs/development/python-modules/torchaudio/bin.nix index be9710041f9cd..903e1641056b8 100644 --- a/pkgs/development/python-modules/torchaudio/bin.nix +++ b/pkgs/development/python-modules/torchaudio/bin.nix @@ -1,7 +1,7 @@ { lib, stdenv, - addOpenGLRunpath, + addDriverRunpath, autoPatchelfHook, buildPythonPackage, cudaPackages, @@ -54,7 +54,7 @@ buildPythonPackage rec { nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook - addOpenGLRunpath + addDriverRunpath ]; dependencies = [ torch-bin ]; diff --git a/pkgs/development/python-modules/torchvision/bin.nix b/pkgs/development/python-modules/torchvision/bin.nix index fc731fae2e07e..d796159cbb9f9 100644 --- a/pkgs/development/python-modules/torchvision/bin.nix +++ b/pkgs/development/python-modules/torchvision/bin.nix @@ -1,7 +1,7 @@ { lib, stdenv, - addOpenGLRunpath, + addDriverRunpath, autoPatchelfHook, buildPythonPackage, cudaPackages, @@ -41,7 +41,7 @@ buildPythonPackage { nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook - addOpenGLRunpath + addDriverRunpath ]; dependencies = [ diff --git a/pkgs/development/tools/hover/default.nix b/pkgs/development/tools/hover/default.nix index 86630d33cea36..5a2ea9772b40e 100644 --- a/pkgs/development/tools/hover/default.nix +++ b/pkgs/development/tools/hover/default.nix @@ -9,7 +9,7 @@ , writeScript , xorg , libglvnd -, addOpenGLRunpath +, addDriverRunpath , makeWrapper , gcc , go @@ -55,7 +55,7 @@ let sha256 = "sha256-ch59Wx4g72u7x99807ppURI4I+5aJ/W8Zr35q8X68v4="; }; - nativeBuildInputs = [ addOpenGLRunpath makeWrapper ]; + nativeBuildInputs = [ addDriverRunpath makeWrapper ]; buildInputs = libs; @@ -79,7 +79,7 @@ let ''; postFixup = '' - addOpenGLRunpath $out/bin/hover + addDriverRunpath $out/bin/hover ''; }; diff --git a/pkgs/development/tools/renderdoc/default.nix b/pkgs/development/tools/renderdoc/default.nix index 843e4fe2c6758..751eb51853190 100644 --- a/pkgs/development/tools/renderdoc/default.nix +++ b/pkgs/development/tools/renderdoc/default.nix @@ -17,7 +17,7 @@ , pcre , automake , autoconf -, addOpenGLRunpath +, addDriverRunpath , waylandSupport ? false , wayland }: @@ -48,7 +48,7 @@ mkDerivation rec { ]) ++ lib.optional waylandSupport wayland; - nativeBuildInputs = [ cmake makeWrapper pkg-config bison pcre automake autoconf addOpenGLRunpath ]; + nativeBuildInputs = [ cmake makeWrapper pkg-config bison pcre automake autoconf addDriverRunpath ]; postUnpack = '' cp -r ${custom_swig} swig @@ -79,7 +79,7 @@ mkDerivation rec { # The only documentation for this so far is in pkgs/build-support/add-opengl-runpath/setup-hook.sh postFixup = '' - addOpenGLRunpath $out/lib/librenderdoc.so + addDriverRunpath $out/lib/librenderdoc.so ''; passthru.updateScript = nix-update-script { }; diff --git a/pkgs/os-specific/linux/nvidia-x11/settings.nix b/pkgs/os-specific/linux/nvidia-x11/settings.nix index a26acd144125c..fcb804cad6f1d 100644 --- a/pkgs/os-specific/linux/nvidia-x11/settings.nix +++ b/pkgs/os-specific/linux/nvidia-x11/settings.nix @@ -17,7 +17,7 @@ nvidia_x11: sha256: , libvdpau , librsvg , wrapGAppsHook3 -, addOpenGLRunpath +, addDriverRunpath , withGtk2 ? false , withGtk3 ? true }: @@ -114,7 +114,7 @@ stdenv.mkDerivation { fi ''; - nativeBuildInputs = [ pkg-config m4 addOpenGLRunpath ] + nativeBuildInputs = [ pkg-config m4 addDriverRunpath ] ++ lib.optionals withGtk3 [ wrapGAppsHook3 ]; buildInputs = [ jansson libXv libXrandr libXext libXxf86vm libvdpau nvidia_x11 dbus ] @@ -145,7 +145,7 @@ stdenv.mkDerivation { patchelf --set-rpath "$(patchelf --print-rpath $out/bin/$binaryName):$out/lib:${libXv}/lib" \ $out/bin/$binaryName - addOpenGLRunpath $out/bin/$binaryName + addDriverRunpath $out/bin/$binaryName ''; passthru = { diff --git a/pkgs/servers/hqplayerd/default.nix b/pkgs/servers/hqplayerd/default.nix index aa08f781121c8..3cbec0b64818f 100644 --- a/pkgs/servers/hqplayerd/default.nix +++ b/pkgs/servers/hqplayerd/default.nix @@ -1,5 +1,5 @@ { stdenv, lib -, addOpenGLRunpath +, addDriverRunpath , alsa-lib , autoPatchelfHook , cairo @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { ${rpmextract}/bin/rpmextract $src ''; - nativeBuildInputs = [ addOpenGLRunpath autoPatchelfHook rpmextract ]; + nativeBuildInputs = [ addDriverRunpath autoPatchelfHook rpmextract ]; buildInputs = [ alsa-lib @@ -94,11 +94,11 @@ stdenv.mkDerivation rec { --replace "NetworkManager-wait-online.service" "" ''; - # NB: addOpenGLRunpath needs to run _after_ autoPatchelfHook, which runs in + # NB: addDriverRunpath needs to run _after_ autoPatchelfHook, which runs in # postFixup, so we tack it on here. doInstallCheck = true; installCheckPhase = '' - addOpenGLRunpath $out/bin/hqplayerd + addDriverRunpath $out/bin/hqplayerd $out/bin/hqplayerd --version ''; diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 7ca9652baafc7..3e0837323a34c 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -13,7 +13,7 @@ , dbus , hwdata , mangohud32 -, addOpenGLRunpath +, addDriverRunpath , appstream , git , glslang @@ -171,7 +171,7 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ - addOpenGLRunpath + addDriverRunpath git glslang mako @@ -232,10 +232,10 @@ stdenv.mkDerivation (finalAttrs: { --replace "VK_LAYER_MANGOHUD_overlay" "VK_LAYER_MANGOHUD_overlay_${toString stdenv.hostPlatform.parsed.cpu.bits}" '' + '' # Add OpenGL driver and libXNVCtrl paths to RUNPATH to support NVIDIA cards - addOpenGLRunpath "$out/lib/mangohud/libMangoHud.so" + addDriverRunpath "$out/lib/mangohud/libMangoHud.so" patchelf --add-rpath ${libXNVCtrl}/lib "$out/lib/mangohud/libMangoHud.so" '' + lib.optionalString gamescopeSupport '' - addOpenGLRunpath "$out/bin/mangoapp" + addDriverRunpath "$out/bin/mangoapp" '' + lib.optionalString finalAttrs.finalPackage.doCheck '' # libcmocka.so is only used for tests rm "$out/lib/libcmocka.so" diff --git a/pkgs/tools/graphics/vulkan-helper/default.nix b/pkgs/tools/graphics/vulkan-helper/default.nix index 22fb34c8f83f6..0f7fd3fcc9976 100644 --- a/pkgs/tools/graphics/vulkan-helper/default.nix +++ b/pkgs/tools/graphics/vulkan-helper/default.nix @@ -2,7 +2,7 @@ , rustPlatform , fetchFromGitHub , vulkan-loader -, addOpenGLRunpath +, addDriverRunpath }: rustPlatform.buildRustPackage rec { @@ -19,12 +19,12 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-OXMz1qu4/LDeQbwe7shhn2Eee15xKmBpWSsP0IbjoGM="; nativeBuildInputs = [ - addOpenGLRunpath + addDriverRunpath ]; postFixup = '' patchelf --add-rpath ${vulkan-loader}/lib $out/bin/vulkan-helper - addOpenGLRunpath $out/bin/vulkan-helper + addDriverRunpath $out/bin/vulkan-helper ''; meta = with lib; { diff --git a/pkgs/tools/misc/geekbench/4.nix b/pkgs/tools/misc/geekbench/4.nix index 789f92babf80b..bd60ee701ae37 100644 --- a/pkgs/tools/misc/geekbench/4.nix +++ b/pkgs/tools/misc/geekbench/4.nix @@ -2,7 +2,7 @@ , stdenv , fetchurl , autoPatchelfHook -, addOpenGLRunpath +, addDriverRunpath , makeWrapper , ocl-icd , vulkan-loader @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { for f in geekbench4 geekbench_x86_64 ; do wrapProgram $out/bin/$f \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ - addOpenGLRunpath.driverLink + addDriverRunpath.driverLink ocl-icd vulkan-loader ]}" diff --git a/pkgs/tools/misc/geekbench/5.nix b/pkgs/tools/misc/geekbench/5.nix index 49efe2ea0bf93..0c23877ee8477 100644 --- a/pkgs/tools/misc/geekbench/5.nix +++ b/pkgs/tools/misc/geekbench/5.nix @@ -2,7 +2,7 @@ , stdenv , fetchurl , autoPatchelfHook -, addOpenGLRunpath +, addDriverRunpath , makeWrapper , ocl-icd , vulkan-loader @@ -44,7 +44,7 @@ stdenv.mkDerivation { for f in geekbench5 geekbench_${processor} ; do wrapProgram $out/bin/$f \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ - addOpenGLRunpath.driverLink + addDriverRunpath.driverLink ocl-icd vulkan-loader ]}" diff --git a/pkgs/tools/misc/geekbench/6.nix b/pkgs/tools/misc/geekbench/6.nix index d7dd0ad7158b8..2aca571e2cf99 100644 --- a/pkgs/tools/misc/geekbench/6.nix +++ b/pkgs/tools/misc/geekbench/6.nix @@ -2,7 +2,7 @@ , stdenv , fetchurl , autoPatchelfHook -, addOpenGLRunpath +, addDriverRunpath , makeWrapper , ocl-icd , vulkan-loader @@ -45,7 +45,7 @@ stdenv.mkDerivation { for f in geekbench6 geekbench_${processor} ${geekbench_avx2} ; do wrapProgram $out/bin/$f \ --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ - addOpenGLRunpath.driverLink + addDriverRunpath.driverLink ocl-icd vulkan-loader ]}" diff --git a/pkgs/tools/security/hashcat/default.nix b/pkgs/tools/security/hashcat/default.nix index 56399e61639e4..dc3a5390da3c7 100644 --- a/pkgs/tools/security/hashcat/default.nix +++ b/pkgs/tools/security/hashcat/default.nix @@ -1,5 +1,5 @@ { lib, stdenv -, addOpenGLRunpath +, addDriverRunpath , config , cudaPackages ? {} , cudaSupport ? config.cudaSupport @@ -33,7 +33,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper ] ++ lib.optionals cudaSupport [ - addOpenGLRunpath + addDriverRunpath ]; buildInputs = [ opencl-headers xxHash ] @@ -71,7 +71,7 @@ stdenv.mkDerivation rec { '' + lib.optionalString cudaSupport '' for program in $out/bin/hashcat $out/bin/.hashcat-wrapped; do isELF "$program" || continue - addOpenGLRunpath "$program" + addDriverRunpath "$program" done ''; diff --git a/pkgs/tools/system/nvtop/build-nvtop.nix b/pkgs/tools/system/nvtop/build-nvtop.nix index cfc13f14c4719..0feada287d87c 100644 --- a/pkgs/tools/system/nvtop/build-nvtop.nix +++ b/pkgs/tools/system/nvtop/build-nvtop.nix @@ -8,7 +8,7 @@ , ncurses , testers , udev -, addOpenGLRunpath +, addDriverRunpath , amd ? false , intel ? false , msm ? false @@ -51,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: { (cmakeBool "PANTHOR_SUPPORT" panthor) (cmakeBool "ASCEND_SUPPORT" ascend) ]; - nativeBuildInputs = [ cmake gtest ] ++ lib.optional nvidia addOpenGLRunpath; + nativeBuildInputs = [ cmake gtest ] ++ lib.optional nvidia addDriverRunpath; buildInputs = with lib; [ ncurses udev ] ++ optional nvidia cudatoolkit @@ -62,7 +62,7 @@ stdenv.mkDerivation (finalAttrs: { env.NIX_CFLAGS_COMPILE = lib.optionalString needDrm "-isystem ${lib.getDev libdrm}/include/libdrm"; # ordering of fixups is important - postFixup = (lib.optionalString needDrm drm-postFixup) + (lib.optionalString nvidia "addOpenGLRunpath $out/bin/nvtop"); + postFixup = (lib.optionalString needDrm drm-postFixup) + (lib.optionalString nvidia "addDriverRunpath $out/bin/nvtop"); doCheck = true; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 8a5e10e86faf7..2cbf4cdae0d39 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -69,6 +69,8 @@ mapAliases ({ adtool = throw "'adtool' has been removed, as it was broken and unmaintained"; adom = throw "'adom' has been removed, as it was broken and unmaintained"; # added 2024-05-09 advcpmv = throw "'advcpmv' has been removed, as it is not being actively maintained and break recent coreutils."; # Added 2024-03-29 + # Post 24.11 branch-off, this should throw an error + addOpenGLRunpath = addDriverRunpath; # Added 2024-05-25 aether = throw "aether has been removed from nixpkgs; upstream unmaintained, security issues"; # Added 2023-10-03 afl = throw "afl has been removed as the upstream project was archived. Consider using 'aflplusplus'"; # Added 2024-04-21 airfield = throw "airfield has been removed due to being unmaintained"; # Added 2023-05-19 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bd60e1a1ab3c0..49391a0f6d5d7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -226,10 +226,6 @@ with pkgs; # many more scenarios than just opengl now. addDriverRunpath = callPackage ../build-support/add-driver-runpath { }; - # addOpenGLRunpath should be added to aliases.nix after the 24.05 branch-off. - # Post 24.11 branch-off, this should throw an error in aliases.nix. - addOpenGLRunpath = callPackage ../build-support/add-opengl-runpath { }; - quickgui = callPackage ../applications/virtualization/quickgui { }; adcli = callPackage ../os-specific/linux/adcli { };