Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addOpenGLRunpath: deprecate #275241

Merged
merged 2 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nixos/modules/programs/nix-required-mounts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let
);

driverPaths = [
pkgs.addOpenGLRunpath.driverLink
pkgs.addDriverRunpath.driverLink

# mesa:
config.hardware.opengl.package
Expand Down Expand Up @@ -84,7 +84,7 @@ in
{
opengl.paths = config.hardware.opengl.extraPackages ++ [
config.hardware.opengl.package
pkgs.addOpenGLRunpath.driverLink
pkgs.addDriverRunpath.driverLink
"/dev/dri"
];
}
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/emulators/darling/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

, xdg-user-dirs

, addOpenGLRunpath
, addDriverRunpath

# Whether to pre-compile Python 2 bytecode for performance.
, compilePy2Bytecode ? false
Expand Down Expand Up @@ -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
'';

Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/graphics/seamly2d/default.nix
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
];

nativeBuildInputs = [
addOpenGLRunpath
addDriverRunpath
xvfb-run
fontconfig
wrapQtAppsHook
Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/misc/blender/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
OpenAL,
OpenGL,
SDL,
addOpenGLRunpath,
addDriverRunpath,
alembic,
blender,
boost,
Expand Down Expand Up @@ -200,7 +200,7 @@ stdenv.mkDerivation (finalAttrs: {
python3Packages.wrapPython
]
++ lib.optionals cudaSupport [
addOpenGLRunpath
addDriverRunpath
cudaPackages.cuda_nvcc
]
++ lib.optionals waylandSupport [ pkg-config ];
Expand Down Expand Up @@ -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 ''
Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/misc/firestarter/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, lib
, fetchFromGitHub
, fetchzip
, addOpenGLRunpath
, addDriverRunpath
, cmake
, glibc_multi
, glibc
Expand Down Expand Up @@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
git
pkg-config
] ++ lib.optionals withCuda [
addOpenGLRunpath
addDriverRunpath
];

buildInputs = [ hwloc ] ++ (if withCuda then
Expand Down Expand Up @@ -95,7 +95,7 @@ stdenv.mkDerivation rec {
'';

postFixup = lib.optionalString withCuda ''
addOpenGLRunpath $out/bin/FIRESTARTER_CUDA
addDriverRunpath $out/bin/FIRESTARTER_CUDA
'';

meta = with lib; {
Expand Down
6 changes: 3 additions & 3 deletions pkgs/applications/misc/gpu-burn/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, addOpenGLRunpath, cudatoolkit }:
{ lib, stdenv, fetchFromGitHub, addDriverRunpath, cudatoolkit }:

stdenv.mkDerivation {
pname = "gpu-burn";
Expand All @@ -19,7 +19,7 @@ stdenv.mkDerivation {

buildInputs = [ cudatoolkit ];

nativeBuildInputs = [ addOpenGLRunpath ];
nativeBuildInputs = [ addDriverRunpath ];

makeFlags = [ "CUDAPATH=${cudatoolkit}" ];

Expand All @@ -32,7 +32,7 @@ stdenv.mkDerivation {
'';

postFixup = ''
addOpenGLRunpath $out/bin/gpu_burn
addDriverRunpath $out/bin/gpu_burn
'';

meta = with lib; {
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/browsers/brave/make-brave.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
}:

Expand Down Expand Up @@ -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}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ addOpenGLRunpath
{ addDriverRunpath
, alsa-lib
, at-spi2-atk
, at-spi2-core
Expand Down Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions pkgs/applications/science/math/mathematica/generic.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ addOpenGLRunpath
{ addDriverRunpath
, autoPatchelfHook
, lib
, makeWrapper
Expand Down Expand Up @@ -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
'';
Expand All @@ -69,7 +69,7 @@ in stdenv.mkDerivation {
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
] ++ lib.optional cudaSupport addOpenGLRunpath;
] ++ lib.optional cudaSupport addDriverRunpath;

buildInputs = [
alsa-lib
Expand Down Expand Up @@ -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 = ''
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/video/davinci-resolve/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
, runCommandLocal
, unzip
, appimage-run
, addOpenGLRunpath
, addDriverRunpath
, dbus
, libGLU
, xorg
Expand Down Expand Up @@ -38,7 +38,7 @@ let

nativeBuildInputs = [
(appimage-run.override { buildFHSEnv = buildFHSEnvChroot; } )
addOpenGLRunpath
addDriverRunpath
copyDesktopItems
unzip
];
Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/video/mpv/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
lib,
SDL2,
addOpenGLRunpath,
addDriverRunpath,
alsa-lib,
bash,
buildPackages,
Expand Down Expand Up @@ -203,7 +203,7 @@ stdenv'.mkDerivation (finalAttrs: {

nativeBuildInputs =
[
addOpenGLRunpath
addDriverRunpath
docutils # for rst2man
meson
ninja
Expand Down Expand Up @@ -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
'';

Expand Down
8 changes: 4 additions & 4 deletions pkgs/applications/video/obs-studio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, stdenv
, fetchFromGitHub
, fetchpatch
, addOpenGLRunpath
, addDriverRunpath
, cmake
, fdk_aac
, ffmpeg
Expand Down Expand Up @@ -87,7 +87,7 @@ stdenv.mkDerivation (finalAttrs: {
];

nativeBuildInputs = [
addOpenGLRunpath
addDriverRunpath
cmake
pkg-config
wrapGAppsHook3
Expand Down Expand Up @@ -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/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ stdenv
, lib
, addOpenGLRunpath
, addDriverRunpath
, fetchFromGitHub
, pkg-config
, elfutils
Expand Down Expand Up @@ -102,7 +102,7 @@ stdenv.mkDerivation rec {

postInstall =
let
inherit (addOpenGLRunpath) driverLink;
inherit (addDriverRunpath) driverLink;
libraryPath = lib.makeLibraryPath [ "$out" driverLink "${driverLink}-32" ];
in
''
Expand Down
12 changes: 0 additions & 12 deletions pkgs/build-support/add-opengl-runpath/default.nix

This file was deleted.

29 changes: 0 additions & 29 deletions pkgs/build-support/add-opengl-runpath/setup-hook.sh

This file was deleted.

4 changes: 2 additions & 2 deletions pkgs/by-name/ce/cemu/package.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
lib,
SDL2,
addOpenGLRunpath,
addDriverRunpath,
boost,
cmake,
cubeb,
Expand Down Expand Up @@ -66,7 +66,7 @@ in stdenv.mkDerivation (finalAttrs: {

nativeBuildInputs = [
SDL2
addOpenGLRunpath
addDriverRunpath
wrapGAppsHook3
cmake
glslang
Expand Down
4 changes: 2 additions & 2 deletions pkgs/by-name/go/google-chrome/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
, libvaSupport ? true, libva

# For Vulkan support (--enable-features=Vulkan)
, addOpenGLRunpath
, addDriverRunpath
}:

let
Expand Down Expand Up @@ -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}
Expand Down
Loading