treewide: use addDriverRunpath

Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
This commit is contained in:
Sefa Eyeoglu 2023-12-18 19:34:35 +01:00
parent 484dd2f92f
commit 416ba8804b
No known key found for this signature in database
GPG Key ID: E13DFD4B47127951
58 changed files with 158 additions and 158 deletions

View File

@ -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"
];
}

View File

@ -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
'';

View File

@ -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

View File

@ -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 ''

View File

@ -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; {

View File

@ -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; {

View File

@ -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}
)

View File

@ -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

View File

@ -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 = ''

View File

@ -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

View File

@ -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
'';

View File

@ -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/

View File

@ -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
''

View File

@ -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

View File

@ -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}

View File

@ -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

View File

@ -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*"
];

View File

@ -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}"
];

View File

@ -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
'';

View File

@ -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 = {

View File

@ -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

View File

@ -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) ''

View File

@ -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;
})
];

View File

@ -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 = {

View File

@ -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";

View File

@ -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 = ''

View File

@ -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;{

View File

@ -3,7 +3,7 @@
, fetchFromGitHub
, ruby
, opencl-headers
, addOpenGLRunpath
, addDriverRunpath
, autoreconfHook
, windows
}:

View File

@ -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
'';

View File

@ -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
'';

View File

@ -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

View File

@ -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 ''

View File

@ -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" ];

View File

@ -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;
})
];

View File

@ -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
'';

View File

@ -4,7 +4,7 @@
stdenv,
# Build-time dependencies:
addOpenGLRunpath,
addDriverRunpath,
autoAddDriverRunpath,
bazel_6,
binutils,

View File

@ -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 ];

View File

@ -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;
})
];

View File

@ -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/"
];

View File

@ -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

View File

@ -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

View File

@ -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;
})
];

View File

@ -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
'';

View File

@ -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

View File

@ -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
];

View File

@ -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 ];

View File

@ -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 = [

View File

@ -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
'';
};

View File

@ -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 { };

View File

@ -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 = {

View File

@ -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
'';

View File

@ -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"

View File

@ -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; {

View File

@ -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
]}"

View File

@ -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
]}"

View File

@ -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
]}"

View File

@ -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
'';

View File

@ -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;