2018-01-01 02:20:54 -08:00
|
|
|
# Maintainer: Trent Palmer trenttdually at gmail
|
|
|
|
# Contributor: Victor <victor@xirion.net>
|
|
|
|
# Contributor: Jan-Tarek Butt <tarek AT ring0 DOT de>
|
|
|
|
# Contributor: Erik Beran <eberan AT gmail DOT com>
|
|
|
|
# Contributor: Thor K. H. <thor at roht dot no>
|
|
|
|
# Contributor: Babken Vardanyan <483ken 4tgma1l
|
|
|
|
# Contributor: mikezackles
|
|
|
|
# Contributor: z33ky
|
|
|
|
# Contributor: stykr
|
|
|
|
# Contributor: Svenstaro
|
|
|
|
# Contributor: KaiSforza
|
|
|
|
# Contributor: Simon Gomizelj <simongmzlj@gmail.com>
|
|
|
|
# Contributor: Daniel Micay <danielmicay@gmail.com>
|
|
|
|
# Contributor: shmilee
|
|
|
|
# Contributor: foobster
|
|
|
|
# Contributor: archdria
|
|
|
|
# Contributor: Andy Weidenbaum <archbaum@gmail.com>
|
|
|
|
|
|
|
|
###########################################################################################################
|
|
|
|
# Build Options
|
|
|
|
###########################################################################################################
|
|
|
|
# change all build options to no by default
|
2018-02-25 11:51:18 -08:00
|
|
|
_omnisharp="n"
|
2018-01-01 02:20:54 -08:00
|
|
|
|
2018-02-25 11:51:18 -08:00
|
|
|
_gocode="n"
|
2018-01-01 02:20:54 -08:00
|
|
|
|
2018-02-25 11:51:18 -08:00
|
|
|
_rust="n"
|
2018-01-01 02:20:54 -08:00
|
|
|
|
2018-02-25 11:51:18 -08:00
|
|
|
_tern="n"
|
2018-01-01 02:20:54 -08:00
|
|
|
|
|
|
|
_completer="ON"
|
|
|
|
|
|
|
|
###########################################################################################################
|
|
|
|
|
|
|
|
pkgname=vim-youcompleteme-git
|
2018-07-06 13:52:02 -07:00
|
|
|
pkgver=2361.e1ead995
|
2018-01-01 02:20:54 -08:00
|
|
|
pkgver() {
|
|
|
|
cd "YouCompleteMe" || exit
|
|
|
|
echo "$(git rev-list --count master).$(git rev-parse --short master)"
|
|
|
|
}
|
|
|
|
pkgrel=1
|
|
|
|
pkgdesc="A code-completion engine for Vim"
|
|
|
|
|
|
|
|
arch=('i686' 'x86_64' 'armv7h')
|
2018-02-25 11:51:18 -08:00
|
|
|
url='https://valloric.github.com/YouCompleteMe/'
|
2018-01-01 02:20:54 -08:00
|
|
|
license=('GPL3')
|
|
|
|
groups=('vim-plugins')
|
2018-01-02 01:09:32 -08:00
|
|
|
provides=('vim-youcompleteme')
|
|
|
|
conflicts=('')
|
2018-01-01 02:20:54 -08:00
|
|
|
|
|
|
|
depends=('boost' 'boost-libs' 'ncurses5-compat-libs' 'python' 'python2' 'vim' 'clang')
|
|
|
|
[[ "$_omnisharp" = "y" ]] && depends+=('mono')
|
|
|
|
[[ "$_rust" = "y" ]] && depends+=('rust')
|
|
|
|
[[ "$_tern" = "y" ]] && depends+=('nodejs')
|
|
|
|
|
|
|
|
makedepends=('cmake' 'git' 'make')
|
|
|
|
[[ "$_omnisharp" = "y" ]] && makedepends+=('mono')
|
|
|
|
[[ "$_rust" = "y" ]] && makedepends+=('cargo')
|
|
|
|
[[ "$_tern" = "y" ]] && makedepends+=('npm')
|
|
|
|
[[ "$_gocode" = "y" ]] && makedepends+=('go')
|
|
|
|
|
2018-02-25 11:51:18 -08:00
|
|
|
# source=('git+https://github.com/Valloric/YouCompleteMe.git#commit=1080a310274b546a6e7a6ae87aa6c7ea2fa646e7' #ycm
|
2018-01-01 02:20:54 -08:00
|
|
|
source=('git+https://github.com/Valloric/YouCompleteMe.git' #ycm
|
|
|
|
'git+https://github.com/ross/requests-futures.git' #ycm
|
|
|
|
'git+https://github.com/Valloric/ycmd.git' #ycm
|
|
|
|
'git+https://github.com/kennethreitz/requests.git' #ycmd
|
|
|
|
'git+https://github.com/bottlepy/bottle.git' #ycmd
|
|
|
|
'git+https://github.com/slezica/python-frozendict.git' #ycmd
|
|
|
|
'git+https://github.com/PythonCharmers/python-future.git' #ycmd
|
|
|
|
'git+https://github.com/vheon/JediHTTP.git' #ycmd
|
|
|
|
'git+https://github.com/davidhalter/jedi.git' #jediHTTP
|
|
|
|
'git+https://github.com/Pylons/waitress.git' #ycmd,jediHTTP
|
|
|
|
)
|
|
|
|
|
|
|
|
[[ "$_omnisharp" = "y" ]] && source+=('git+https://github.com/icsharpcode/NRefactory.git' #OmniSharpServer
|
|
|
|
'git+https://github.com/jbevain/cecil.git' #OmniSharpServer
|
|
|
|
'git+https://github.com/nosami/OmniSharpServer.git' #ycmd
|
|
|
|
)
|
|
|
|
[[ "$_rust" = "y" ]] && source+=('git+https://github.com/jwilm/racerd.git' #ycmd
|
|
|
|
)
|
|
|
|
[[ "$_gocode" = "y" ]] && source+=('git+https://github.com/nsf/gocode.git' #ycmd
|
|
|
|
'git+https://github.com/Manishearth/godef.git' #ycmd
|
|
|
|
)
|
2018-02-18 13:34:48 -08:00
|
|
|
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')
|
2018-01-01 02:20:54 -08:00
|
|
|
|
|
|
|
[[ "$_omnisharp" = "y" ]] && sha256sums+=('SKIP' 'SKIP' 'SKIP')
|
|
|
|
[[ "$_rust" = "y" ]] && sha256sums+=('SKIP')
|
|
|
|
[[ "$_gocode" = "y" ]] && sha256sums+=('SKIP' 'SKIP')
|
|
|
|
|
|
|
|
install=install
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
msg2 'Setting up Git submodules...'
|
|
|
|
|
|
|
|
YouCompleteMe=("requests-futures" "ycmd")
|
|
|
|
gitprepare "YouCompleteMe" "third_party/" "${YouCompleteMe[@]}"
|
|
|
|
|
2018-02-18 13:34:48 -08:00
|
|
|
ycmd=("bottle" "python-frozendict" "python-future" "JediHTTP" "waitress" "requests")
|
2018-01-01 02:20:54 -08:00
|
|
|
[[ "$_omnisharp" = "y" ]] && ycmd+=("OmniSharpServer")
|
|
|
|
[[ "$_rust" = "y" ]] && ycmd+=("racerd")
|
|
|
|
[[ "$_gocode" = "y" ]] && ycmd+=("gocode" "godef")
|
|
|
|
gitprepare "YouCompleteMe/third_party/ycmd" "third_party/" "${ycmd[@]}"
|
|
|
|
|
2018-02-18 13:34:48 -08:00
|
|
|
JediHTTP=("waitress" "jedi" "bottle")
|
2018-01-01 02:20:54 -08:00
|
|
|
gitprepare "YouCompleteMe/third_party/ycmd/third_party/JediHTTP" "vendor/" "${JediHTTP[@]}"
|
|
|
|
|
|
|
|
if [ "$_omnisharp" = "y" ]; then
|
|
|
|
OmniSharpServer=("NRefactory" "cecil")
|
|
|
|
gitprepare "YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer" "" "${OmniSharpServer[@]}"
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
gitprepare() {
|
|
|
|
CD_DIR=$1
|
|
|
|
GIT_PREFIX=$2
|
|
|
|
c=0
|
|
|
|
for val in "$@" ; do
|
|
|
|
if [ $c -gt 1 ]; then
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
msg2 'Building ycmd...' # BuildYcmdLibs()
|
|
|
|
mkdir -p "$srcdir/ycmd_build"
|
|
|
|
cd "$srcdir/ycmd_build" || exit
|
|
|
|
cmake -G "Unix Makefiles" -DUSE_SYSTEM_LIBCLANG="$_completer" . "$srcdir/YouCompleteMe/third_party/ycmd/cpp"
|
|
|
|
make ycm_core
|
|
|
|
|
|
|
|
if [ "$_omnisharp" = "y" ]; then
|
|
|
|
msg2 'Building OmniSharp completer...' # BuildOmniSharp()
|
|
|
|
cd "$srcdir/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer" || exit
|
|
|
|
pwd
|
|
|
|
xbuild /property:Configuration=Release
|
|
|
|
else
|
|
|
|
msg2 'Skipping OmniSharp completer...'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$_gocode" = "y" ]; then
|
|
|
|
msg2 'Building Gocode completer...' # BuildGoCode()
|
|
|
|
cd "$srcdir/YouCompleteMe/third_party/ycmd/third_party/gocode" || exit
|
|
|
|
pwd
|
|
|
|
go build
|
|
|
|
cd "$srcdir/YouCompleteMe/third_party/ycmd/third_party/godef" || exit
|
|
|
|
pwd
|
|
|
|
go build
|
|
|
|
else
|
|
|
|
msg2 'Skipping Gocode completer...'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$_rust" = "y" ]; then
|
|
|
|
msg2 'Building Rust completer...' # BuildRacerd()
|
|
|
|
cd "$srcdir/YouCompleteMe/third_party/ycmd/third_party/racerd" || exit
|
|
|
|
pwd
|
|
|
|
cargo build --release
|
|
|
|
else
|
|
|
|
msg2 'Skipping Rust completer...'
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$_tern" = "y" ]; then
|
|
|
|
msg2 'Building Tern completer...' # SetUpTern()
|
|
|
|
cd "$srcdir/YouCompleteMe/third_party/ycmd/third_party/tern_runtime" || exit
|
|
|
|
pwd
|
|
|
|
npm install --production --python=python2
|
|
|
|
else
|
|
|
|
msg2 'Skipping Tern completer...'
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
mkdir -p "$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party"
|
|
|
|
|
|
|
|
cp -r "$srcdir/YouCompleteMe/"{autoload,doc,plugin,python} \
|
|
|
|
"$pkgdir/usr/share/vim/vimfiles"
|
|
|
|
cp -r "$srcdir/YouCompleteMe/third_party/"{pythonfutures,requests-futures} \
|
|
|
|
"$pkgdir/usr/share/vim/vimfiles/third_party"
|
|
|
|
cp -r "$srcdir/YouCompleteMe/third_party/ycmd/"{ycmd,ycm_core.so,CORE_VERSION,cpp,clang_includes} \
|
|
|
|
"$pkgdir/usr/share/vim/vimfiles/third_party/ycmd"
|
2018-02-18 13:34:48 -08:00
|
|
|
cp -r "$srcdir/YouCompleteMe/third_party/ycmd/third_party/"{bottle,frozendict,JediHTTP,python-future,requests,waitress} \
|
2018-01-01 02:20:54 -08:00
|
|
|
"$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party"
|
|
|
|
|
|
|
|
if [ "$_omnisharp" = "y" ]; then
|
|
|
|
mkdir -p "$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party/OmniSharpServer/OmniSharp/bin/Release"
|
|
|
|
cp -r "$srcdir/YouCompleteMe/third_party/ycmd/third_party/OmniSharpServer/OmniSharp/bin/Release" \
|
|
|
|
"$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party/OmniSharpServer/OmniSharp/bin"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$_gocode" = "y" ]; then
|
|
|
|
mkdir -p "$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party/gocode"
|
|
|
|
mkdir -p "$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party/godef"
|
|
|
|
cp "$srcdir/YouCompleteMe/third_party/ycmd/third_party/gocode/gocode" \
|
|
|
|
"$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party/gocode/gocode"
|
|
|
|
cp "$srcdir/YouCompleteMe/third_party/ycmd/third_party/godef/godef" \
|
|
|
|
"$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party/godef/godef"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$_rust" = "y" ]; then
|
|
|
|
mkdir -p "$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party/racerd/target/release"
|
|
|
|
cp "$srcdir/YouCompleteMe/third_party/ycmd/third_party/racerd/target/release/racerd" \
|
|
|
|
"$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party/racerd/target/release/racerd"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$_tern" = "y" ]; then
|
|
|
|
cp -r "$srcdir/YouCompleteMe/third_party/ycmd/third_party/tern_runtime" \
|
|
|
|
"$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/third_party"
|
|
|
|
fi
|
|
|
|
|
|
|
|
find "$pkgdir" -name .git -exec rm -fr {} +
|
|
|
|
rm -rf "$pkgdir/usr/share/vim/vimfiles/third_party/ycmd/ycmd/tests"
|
|
|
|
}
|