summary refs log tree commit diff
path: root/pkgs/applications/editors/jetbrains
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-06-10 21:43:25 +0100
committerJörg Thalheim <joerg@thalheim.io>2017-06-10 21:46:56 +0100
commit0cec85d0eb0bc7716dc2114a10f49884cdf61082 (patch)
treef094d0a2a5b06c69eec941cdbdf65a4fabd78dfd /pkgs/applications/editors/jetbrains
parent73a1307a02bcd87c2d4df6ccd3d216373d2e59c3 (diff)
downloadnixlib-0cec85d0eb0bc7716dc2114a10f49884cdf61082.tar
nixlib-0cec85d0eb0bc7716dc2114a10f49884cdf61082.tar.gz
nixlib-0cec85d0eb0bc7716dc2114a10f49884cdf61082.tar.bz2
nixlib-0cec85d0eb0bc7716dc2114a10f49884cdf61082.tar.lz
nixlib-0cec85d0eb0bc7716dc2114a10f49884cdf61082.tar.xz
nixlib-0cec85d0eb0bc7716dc2114a10f49884cdf61082.tar.zst
nixlib-0cec85d0eb0bc7716dc2114a10f49884cdf61082.zip
jetbrains.clion: fix bundled tools
Diffstat (limited to 'pkgs/applications/editors/jetbrains')
-rw-r--r--pkgs/applications/editors/jetbrains/default.nix34
1 files changed, 31 insertions, 3 deletions
diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix
index 7eb34b47c768..71f0a56afb37 100644
--- a/pkgs/applications/editors/jetbrains/default.nix
+++ b/pkgs/applications/editors/jetbrains/default.nix
@@ -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 }: