lol

Merge pull request #22490 from cstrahan/ycmd

ycmd: 2016-01-12 -> 2017-02-03

authored by

Charles Strahan and committed by
GitHub
4ca258e9 fc54ece4

+102 -15
+40
pkgs/development/tools/misc/ycmd/2-ycm-cmake.patch
··· 1 + diff --git a/cpp/ycm/CMakeLists.txt b/cpp/ycm/CMakeLists.txt 2 + index 2074c58e..9ecd6e57 100644 3 + --- a/cpp/ycm/CMakeLists.txt 4 + +++ b/cpp/ycm/CMakeLists.txt 5 + @@ -366,35 +366,6 @@ if( LIBCLANG_TARGET ) 6 + POST_BUILD 7 + COMMAND ${CMAKE_COMMAND} -E copy "${LIBCLANG_TARGET}" "$<TARGET_FILE_DIR:${PROJECT_NAME}>" 8 + ) 9 + - 10 + - if( APPLE ) 11 + - # In OS X El Capitan, Apple introduced System Integrity Protection. 12 + - # Amongst other things, this introduces features to the dynamic loader 13 + - # (dyld) which cause it to "sanitise" (and complain about) embedded 14 + - # LC_RPATH entries which contain @executable_path when then are loaded 15 + - # into "restricted" binaries. For our purposes, "restricted" here means 16 + - # "supplied by Apple" and includes the system versions of python. For 17 + - # unknown reasons, the libclang.dylib that comes from llvm.org includes an 18 + - # LC_RPATH entry '@executable_path/../lib' which causes the OS X dynamic 19 + - # loader to print a cryptic warning to stderr of the form: 20 + - # 21 + - # dyld: warning, LC_RPATH @executable_path/../lib in 22 + - # /path/to/ycmd/libclang.dylib being ignored in restricted program 23 + - # because of @executable_path 24 + - # 25 + - # In order to prevent this harmless and annoying message appearing, we 26 + - # simply strip the rpath entry from the dylib. There's no way any 27 + - # @executable_path that python might have could be in any way useful to 28 + - # libclang.dylib, so this seems perfectly safe. 29 + - get_filename_component( LIBCLANG_TAIL ${LIBCLANG_TARGET} NAME ) 30 + - add_custom_command( TARGET ${PROJECT_NAME} 31 + - POST_BUILD 32 + - COMMAND install_name_tool 33 + - "-delete_rpath" 34 + - "@executable_path/../lib" 35 + - "$<TARGET_FILE_DIR:${PROJECT_NAME}>/${LIBCLANG_TAIL}" 36 + - ) 37 + - endif() 38 + endif() 39 + endif() 40 +
+58 -14
pkgs/development/tools/misc/ycmd/default.nix
··· 1 - { stdenv, fetchgit, cmake, llvmPackages, boost, python2Packages 1 + { stdenv, lib, fetchgit, cmake, llvmPackages, boost, python 2 + , gocode ? null 3 + , godef ? null 4 + , rustracerd ? null 5 + , Cocoa ? null 2 6 }: 3 7 4 - let 5 - inherit (python2Packages) python mkPythonDerivation waitress frozendict bottle; 6 - in mkPythonDerivation rec { 7 - name = "ycmd-2016-01-12"; 8 - namePrefix = ""; 8 + stdenv.mkDerivation rec { 9 + name = "ycmd-${version}"; 10 + version = "2017-02-03"; 9 11 10 12 src = fetchgit { 11 13 url = "git://github.com/Valloric/ycmd.git"; 12 - rev = "f982f6251c5ff85e3abe6e862aad8bcd19e85ece"; 13 - sha256 = "1g0hivv3wla7z5dgnkcn3ny38p089pjfj36nx6k29zmprgmjinyr"; 14 + rev = "ec7a154f8fe50c071ecd0ac6841de8a50ce92f5d"; 15 + sha256 = "0rzxgqqqmmrv9r4k2ji074iprhw6sb0jkvh84wvi45yfyphsh0xi"; 14 16 }; 15 17 16 - buildInputs = [ cmake boost ]; 17 - 18 - propagatedBuildInputs = [ waitress frozendict bottle ]; 18 + buildInputs = [ cmake boost ] ++ stdenv.lib.optional stdenv.isDarwin Cocoa; 19 19 20 20 buildPhase = '' 21 21 export EXTRA_CMAKE_ARGS=-DPATH_TO_LLVM_ROOT=${llvmPackages.clang-unwrapped} 22 22 ${python.interpreter} build.py --clang-completer --system-boost 23 23 ''; 24 24 25 + patches = [ ./2-ycm-cmake.patch ]; 26 + 25 27 configurePhase = ":"; 26 28 29 + # remove the tests 30 + # 31 + # make __main__.py executable and add shebang 32 + # 33 + # copy over third-party libs 34 + # note: if we switch to using our packaged libs, we'll need to symlink them 35 + # into the same spots, as YouCompleteMe (the vim plugin) expects those paths 36 + # to be available 37 + # 38 + # symlink completion backends where ycmd expects them 27 39 installPhase = '' 28 - mkdir -p $out/lib/ycmd/third_party $out/bin 29 - cp -r ycmd/ CORE_VERSION libclang.so.* ycm_client_support.so ycm_core.so $out/lib/ycmd/ 40 + rm -rf ycmd/tests 41 + 42 + chmod +x ycmd/__main__.py 43 + sed -i "1i #!${python.interpreter}\ 44 + " ycmd/__main__.py 45 + 46 + mkdir -p $out/lib/ycmd 47 + cp -r ycmd/ CORE_VERSION libclang.so.* ycm_core.so $out/lib/ycmd/ 48 + 49 + mkdir -p $out/bin 30 50 ln -s $out/lib/ycmd/ycmd/__main__.py $out/bin/ycmd 51 + 52 + mkdir -p $out/lib/ycmd/third_party/{gocode,godef,racerd/target/release} 53 + 54 + cp -r third_party/JediHTTP $out/lib/ycmd/third_party 55 + for p in waitress frozendict bottle python-future argparse requests; do 56 + cp -r third_party/$p $out/lib/ycmd/third_party 57 + done 58 + 59 + '' + lib.optionalString (gocode != null) '' 60 + ln -s ${gocode}/bin/gocode $out/lib/ycmd/third_party/gocode 61 + '' + lib.optionalString (godef != null) '' 62 + ln -s ${godef}/bin/godef $out/lib/ycmd/third_party/godef 63 + '' + lib.optionalString (rustracerd != null) '' 64 + ln -s ${rustracerd}/bin/racerd $out/lib/ycmd/third_party/racerd/target/release 65 + ''; 66 + 67 + # fixup the argv[0] and replace __file__ with the corresponding path so 68 + # python won't be thrown off by argv[0] 69 + postFixup = '' 70 + substituteInPlace $out/lib/ycmd/ycmd/__main__.py \ 71 + --replace $out/lib/ycmd/ycmd/__main__.py \ 72 + $out/bin/ycmd \ 73 + --replace __file__ \ 74 + "'$out/lib/ycmd/ycmd/__main__.py'" 31 75 ''; 32 76 33 77 meta = with stdenv.lib; { 34 78 description = "A code-completion and comprehension server"; 35 79 homepage = https://github.com/Valloric/ycmd; 36 80 license = licenses.gpl3; 37 - maintainers = with maintainers; [ rasendubi ]; 81 + maintainers = with maintainers; [ rasendubi cstrahan ]; 38 82 platforms = platforms.all; 39 83 }; 40 84 }
+4 -1
pkgs/top-level/all-packages.nix
··· 6803 6803 6804 6804 yacc = bison; 6805 6805 6806 - ycmd = callPackage ../development/tools/misc/ycmd { }; 6806 + ycmd = callPackage ../development/tools/misc/ycmd { 6807 + inherit (darwin.apple_sdk.frameworks) Cocoa; 6808 + python = python2; 6809 + }; 6807 6810 6808 6811 yodl = callPackage ../development/tools/misc/yodl { }; 6809 6812