From 0ca5879b5a9c28bfe4c2bce1559b94995ee6b5f0 Mon Sep 17 00:00:00 2001 From: Brandon Kase Date: Sat, 9 Jul 2016 17:26:19 -0700 Subject: [PATCH] vimPlugins: fix youcompleteme on darwin --- pkgs/misc/vim-plugins/default.nix | 7 ++-- .../patches/youcompleteme/1-top-cmake.patch | 14 ++++++++ .../patches/youcompleteme/2-ycm-cmake.patch | 36 +++++++++++++++++++ .../vim2nix/additional-nix-code/youcompleteme | 7 ++-- 4 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 pkgs/misc/vim-plugins/patches/youcompleteme/1-top-cmake.patch create mode 100644 pkgs/misc/vim-plugins/patches/youcompleteme/2-ycm-cmake.patch diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix index 6c20cd66df1a..b06f609bffa3 100644 --- a/pkgs/misc/vim-plugins/default.nix +++ b/pkgs/misc/vim-plugins/default.nix @@ -1159,8 +1159,11 @@ rec { llvmPackages.llvm ] ++ stdenv.lib.optional stdenv.isDarwin Cocoa; - propagatedBuildInputs = [ - rustracerd + propagatedBuildInputs = stdenv.lib.optional (!stdenv.isDarwin) rustracerd; + + patches = [ + ./patches/youcompleteme/1-top-cmake.patch + ./patches/youcompleteme/2-ycm-cmake.patch ]; buildPhase = '' diff --git a/pkgs/misc/vim-plugins/patches/youcompleteme/1-top-cmake.patch b/pkgs/misc/vim-plugins/patches/youcompleteme/1-top-cmake.patch new file mode 100644 index 000000000000..fddf91b1c57c --- /dev/null +++ b/pkgs/misc/vim-plugins/patches/youcompleteme/1-top-cmake.patch @@ -0,0 +1,14 @@ + +--- ./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() + diff --git a/pkgs/misc/vim-plugins/patches/youcompleteme/2-ycm-cmake.patch b/pkgs/misc/vim-plugins/patches/youcompleteme/2-ycm-cmake.patch new file mode 100644 index 000000000000..a1c4b1b39a46 --- /dev/null +++ b/pkgs/misc/vim-plugins/patches/youcompleteme/2-ycm-cmake.patch @@ -0,0 +1,36 @@ +--- ./third_party/ycmd/cpp/ycm/CMakeLists.txt ++++ ./third_party/ycmd/cpp/ycm/CMakeLists.txt +@@ -335,7 +335,7 @@ + COMMAND ${CMAKE_COMMAND} -E copy "${LIBCLANG_TARGET}" "$" + ) + +- if( APPLE ) ++ #if( APPLE ) + # In OS X El Capitan, Apple introduced System Integrity Protection. + # Amongst other things, this introduces features to the dynamic loader + # (dyld) which cause it to "sanitise" (and complain about) embedded +@@ -354,15 +354,15 @@ + # simply strip the rpath entry from the dylib. There's no way any + # @executable_path that python might have could be in any way useful to + # libclang.dylib, so this seems perfectly safe. +- get_filename_component( LIBCLANG_TAIL ${LIBCLANG_TARGET} NAME ) +- add_custom_command( TARGET ${PROJECT_NAME} +- POST_BUILD +- COMMAND install_name_tool +- "-delete_rpath" +- "@executable_path/../lib" +- "$/${LIBCLANG_TAIL}" +- ) +- endif() ++ # get_filename_component( LIBCLANG_TAIL ${LIBCLANG_TARGET} NAME ) ++ #add_custom_command( TARGET ${PROJECT_NAME} ++ # POST_BUILD ++ # COMMAND install_name_tool ++ # "-delete_rpath" ++ # "@executable_path/../lib" ++ # "$/${LIBCLANG_TAIL}" ++ # ) ++ # endif() + endif() + endif() + diff --git a/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/youcompleteme b/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/youcompleteme index eb7f6bedf497..4b81be5205b8 100644 --- a/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/youcompleteme +++ b/pkgs/misc/vim-plugins/vim2nix/additional-nix-code/youcompleteme @@ -4,8 +4,11 @@ llvmPackages.llvm ] ++ stdenv.lib.optional stdenv.isDarwin Cocoa; - propagatedBuildInputs = [ - rustracerd + propagatedBuildInputs = stdenv.lib.optional (!stdenv.isDarwin) rustracerd; + + patches = [ + ./patches/youcompleteme/1-top-cmake.patch + ./patches/youcompleteme/2-ycm-cmake.patch ]; buildPhase = ''