2016-01-10 02:19:06 -08:00
|
|
|
buildInputs = [
|
|
|
|
python go cmake
|
|
|
|
] ++ stdenv.lib.optional stdenv.isDarwin Cocoa;
|
|
|
|
|
2016-07-09 17:26:19 -07:00
|
|
|
propagatedBuildInputs = stdenv.lib.optional (!stdenv.isDarwin) rustracerd;
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./patches/youcompleteme/2-ycm-cmake.patch
|
2016-03-20 00:29:47 -07:00
|
|
|
];
|
|
|
|
|
2016-12-30 18:57:50 -08:00
|
|
|
# YCM requires path to external libclang 3.9
|
|
|
|
# For explicit use and as env variable for ../third_party/ycmd/build.py
|
|
|
|
EXTRA_CMAKE_ARGS="-DEXTERNAL_LIBCLANG_PATH=${llvmPackages.clang.cc}/lib/libclang.${if stdenv.isDarwin then "dylib" else "so"}";
|
|
|
|
|
2016-01-10 02:19:06 -08:00
|
|
|
buildPhase = ''
|
|
|
|
patchShebangs .
|
2016-01-16 11:14:49 -08:00
|
|
|
substituteInPlace plugin/youcompleteme.vim \
|
|
|
|
--replace "'ycm_path_to_python_interpreter', '''" "'ycm_path_to_python_interpreter', '${python}/bin/python'"
|
2016-01-10 02:19:06 -08:00
|
|
|
|
|
|
|
mkdir build
|
|
|
|
pushd build
|
2016-12-30 18:57:50 -08:00
|
|
|
cmake -G "Unix Makefiles" . ../third_party/ycmd/cpp -DPYTHON_LIBRARIES:PATH=${python}/lib/libpython2.7.so -DPYTHON_INCLUDE_DIR:PATH=${python}/include/python2.7 -DUSE_CLANG_COMPLETER=ON \
|
|
|
|
$EXTRA_CMAKE_ARGS
|
2016-03-19 03:11:22 -07:00
|
|
|
make ycm_core -j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
|
2016-12-30 18:57:50 -08:00
|
|
|
${python}/bin/python ../third_party/ycmd/build.py --gocode-completer --clang-completer
|
2016-01-10 02:19:06 -08:00
|
|
|
popd
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Fastest non utf-8 aware word and C completion engine for Vim";
|
|
|
|
homepage = http://github.com/Valloric/YouCompleteMe;
|
|
|
|
license = stdenv.lib.licenses.gpl3;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [marcweber jagajaga];
|
2016-01-19 13:41:31 -08:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2016-01-10 02:19:06 -08:00
|
|
|
};
|