# Maintainer: Chih-Hsuan Yen # Contributor: Alexander 'z33ky' Hirsch <1zeeky@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 # Contributor: Daniel Micay pkgname=neovim-youcompleteme-core-git pkgver=r2532.d556a43c pkgrel=2 pkgdesc='A code-completion engine for Vim' arch=(i686 x86_64) url='https://valloric.github.io/YouCompleteMe/' license=('GPL3') depends=('neovim' 'boost-libs' 'python>=3.2' 'clang>=6.0' 'python-bottle' 'python-waitress' 'python-frozendict' 'python-requests-futures' 'python-future' 'python-neovim') makedepends=('git' 'cmake' 'boost' 'pybind11') 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-jedi: Python semantic completion' 'python-regex: improved error handling during startup') # https://github.com/ycm-core/ycmd/pull/885 #'omnisharp-roslyn: C# semantic completion' source=(git+https://github.com/ycm-core/YouCompleteMe.git git+https://github.com/ycm-core/ycmd.git clang_rsrc_dir.patch) sha256sums=('SKIP' 'SKIP' 'b1cb4e247e23954ddc02b11b8f9e61b822f544425b51f12f4ac569ce1c8de405') pkgver() { cd YouCompleteMe printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } prepare() { mkdir -p ycmd_build cd YouCompleteMe git submodule init third_party/ycmd git config submodule.third_party/ycmd.url "$srcdir/ycmd" git submodule update cd third_party/ycmd patch -Np1 -i ../../../clang_rsrc_dir.patch # Force system headers/libs cd cpp rm -rf BoostParts llvm pybind11 } build() { cd ycmd_build cmake \ -DUSE_PYTHON2=OFF \ -DUSE_SYSTEM_BOOST=ON \ -DUSE_CLANG_COMPLETER=ON \ -DUSE_SYSTEM_LIBCLANG=ON \ ../YouCompleteMe/third_party/ycmd/cpp make ycm_core } package() { pkg_ycmd_dir="$pkgdir/usr/share/nvim/runtime/third_party/ycmd" cd YouCompleteMe install -Ddm755 "$pkg_ycmd_dir" cp -dr --no-preserve=ownership autoload doc plugin python "$pkgdir/usr/share/nvim/runtime" cp -dr --no-preserve=ownership third_party/ycmd/{ycmd,ycm_core.so,CORE_VERSION} "$pkg_ycmd_dir" install -Ddm755 "$pkg_ycmd_dir/third_party/clang/lib/" ln -s /usr/lib/libclang.so "$pkg_ycmd_dir/third_party/clang/lib/libclang.so" ln -s /usr/lib/clang "$pkg_ycmd_dir/third_party/clang/lib/clang" install -Ddm755 "$pkg_ycmd_dir/third_party/clangd/output/bin" ln -s /usr/bin/clangd "$pkg_ycmd_dir/third_party/clangd/output/bin/clangd" install -Ddm755 "$pkg_ycmd_dir/third_party/tern_runtime/node_modules/" install -Ddm755 "$pkg_ycmd_dir/third_party/gocode/" install -Ddm755 "$pkg_ycmd_dir/third_party/godef/" ln -s /usr/lib/node_modules/tern "$pkg_ycmd_dir/third_party/tern_runtime/node_modules/" ln -s /usr/bin/gocode "$pkg_ycmd_dir/third_party/gocode/" ln -s /usr/bin/godef "$pkg_ycmd_dir/third_party/godef/" find "$pkgdir" \( -name .git -or -name 'test*' -or -name 'run_tests.py' \) -exec rm -fr {} + python -m compileall -d /usr/share/nvim/runtime "$pkgdir/usr/share/nvim/runtime" python -O -m compileall -d /usr/share/nvim/runtime "$pkgdir/usr/share/nvim/runtime" }