From 63746cac08fe242003947167550d28ebc182bf77 Mon Sep 17 00:00:00 2001 From: Yann Hamdaoui Date: Wed, 17 Jan 2024 16:32:24 +0100 Subject: cudaPackages: generalize and refactor setup hook This PR refactor CUDA setup hooks, and in particular autoAddOpenGLRunpath and autoAddCudaCompatRunpathHook, that were using a lot of code in common (in fact, I introduced the latter by copy pasting most of the bash script of the former). This is not satisfying for maintenance, as a recent patch showed, because we need to duplicate changes to both hooks. This commit abstract the common part in a single shell script that applies a generic patch action to every elf file in the output. For autoAddOpenGLRunpath the action is just addOpenGLRunpath (now addDriverRunpath), and is few line function for autoAddCudaCompatRunpathHook. Doing so, we also takes the occasion to use the newer addDriverRunpath instead of the previous addOpenGLRunpath, and rename the CUDA hook to reflect that as well. Co-Authored-By: Connor Baker --- pkgs/tools/system/btop/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/tools/system') diff --git a/pkgs/tools/system/btop/default.nix b/pkgs/tools/system/btop/default.nix index 9b6956fb57804..5961a0fed754a 100644 --- a/pkgs/tools/system/btop/default.nix +++ b/pkgs/tools/system/btop/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ cmake ] ++ lib.optionals cudaSupport [ - cudaPackages.autoAddOpenGLRunpathHook + cudaPackages.autoAddDriverRunpath ]; buildInputs = lib.optionals stdenv.isDarwin [ -- cgit 1.4.1