mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 20:02:14 +03:00
jetbrains.clion: switch to autoPatchelfHook
This commit is contained in:
parent
dd2c1dd5c8
commit
110a062a7b
@ -1,6 +1,9 @@
|
||||
{ lib, stdenv, callPackage, fetchurl
|
||||
, jdk, cmake, libxml2, zlib, python3, ncurses5
|
||||
, dotnet-sdk_3
|
||||
, autoPatchelfHook
|
||||
, glib
|
||||
, libdbusmenu-glib
|
||||
, vmopts ? null
|
||||
}:
|
||||
|
||||
@ -25,6 +28,15 @@ let
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}).overrideAttrs (attrs: {
|
||||
nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optional (stdenv.isLinux) [
|
||||
autoPatchelfHook
|
||||
];
|
||||
buildInputs = (attrs.buildInputs or []) ++ optional (stdenv.isLinux) [
|
||||
python3
|
||||
stdenv.cc.cc
|
||||
libdbusmenu-glib
|
||||
];
|
||||
dontAutoPatchelf = true;
|
||||
postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) ''
|
||||
(
|
||||
cd $out/clion-${version}
|
||||
@ -32,52 +44,7 @@ let
|
||||
rm -rf bin/cmake/linux
|
||||
ln -s ${cmake} bin/cmake/linux
|
||||
|
||||
lldbLibPath=$out/clion-${version}/bin/lldb/linux/lib
|
||||
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
|
||||
ln -s ${ncurses5.out}/lib/libtinfo.so.5 $lldbLibPath/libtinfo.so.5
|
||||
|
||||
patchelf --set-interpreter $interp \
|
||||
--set-rpath "${lib.makeLibraryPath [ libxml2 zlib stdenv.cc.cc.lib ]}:$lldbLibPath" \
|
||||
bin/lldb/linux/bin/lldb-server
|
||||
|
||||
for i in LLDBFrontend lldb lldb-argdumper; do
|
||||
patchelf --set-interpreter $interp \
|
||||
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$lldbLibPath" \
|
||||
"bin/lldb/linux/bin/$i"
|
||||
done
|
||||
|
||||
patchelf \
|
||||
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$lldbLibPath" \
|
||||
bin/lldb/linux/lib/python3.*/lib-dynload/zlib.cpython-*-x86_64-linux-gnu.so
|
||||
|
||||
patchelf \
|
||||
--set-rpath "${lib.makeLibraryPath [ libxml2 zlib stdenv.cc.cc.lib python3 ]}:$lldbLibPath" \
|
||||
bin/lldb/linux/lib/liblldb.so
|
||||
|
||||
gdbLibPath=$out/clion-${version}/bin/gdb/linux/lib
|
||||
patchelf \
|
||||
--set-rpath "$gdbLibPath" \
|
||||
bin/gdb/linux/lib/python3.*/lib-dynload/zlib.cpython-*-x86_64-linux-gnu.so
|
||||
patchelf --set-interpreter $interp \
|
||||
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}:$gdbLibPath" \
|
||||
bin/gdb/linux/bin/gdb
|
||||
patchelf --set-interpreter $interp \
|
||||
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$gdbLibPath" \
|
||||
bin/gdb/linux/bin/gdbserver
|
||||
|
||||
clangPath=$out/clion-${version}/bin/clang/linux/
|
||||
patchelf --set-interpreter $interp \
|
||||
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}:$clangPath" \
|
||||
bin/clang/linux/clangd
|
||||
patchelf --set-interpreter $interp \
|
||||
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}" \
|
||||
bin/clang/linux/clang-tidy
|
||||
patchelf --set-interpreter $interp \
|
||||
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}" \
|
||||
bin/clang/linux/llvm-symbolizer
|
||||
patchelf --set-interpreter $interp \
|
||||
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib zlib ]}:$clangPath" \
|
||||
bin/clang/linux/clazy-standalone
|
||||
autoPatchelf $PWD/bin
|
||||
|
||||
wrapProgram $out/bin/clion \
|
||||
--set CL_JDK "${jdk}"
|
||||
|
Loading…
Reference in New Issue
Block a user