From c860316dbc98af49af350e9ef487a646d15d262c Mon Sep 17 00:00:00 2001 From: Jason Yundt Date: Sun, 21 Jul 2024 20:15:34 -0400 Subject: [PATCH] vcpkg: fix binaries not being able to find libstdc++ Before this change, if you tried to run a binary that was installed by vcpkg, then you would get this error: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory This change prevents that error from happening. Fixes #317553. --- pkgs/by-name/vc/vcpkg/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/vc/vcpkg/package.nix b/pkgs/by-name/vc/vcpkg/package.nix index 74e16ebf8465..f92719cb0cc7 100644 --- a/pkgs/by-name/vc/vcpkg/package.nix +++ b/pkgs/by-name/vc/vcpkg/package.nix @@ -27,6 +27,9 @@ stdenvNoCC.mkDerivation (finalAttrs: { --replace-fail "arm-linux-gnueabihf-as" "armv7l-unknown-linux-gnueabihf-as" \ --replace-fail "arm-linux-gnueabihf-gcc" "armv7l-unknown-linux-gnueabihf-gcc" \ --replace-fail "arm-linux-gnueabihf-g++" "armv7l-unknown-linux-gnueabihf-g++" + # If we don’t turn this off, then you won’t be able to run binaries that + # are installed by vcpkg. + find triplets -name '*linux*.cmake' -exec bash -c 'echo "set(X_VCPKG_RPATH_KEEP_SYSTEM_PATHS ON)" >> "$1"' -- {} \; ''; installPhase = ''