jetbrains.clion: patch lldb instead of replacing

Using LLDB to debug rust programs failed due to a missing executable. See https://github.com/NixOS/nixpkgs/pull/186976#issuecomment-1252194831
This commit is contained in:
GenericNerdyUsername 2022-09-22 11:47:34 +01:00
parent 8a57b26b00
commit de8743c273
No known key found for this signature in database
GPG Key ID: 65BA194581245B15

View File

@ -5,6 +5,9 @@
, maven , maven
, autoPatchelfHook , autoPatchelfHook
, libdbusmenu , libdbusmenu
, patchelf
, openssl
, expat
, vmopts ? null , vmopts ? null
}: }:
@ -41,12 +44,14 @@ let
}).overrideAttrs (attrs: { }).overrideAttrs (attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optionals (stdenv.isLinux) [ nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optionals (stdenv.isLinux) [
autoPatchelfHook autoPatchelfHook
patchelf
]; ];
buildInputs = (attrs.buildInputs or []) ++ optionals (stdenv.isLinux) [ buildInputs = (attrs.buildInputs or []) ++ optionals (stdenv.isLinux) [
python3 python3
stdenv.cc.cc stdenv.cc.cc
libdbusmenu libdbusmenu
lldb openssl.out
expat
]; ];
dontAutoPatchelf = true; dontAutoPatchelf = true;
postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) '' postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) ''
@ -58,9 +63,11 @@ let
# bundled gdb does not find libcrypto 10 # bundled gdb does not find libcrypto 10
rm -rf bin/gdb/linux rm -rf bin/gdb/linux
ln -s ${gdb} bin/gdb/linux ln -s ${gdb} bin/gdb/linux
# bundled lldb does not find libssl
rm -rf bin/lldb/linux ls -d $PWD/bin/lldb/linux/lib/python3.8/lib-dynload/* |
ln -s ${lldb} bin/lldb/linux xargs patchelf \
--replace-needed libssl.so.10 libssl.so \
--replace-needed libcrypto.so.10 libcrypto.so
autoPatchelf $PWD/bin autoPatchelf $PWD/bin