summary refs log tree commit diff
path: root/pkgs/development/tools/misc/ycmd/default.nix
blob: df7cc3e279a02d3680491fa2ad08239b20482975 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ stdenv, fetchgit, cmake, python, llvmPackages, boost, pythonPackages, buildPythonApplication, makeWrapper
}:

stdenv.mkDerivation rec {
  name = "ycmd-2016-01-12";

  src = fetchgit {
    url = "git://github.com/Valloric/ycmd.git";
    rev = "f982f6251c5ff85e3abe6e862aad8bcd19e85ece";
    sha256 = "1g0hivv3wla7z5dgnkcn3ny38p089pjfj36nx6k29zmprgmjinyr";
  };

  buildInputs = [ python cmake llvmPackages.clang boost makeWrapper ];

  propagatedBuildInputs = with pythonPackages; [ waitress frozendict bottle ];

  buildPhase = ''
    python build.py --clang-completer --system-libclang --system-boost
  '';

  configurePhase = ":";

  installPhase = with pythonPackages; ''
    mkdir -p $out/lib/ycmd/third_party $out/bin
    cp -r ycmd/ CORE_VERSION libclang.so.* ycm_client_support.so ycm_core.so $out/lib/ycmd/
    wrapProgram $out/lib/ycmd/ycmd/__main__.py \
      --prefix PYTHONPATH : "$(toPythonPath ${waitress}):$(toPythonPath ${frozendict}):$(toPythonPath ${bottle})"
    ln -s $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd
  '';

  meta = {
    description = "A code-completion and comprehension server";
    homepage = "https://github.com/Valloric/ycmd";
    license = stdenv.lib.licenses.gpl3;
    platforms = stdenv.lib.platforms.all;
  };
}