diff options
author | Yen Chi Hsuan | 2017-01-08 14:52:42 +0800 |
---|---|---|
committer | Yen Chi Hsuan | 2017-01-08 14:52:42 +0800 |
commit | c113ee1df80ab60bb36c4ace37da67dc9105982c (patch) | |
tree | 76ef434243a96931da1a49ae8b185dbc81836d6b | |
download | aur-c113ee1df80ab60bb36c4ace37da67dc9105982c.tar.gz |
Rename package
-rw-r--r-- | .SRCINFO | 38 | ||||
-rw-r--r-- | PKGBUILD | 92 | ||||
-rw-r--r-- | system_completers.patch | 136 |
3 files changed, 266 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..f7fc4ecd6cb3 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,38 @@ +# Generated by mksrcinfo v8 +# Sun Jan 8 06:51:55 UTC 2017 +pkgbase = neovim-youcompleteme-core-git + pkgdesc = A code-completion engine for Vim + pkgver = r1976.3fde57b0 + pkgrel = 1 + url = http://valloric.github.com/YouCompleteMe/ + arch = i686 + arch = x86_64 + license = GPL3 + makedepends = git + makedepends = cmake + makedepends = boost + depends = neovim + depends = boost-libs + depends = python>=3.2 + depends = python-bottle + depends = python-waitress + depends = python-frozendict + depends = python-requests-futures + depends = python-future + depends = python-neovim + depends = clang + optdepends = gocode-git: Go semantic completion + optdepends = godef-git: Go semantic completion + optdepends = nodejs-tern: JavaScript semantic completion + optdepends = racerd-git: Rust semantic completion + optdepends = typescript: Typescript semantic completion + optdepends = python-jedihttp-git: Python semantic completion + source = git+https://github.com/Valloric/YouCompleteMe.git + source = git+https://github.com/Valloric/ycmd + source = system_completers.patch + sha256sums = SKIP + sha256sums = SKIP + sha256sums = 6533f957fae4de2aa2d4be1903686328170ecd44c59487a7478aabc8544a966f + +pkgname = neovim-youcompleteme-core-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..062c7d8ed86d --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,92 @@ +# Maintainer: Alexander 'z33ky' Hirsch <1zeeky@gmail.com> +# Contributor: Yen Chi Hsuan <yan12125@gmail.com> +# The following contributors are from the vim-youcompleteme-git AUR package +# Contributor: Babken Vardanyan <483ken 4tgma1l +# Contributor: stykr +# Contributor: Svenstaro +# Contributor: KaiSforza +# Contributor: Simon Gomizelj <simongmzlj@gmail.com> +# Contributor: Daniel Micay <danielmicay@gmail.com> + +# clang completion is builtin and cannot be provided separately (?) +_clang_completer=y + +pkgname=neovim-youcompleteme-core-git +pkgver=r1976.3fde57b0 +pkgrel=1 +pkgdesc='A code-completion engine for Vim' +arch=(i686 x86_64) +url='http://valloric.github.com/YouCompleteMe/' +license=('GPL3') +depends=('neovim' 'boost-libs' 'python>=3.2' 'python-bottle' 'python-waitress' 'python-frozendict' 'python-requests-futures' 'python-future' 'python-neovim') +makedepends=('git' 'cmake' 'boost') +optdepends=( + 'gocode-git: Go semantic completion' + 'godef-git: Go semantic completion' + 'nodejs-tern: JavaScript semantic completion' + 'racerd-git: Rust semantic completion' + 'typescript: Typescript semantic completion' + 'python-jedihttp-git: Python semantic completion') +# missing completers: +# OmniSharp-Roslyn - ??? + +source=('git+https://github.com/Valloric/YouCompleteMe.git' + 'git+https://github.com/Valloric/ycmd' + # this uses a downstream patch + # using system completers is not supported by upstream + # see https://github.com/Valloric/ycmd/pull/535 + 'system_completers.patch') +sha256sums=('SKIP' + 'SKIP' + '6533f957fae4de2aa2d4be1903686328170ecd44c59487a7478aabc8544a966f') + +pkgver() { + cd "${srcdir}/YouCompleteMe" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +if [ "${_clang_completer}" == 'y' ]; then + depends+=('clang') +fi + +prepare() { + cd "${srcdir}/YouCompleteMe" + git reset --hard + git -C 'third_party/ycmd' reset --hard + git config submodule.third_party/ycmd.url "${srcdir}/ycmd" + git submodule update --init 'third_party/ycmd' + cd 'third_party/ycmd' + + patch -p1 -i "${srcdir}/system_completers.patch" +} + +build() { + mkdir -p "${srcdir}/ycmd_build" + cd "${srcdir}/ycmd_build" + + cmake_flags="-DUSE_PYTHON2=OFF -DUSE_SYSTEM_BOOST=ON" + + if [ "${_clang_completer}" == 'y' ]; then + cmake_flags+=" -DUSE_CLANG_COMPLETER=ON -DEXTERNAL_LIBCLANG_PATH='/usr/lib/libclang.so'" + fi + + cmake ${cmake_flags} . "$srcdir/YouCompleteMe/third_party/ycmd/cpp" + make ycm_core +} + +package() { + pkg_ycmd_dir="${pkgdir}/usr/share/nvim/runtime/third_party/ycmd" + src_ycmd_dir="${srcdir}/YouCompleteMe/third_party/ycmd" + mkdir -p "${pkg_ycmd_dir}" + + cp -r "${srcdir}/YouCompleteMe/"{autoload,doc,plugin,python} "${pkgdir}/usr/share/nvim/runtime" + cp -r "${srcdir}/YouCompleteMe/third_party/retries" "${pkgdir}/usr/share/nvim/runtime/third_party" + cp -r "${src_ycmd_dir}/"{ycmd,ycm_core.so,CORE_VERSION} "${pkg_ycmd_dir}" + if [ "${_clang_completer}" == 'y' ]; then + clang_version="$(clang --version|sed -n 's/clang version \([0-9.]\+\) .*/\1/p')" + ln -s "/usr/lib/clang/${clang_version}/include/" "${pkg_ycmd_dir}/clang_includes" + unset clang_version + fi + + find "${pkgdir}" \( -name .git -or -name 'test*' -or -name 'run_tests.py' -or -name 'CMakeFiles' \) -exec rm -fr {} + +} diff --git a/system_completers.patch b/system_completers.patch new file mode 100644 index 000000000000..bc75af1ce165 --- /dev/null +++ b/system_completers.patch @@ -0,0 +1,136 @@ +commit 7b6f5c6d2f4010d9ca103fb09559221d488cbdb9 +Author: Alexander 'z33ky' Hirsch <1zeeky@gmail.com> +Date: Wed Jun 29 16:18:34 2016 +0200 + + Search for completers binaries in system path + + The Rust and Typescript completers are already searching the system path + if a binary is not installed alongside YCM. + This commit adds the same behavior to the C#, Go and Javascript + completers. + +diff --git a/ycmd/completers/cs/cs_completer.py b/ycmd/completers/cs/cs_completer.py +index ba85ea4..03d03f0 100755 +--- a/ycmd/completers/cs/cs_completer.py ++++ b/ycmd/completers/cs/cs_completer.py +@@ -51,6 +51,18 @@ PATH_TO_OMNISHARP_BINARY = os.path.join( + 'OmniSharp', 'bin', 'Release', 'OmniSharp.exe' ) + + ++def FindOmniSharpBinary(): ++ """Find the path to the OmniSharp binary. ++ ++ If a version is installed with YCM, use that. ++ Otherwise try to find one installed in the system. ++ If that fails, return None.""" ++ ++ if os.path.exists( PATH_TO_OMNISHARP_BINARY ): ++ return PATH_TO_OMNISHARP_BINARY ++ ++ return utils.PathToFirstExistingExecutable( [ 'OmniSharp', 'OmniSharp.exe' ] ) ++ + class CsharpCompleter( Completer ): + """ + A Completer that uses the Omnisharp server as completion engine. +@@ -66,7 +78,7 @@ class CsharpCompleter( Completer ): + 'max_diagnostics_to_display' ] + self._solution_state_lock = threading.Lock() + +- if not os.path.isfile( PATH_TO_OMNISHARP_BINARY ): ++ if not FindOmniSharpBinary(): + raise RuntimeError( + SERVER_NOT_FOUND_MSG.format( PATH_TO_OMNISHARP_BINARY ) ) + +@@ -348,7 +360,7 @@ class CsharpSolutionCompleter( object ): + + self._ChooseOmnisharpPort() + +- command = [ PATH_TO_OMNISHARP_BINARY, ++ command = [ FindOmniSharpBinary(), + '-p', + str( self._omnisharp_port ), + '-s', +diff --git a/ycmd/completers/go/go_completer.py b/ycmd/completers/go/go_completer.py +index 6a7c4b5..1d50a7b 100755 +--- a/ycmd/completers/go/go_completer.py ++++ b/ycmd/completers/go/go_completer.py +@@ -70,7 +70,8 @@ def FindBinary( binary, user_options ): + + If 'gocode_binary_path' or 'godef_binary_path' + in the options is blank, use the version installed +- with YCM, if it exists. ++ with YCM, if it exists. Otherwise try to find one ++ installed on the system. + + If the 'gocode_binary_path' or 'godef_binary_path' is + specified, use it as an absolute path. +@@ -87,7 +88,7 @@ def FindBinary( binary, user_options ): + binary_path = _FindPath() + if os.path.isfile( binary_path ): + return binary_path +- return None ++ return utils.PathToFirstExistingExecutable( [ binary ] ) + + + def ShouldEnableGoCompleter( user_options ): +diff --git a/ycmd/completers/javascript/tern_completer.py b/ycmd/completers/javascript/tern_completer.py +index b7a2d26..40e9877 100644 +--- a/ycmd/completers/javascript/tern_completer.py ++++ b/ycmd/completers/javascript/tern_completer.py +@@ -59,6 +59,18 @@ PATH_TO_NODE = utils.PathToFirstExistingExecutable( [ 'node' ] ) + SERVER_HOST = '127.0.0.1' + + ++def FindTernBinary(): ++ """Find the path to the tern binary. ++ ++ If a version is installed with YCM, use that. ++ Otherwise try to find one installed in the system. ++ If that fails, return None.""" ++ ++ if os.path.exists( PATH_TO_TERN_BINARY ): ++ return PATH_TO_TERN_BINARY ++ ++ return utils.PathToFirstExistingExecutable( [ 'tern' ] ) ++ + def ShouldEnableTernCompleter(): + """Returns whether or not the tern completer is 'installed'. That is whether + or not the tern submodule has a 'node_modules' directory. This is pretty much +@@ -71,9 +83,7 @@ def ShouldEnableTernCompleter(): + + _logger.info( 'Using node binary from: ' + PATH_TO_NODE ) + +- installed = os.path.exists( PATH_TO_TERN_BINARY ) +- +- if not installed: ++ if not FindTernBinary(): + _logger.info( 'Not using Tern completer: not installed at ' + + PATH_TO_TERN_BINARY ) + return False +@@ -376,7 +386,7 @@ class TernCompleter( Completer ): + extra_args = [] + + command = [ PATH_TO_NODE, +- PATH_TO_TERN_BINARY, ++ FindTernBinary(), + '--port', + str( self._server_port ), + '--host', +diff --git a/ycmd/completers/python/jedi_completer.py b/ycmd/completers/python/jedi_completer.py +index 50b1916..4514490 100644 +--- a/ycmd/completers/python/jedi_completer.py ++++ b/ycmd/completers/python/jedi_completer.py +@@ -155,8 +156,12 @@ class JediCompleter( Completer ): + json.dump( { 'hmac_secret': ToUnicode( + b64encode( self._hmac_secret ) ) }, + hmac_file ) ++ if os.path.exists(PATH_TO_JEDIHTTP): ++ jedihttp_path = PATH_TO_JEDIHTTP ++ else: ++ jedihttp_path = utils.PathToFirstExistingExecutable( [ 'jedihttp-main.py' ] ) + command = [ self._python_binary_path, +- PATH_TO_JEDIHTTP, ++ jedihttp_path, + '--port', str( self._jedihttp_port ), + '--log', self._GetLoggingLevel(), + '--hmac-file-secret', hmac_file.name ] |