···11+diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt
22+index 2074c58e..9ecd6e57 100644
33+--- a/cpp/ycm/CMakeLists.txt
44++++ b/cpp/ycm/CMakeLists.txt
55+@@ -366,35 +366,6 @@ if( LIBCLANG_TARGET )
66+ POST_BUILD
77+ COMMAND ${CMAKE_COMMAND} -E copy "${LIBCLANG_TARGET}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>"
88+ )
99+-
1010+- if( APPLE )
1111+- # In OS X El Capitan, Apple introduced System Integrity Protection.
1212+- # Amongst other things, this introduces features to the dynamic loader
1313+- # (dyld) which cause it to "sanitise" (and complain about) embedded
1414+- # LC_RPATH entries which contain @executable_path when then are loaded
1515+- # into "restricted" binaries. For our purposes, "restricted" here means
1616+- # "supplied by Apple" and includes the system versions of python. For
1717+- # unknown reasons, the libclang.dylib that comes from llvm.org includes an
1818+- # LC_RPATH entry '@executable_path/../lib' which causes the OS X dynamic
1919+- # loader to print a cryptic warning to stderr of the form:
2020+- #
2121+- # dyld: warning, LC_RPATH @executable_path/../lib in
2222+- # /path/to/ycmd/libclang.dylib being ignored in restricted program
2323+- # because of @executable_path
2424+- #
2525+- # In order to prevent this harmless and annoying message appearing, we
2626+- # simply strip the rpath entry from the dylib. There's no way any
2727+- # @executable_path that python might have could be in any way useful to
2828+- # libclang.dylib, so this seems perfectly safe.
2929+- get_filename_component( LIBCLANG_TAIL ${LIBCLANG_TARGET} NAME )
3030+- add_custom_command( TARGET ${PROJECT_NAME}
3131+- POST_BUILD
3232+- COMMAND install_name_tool
3333+- "-delete_rpath"
3434+- "@executable_path/../lib"
3535+- "$<TARGET_FILE_DIR:${PROJECT_NAME}>/${LIBCLANG_TAIL}"
3636+- )
3737+- endif()
3838+ endif()
3939+ endif()
4040+
+58-14
pkgs/development/tools/misc/ycmd/default.nix
···11-{ stdenv, fetchgit, cmake, llvmPackages, boost, python2Packages
11+{ stdenv, lib, fetchgit, cmake, llvmPackages, boost, python
22+, gocode ? null
33+, godef ? null
44+, rustracerd ? null
55+, Cocoa ? null
26}:
3744-let
55- inherit (python2Packages) python mkPythonDerivation waitress frozendict bottle;
66-in mkPythonDerivation rec {
77- name = "ycmd-2016-01-12";
88- namePrefix = "";
88+stdenv.mkDerivation rec {
99+ name = "ycmd-${version}";
1010+ version = "2017-02-03";
9111012 src = fetchgit {
1113 url = "git://github.com/Valloric/ycmd.git";
1212- rev = "f982f6251c5ff85e3abe6e862aad8bcd19e85ece";
1313- sha256 = "1g0hivv3wla7z5dgnkcn3ny38p089pjfj36nx6k29zmprgmjinyr";
1414+ rev = "ec7a154f8fe50c071ecd0ac6841de8a50ce92f5d";
1515+ sha256 = "0rzxgqqqmmrv9r4k2ji074iprhw6sb0jkvh84wvi45yfyphsh0xi";
1416 };
15171616- buildInputs = [ cmake boost ];
1717-1818- propagatedBuildInputs = [ waitress frozendict bottle ];
1818+ buildInputs = [ cmake boost ] ++ stdenv.lib.optional stdenv.isDarwin Cocoa;
19192020 buildPhase = ''
2121 export EXTRA_CMAKE_ARGS=-DPATH_TO_LLVM_ROOT=${llvmPackages.clang-unwrapped}
2222 ${python.interpreter} build.py --clang-completer --system-boost
2323 '';
24242525+ patches = [ ./2-ycm-cmake.patch ];
2626+2527 configurePhase = ":";
26282929+ # remove the tests
3030+ #
3131+ # make __main__.py executable and add shebang
3232+ #
3333+ # copy over third-party libs
3434+ # note: if we switch to using our packaged libs, we'll need to symlink them
3535+ # into the same spots, as YouCompleteMe (the vim plugin) expects those paths
3636+ # to be available
3737+ #
3838+ # symlink completion backends where ycmd expects them
2739 installPhase = ''
2828- mkdir -p $out/lib/ycmd/third_party $out/bin
2929- cp -r ycmd/ CORE_VERSION libclang.so.* ycm_client_support.so ycm_core.so $out/lib/ycmd/
4040+ rm -rf ycmd/tests
4141+4242+ chmod +x ycmd/__main__.py
4343+ sed -i "1i #!${python.interpreter}\
4444+ " ycmd/__main__.py
4545+4646+ mkdir -p $out/lib/ycmd
4747+ cp -r ycmd/ CORE_VERSION libclang.so.* ycm_core.so $out/lib/ycmd/
4848+4949+ mkdir -p $out/bin
3050 ln -s $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd
5151+5252+ mkdir -p $out/lib/ycmd/third_party/{gocode,godef,racerd/target/release}
5353+5454+ cp -r third_party/JediHTTP $out/lib/ycmd/third_party
5555+ for p in waitress frozendict bottle python-future argparse requests; do
5656+ cp -r third_party/$p $out/lib/ycmd/third_party
5757+ done
5858+5959+ '' + lib.optionalString (gocode != null) ''
6060+ ln -s ${gocode}/bin/gocode $out/lib/ycmd/third_party/gocode
6161+ '' + lib.optionalString (godef != null) ''
6262+ ln -s ${godef}/bin/godef $out/lib/ycmd/third_party/godef
6363+ '' + lib.optionalString (rustracerd != null) ''
6464+ ln -s ${rustracerd}/bin/racerd $out/lib/ycmd/third_party/racerd/target/release
6565+ '';
6666+6767+ # fixup the argv[0] and replace __file__ with the corresponding path so
6868+ # python won't be thrown off by argv[0]
6969+ postFixup = ''
7070+ substituteInPlace $out/lib/ycmd/ycmd/__main__.py \
7171+ --replace $out/lib/ycmd/ycmd/__main__.py \
7272+ $out/bin/ycmd \
7373+ --replace __file__ \
7474+ "'$out/lib/ycmd/ycmd/__main__.py'"
3175 '';
32763377 meta = with stdenv.lib; {
3478 description = "A code-completion and comprehension server";
3579 homepage = https://github.com/Valloric/ycmd;
3680 license = licenses.gpl3;
3737- maintainers = with maintainers; [ rasendubi ];
8181+ maintainers = with maintainers; [ rasendubi cstrahan ];
3882 platforms = platforms.all;
3983 };
4084}