From 3f102a9ede2fc7763b45bff9242761e961a928ae Mon Sep 17 00:00:00 2001 From: Gregor Lohaus Date: Thu, 28 May 2026 22:49:59 +0200 Subject: [PATCH] remove gl from nix to check how linking fails --- flake.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flake.nix b/flake.nix index cfbfa54..9dc3a7f 100644 --- a/flake.nix +++ b/flake.nix @@ -136,6 +136,7 @@ gluonGraalvm pkgs.gradle_9 pkgs.makeWrapper + pkgs.patchelf pkgs.pkg-config ]; @@ -223,6 +224,15 @@ fi cp "$binary" "$out/bin/jprototerm" + currentRpath="$(patchelf --print-rpath "$out/bin/jprototerm" || true)" + filteredRpath="$(printf '%s' "$currentRpath" | tr ':' '\n' | grep -v 'libglvnd' | paste -sd: -)" + if [ -n "$filteredRpath" ]; then + filteredRpath="$filteredRpath:/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/nvidia/current" + else + filteredRpath="/usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/nvidia/current" + fi + patchelf --set-rpath "$filteredRpath" "$out/bin/jprototerm" + wrapProgram "$out/bin/jprototerm" \ --run 'if [ -d /usr/lib/x86_64-linux-gnu/nvidia/current ]; then export __GLX_VENDOR_LIBRARY_NAME="''${__GLX_VENDOR_LIBRARY_NAME:-nvidia}"; fi' \ --prefix LD_LIBRARY_PATH : "${pkgs.lib.makeLibraryPath runtimeLibs}" \