forked from mirrors/nixpkgs
Merge pull request #21574 from veprbl/ycm_fix
youcompleteme: fix compilation
This commit is contained in:
commit
2c288548b9
|
@ -1309,17 +1309,18 @@ rec {
|
|||
dependencies = [];
|
||||
buildInputs = [
|
||||
python go cmake
|
||||
(if stdenv.isDarwin then llvmPackages.clang else llvmPackages.clang-unwrapped)
|
||||
llvmPackages.llvm
|
||||
] ++ stdenv.lib.optional stdenv.isDarwin Cocoa;
|
||||
|
||||
propagatedBuildInputs = stdenv.lib.optional (!stdenv.isDarwin) rustracerd;
|
||||
|
||||
patches = [
|
||||
./patches/youcompleteme/1-top-cmake.patch
|
||||
./patches/youcompleteme/2-ycm-cmake.patch
|
||||
];
|
||||
|
||||
# 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"}";
|
||||
|
||||
buildPhase = ''
|
||||
patchShebangs .
|
||||
substituteInPlace plugin/youcompleteme.vim \
|
||||
|
@ -1327,9 +1328,10 @@ rec {
|
|||
|
||||
mkdir build
|
||||
pushd build
|
||||
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 -DUSE_SYSTEM_LIBCLANG=ON
|
||||
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
|
||||
make ycm_core -j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
|
||||
${python}/bin/python ../third_party/ycmd/build.py --gocode-completer --clang-completer --system-libclang
|
||||
${python}/bin/python ../third_party/ycmd/build.py --gocode-completer --clang-completer
|
||||
popd
|
||||
'';
|
||||
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
|
||||
--- ./third_party/ycmd/cpp/CMakeLists.txt
|
||||
+++ ./third_party/ycmd/cpp/CMakeLists.txt
|
||||
@@ -121,8 +121,8 @@
|
||||
set( CPP11_AVAILABLE true )
|
||||
endif()
|
||||
elseif( COMPILER_IS_CLANG )
|
||||
- set( CPP11_AVAILABLE true )
|
||||
- set( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" )
|
||||
+ #set( CPP11_AVAILABLE true )
|
||||
+ # set( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" )
|
||||
set( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
|
||||
endif()
|
||||
|
|
@ -1,16 +1,17 @@
|
|||
buildInputs = [
|
||||
python go cmake
|
||||
(if stdenv.isDarwin then llvmPackages.clang else llvmPackages.clang-unwrapped)
|
||||
llvmPackages.llvm
|
||||
] ++ stdenv.lib.optional stdenv.isDarwin Cocoa;
|
||||
|
||||
propagatedBuildInputs = stdenv.lib.optional (!stdenv.isDarwin) rustracerd;
|
||||
|
||||
patches = [
|
||||
./patches/youcompleteme/1-top-cmake.patch
|
||||
./patches/youcompleteme/2-ycm-cmake.patch
|
||||
];
|
||||
|
||||
# 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"}";
|
||||
|
||||
buildPhase = ''
|
||||
patchShebangs .
|
||||
substituteInPlace plugin/youcompleteme.vim \
|
||||
|
@ -18,9 +19,10 @@
|
|||
|
||||
mkdir build
|
||||
pushd build
|
||||
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 -DUSE_SYSTEM_LIBCLANG=ON
|
||||
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
|
||||
make ycm_core -j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
|
||||
${python}/bin/python ../third_party/ycmd/build.py --gocode-completer --clang-completer --system-libclang
|
||||
${python}/bin/python ../third_party/ycmd/build.py --gocode-completer --clang-completer
|
||||
popd
|
||||
'';
|
||||
|
||||
|
|
Loading…
Reference in a new issue