jetbrains.clion: fix bundled tools

This commit is contained in:
Jörg Thalheim 2017-06-10 21:43:25 +01:00
parent 73a1307a02
commit 0cec85d0eb
No known key found for this signature in database
GPG Key ID: CA4106B8D7CC79FA

View File

@ -1,17 +1,19 @@
{ lib, stdenv, callPackage, fetchurl, makeDesktopItem, makeWrapper, patchelf
, coreutils, gnugrep, which, git, python, unzip, p7zip
, androidsdk, jdk
, androidsdk, jdk, cmake, libxml2, zlib, python2, ncurses
}:
assert stdenv.isLinux;
with stdenv.lib;
let
mkJetBrainsProduct = callPackage ./common.nix { };
# Sorted alphabetically
buildClion = { name, version, src, license, description, wmClass }:
(mkJetBrainsProduct rec {
lib.overrideDerivation (mkJetBrainsProduct rec {
inherit name version src wmClass jdk;
product = "CLion";
meta = with stdenv.lib; {
@ -21,9 +23,35 @@ let
Enhancing productivity for every C and C++
developer on Linux, OS X and Windows.
'';
maintainers = with maintainers; [ edwtjo ];
maintainers = with maintainers; [ edwtjo mic92 ];
platforms = platforms.linux;
};
}) (attrs: {
postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) ''
(
cd $out/clion-${version}
# bundled cmake does not find libc
rm -rf bin/cmake
ln -s ${cmake} bin/cmake
lldbLibPath=$out/clion-${version}/bin/lldb/lib
interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
ln -s ${ncurses.out}/lib/libncurses.so $lldbLibPath/libtinfo.so.5
patchelf --set-interpreter $interp \
--set-rpath "${lib.makeLibraryPath [ libxml2 zlib stdenv.cc.cc.lib ]}:$lldbLibPath" \
bin/lldb/bin/lldb-server
patchelf --set-interpreter $interp \
--set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib ]}:$lldbLibPath" \
bin/lldb/LLDBFrontend
patchelf \
--set-rpath "${lib.makeLibraryPath [ libxml2 zlib stdenv.cc.cc.lib python2 ]}:$lldbLibPath" \
bin/lldb/lib/liblldb.so
patchelf --set-interpreter $interp bin/gdb/bin/gdb
patchelf --set-interpreter $interp bin/gdb/bin/gdbserver
)
'';
});
buildDataGrip = { name, version, src, license, description, wmClass }: