# Maintainer: James Brink # Contributor: Wilson E. Alvarez # Contributor: p # Contributor: Victor # Contributor: Jan-Tarek Butt # Contributor: Erik Beran # Contributor: Thor K. H. # Contributor: Babken Vardanyan <483ken 4tgma1l # Contributor: mikezackles # Contributor: z33ky # Contributor: stykr # Contributor: Svenstaro # Contributor: KaiSforza # Contributor: Simon Gomizelj # Contributor: Daniel Micay # Contributor: shmilee # Contributor: foobster # Contributor: archdria # Contributor: Andy Weidenbaum # Contributor: edacval # Contributor: MarcelPa # Contributor: Trent # Contributor: urxvtcd-256 #=========================================================================================================# # Build Options # #=========================================================================================================# _omnisharp="y" _gocode="y" _rust="n" _tern="y" _typescript="y" _java="y" _use_system_clang="ON" _use_python2="OFF" _neovim="$NEOVIM_YOUCOMPLETEME" #=========================================================================================================# # Default PKGBUILD Configuration # #=========================================================================================================# pkgname=vim-youcompleteme-git pkgver=r2535.04c35051 pkgver() { cd "YouCompleteMe" || exit printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } pkgrel=3 pkgdesc="A code-completion engine for Vim" arch=('x86_64') url='https://ycm-core.github.io/YouCompleteMe/' license=('GPL3') groups=('vim-plugins') depends=('boost' 'boost-libs' 'python' 'python2' 'nodejs' 'vim' 'clang') makedepends=('cmake' 'git' 'make' 'curl') install="install.sh" source=( 'git+https://github.com/bottlepy/bottle.git' 'git+https://github.com/certifi/python-certifi.git' 'git+https://github.com/chardet/chardet.git' 'git+https://github.com/davidhalter/jedi.git' 'git+https://github.com/davidhalter/parso.git' 'git+https://github.com/kjd/idna.git' 'git+https://github.com/micbou/regex.git' 'git+https://github.com/Pylons/waitress.git' 'git+https://github.com/PythonCharmers/python-future.git' 'git+https://github.com/requests/requests.git' 'git+https://github.com/ross/requests-futures.git' 'git+https://github.com/slezica/python-frozendict.git' 'git+https://github.com/urllib3/urllib3.git' 'git+https://github.com/ycm-core/ycmd.git' 'git+https://github.com/ycm-core/YouCompleteMe.git' 'rls.patch') sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'cde1d1265be82e246edb6021e0a4b4e01af1a140b8d92b05bde6929e922ae215') #=========================================================================================================# # Applying PKBUILD Build Options # #=========================================================================================================# if [[ "$_gocode" == "y" ]]; then # ycmd source+=('git+https://github.com/mdempsky/gocode.git' 'git+https://github.com/rogpeppe/godef.git') sha256sums+=('SKIP' 'SKIP') makedepends+=('go') fi # TODO use the existing omnisharp AUR package if possible if [[ "$_omnisharp" == "y" ]]; then source+=('https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.33.0/omnisharp.http-linux-x64.tar.gz') sha256sums+=('74cecc6265969d312b8124cb88152cdd9874f1027957d88ec0268d9c3e6cd3f1') depends+=('mono' 'libuv') makedepends+=('mono' 'libuv') fi if [[ "$_rust" == "y" ]]; then depends+=('rustup') makedepends+=('rustup') fi if [[ "$_tern" == "y" ]]; then # ycmd makedepends+=('npm') fi #=========================================================================================================# # Utility Functions # #=========================================================================================================# gitprepare() { local cd_dir=$1 local git_prefix=$2 local c=0 for val in "$@"; do if [ $c -gt 1 ]; then local feed[$c]=$val fi c=$((c + 1)) done cd "$srcdir/$cd_dir" || exit git submodule init for gitsubvar in "${feed[@]}"; do git config submodule."$git_prefix$gitsubvar".url "$srcdir/$gitsubvar" done git submodule update unset -v feed } #=========================================================================================================# # Standard PKGBUILD Functions # #=========================================================================================================# prepare() { # Add the java completion engine dynamically... if [[ "$_java" == "y" ]]; then echo 'Parsing out the JDTLS package version from upstream...' local jdtls_package_name="jdt-language-server" local jdtls_milestone=$(egrep '^JDTLS_MILESTONE' "$srcdir/ycmd/build.py" | sed -e "s/.* = //g" -e "s/'//g") local jdtls_buildstamp=$(egrep '^JDTLS_BUILD_STAMP' "$srcdir/ycmd/build.py" | sed -e "s/.* = //g" -e "s/'//g") if [[ "$jdtls_milestone" != "" ]] && [[ "$jdtls_buildstamp" != "" ]]; then echo 'JDTLS package version matched. Downloading...' curl -LO http://download.eclipse.org/jdtls/milestones/${jdtls_milestone}/${jdtls_package_name}-${jdtls_milestone}-${jdtls_buildstamp}.tar.gz tar xf ${jdtls_package_name}-${jdtls_milestone}-${jdtls_buildstamp}.tar.gz else echo 'Mismatched JDTLS version' exit 1 fi fi echo 'Setting up Git submodules...' local YouCompleteMe=("requests-futures" "ycmd" "python-future") local YouCompleteMeRequestsDeps=("idna" "python-certifi" "chardet" "urllib3" "requests") gitprepare "YouCompleteMe" "third_party/" "${YouCompleteMe[@]}" gitprepare "YouCompleteMe" "third_party/requests_deps/" "${YouCompleteMeRequestsDeps[@]}" local ycmd=("bottle" "regex" "python-frozendict" "python-future" "waitress") gitprepare "YouCompleteMe/third_party/ycmd" "third_party/" "${ycmd[@]}" local ycmdJediDeps=("jedi" "parso") gitprepare "YouCompleteMe/third_party/ycmd" "third_party/jedi_deps" "${ycmdJediDeps[@]}" local ycmdRequestsDeps=("python-certifi" "chardet" "idna" "requests" "urllib3") gitprepare "YouCompleteMe/third_party/ycmd" "third_party/requests_deps" "${ycmdRequestsDeps[@]}" if [[ "$_gocode" == "y" ]]; then ycmd+=("go-completer") fi if [[ "$_omnisharp" == "y" ]]; then cd "$srcdir" || exit cp -r omnisharp YouCompleteMe/third_party/ycmd/third_party/omnisharp-roslyn fi # Apply our patch to use existing rustup toolchains if [[ "$_rust" == "y" ]]; then cd "$srcdir" || exit cp rls.patch "$srcdir/YouCompleteMe/third_party/ycmd/" cd "$srcdir/YouCompleteMe/third_party/ycmd/" || exit patch -p1