diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2016-12-30 21:57:50 -0500 |
---|---|---|
committer | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2017-01-01 17:35:16 -0500 |
commit | f37c7e01d551d111fc25e3a9a9f71d6654840941 (patch) | |
tree | 83234ee5f706f342eaeb47cc016dfa229540baa9 /pkgs/misc/vim-plugins/default.nix | |
parent | 2cac3742415a1fd32438be8bb4300a9ceb5d7dd6 (diff) | |
download | nixlib-f37c7e01d551d111fc25e3a9a9f71d6654840941.tar nixlib-f37c7e01d551d111fc25e3a9a9f71d6654840941.tar.gz nixlib-f37c7e01d551d111fc25e3a9a9f71d6654840941.tar.bz2 nixlib-f37c7e01d551d111fc25e3a9a9f71d6654840941.tar.lz nixlib-f37c7e01d551d111fc25e3a9a9f71d6654840941.tar.xz nixlib-f37c7e01d551d111fc25e3a9a9f71d6654840941.tar.zst nixlib-f37c7e01d551d111fc25e3a9a9f71d6654840941.zip |
youcompleteme: fix compilation
1) Replace --system-libclang with an explicit setting for the path to nix libclang 3.9. Otherwise it will find system's libclang on darwin. 2) Remove clang/llvm from build inputs. This prevents ycm itself from being compiled by clang 3.9. stdenv's standard compiler (gcc or clang 3.7) will suffice. 3) Enable C++11 again as #16212 is caused by incopatibility between clang 3.9 and libc++ 3.7, but we don't compile YCM with clang 3.9, so this is not needed anymore.
Diffstat (limited to 'pkgs/misc/vim-plugins/default.nix')
-rw-r--r-- | pkgs/misc/vim-plugins/default.nix | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix index 08cdb3465c82..b277f9268bca 100644 --- a/pkgs/misc/vim-plugins/default.nix +++ b/pkgs/misc/vim-plugins/default.nix @@ -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 ''; |