diff options
author | James Brink | 2019-07-14 18:46:03 -0700 |
---|---|---|
committer | James Brink | 2019-07-14 18:46:03 -0700 |
commit | 977f0c5bc86ab904eb7951138e060e66d1555b8f (patch) | |
tree | 1fcc6805ab4a521c78852a7314a3571fb08ff02c | |
parent | 266461f829fb4983188ab27879be851df8df69a5 (diff) | |
download | aur-977f0c5bc86ab904eb7951138e060e66d1555b8f.tar.gz |
Add patch for rustup to use existing toolchains
Add patch for rustup to ycmd to use existing toolchains
Add rust support instructions to upgrade and install hooks
Remove some un-needed lines from PKGBUILD
Bumped pkgrel number
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | .gitignore | 3 | ||||
-rw-r--r-- | PKGBUILD | 53 | ||||
-rw-r--r-- | install.sh | 14 | ||||
-rw-r--r-- | rls.patch | 19 |
5 files changed, 53 insertions, 40 deletions
@@ -1,7 +1,7 @@ pkgbase = vim-youcompleteme-git pkgdesc = A code-completion engine for Vim pkgver = r2535.04c35051 - pkgrel = 2 + pkgrel = 3 url = https://ycm-core.github.io/YouCompleteMe/ install = install.sh arch = x86_64 @@ -39,6 +39,7 @@ pkgbase = vim-youcompleteme-git source = git+https://github.com/urllib3/urllib3.git source = git+https://github.com/ycm-core/ycmd.git source = git+https://github.com/ycm-core/YouCompleteMe.git + source = rls.patch source = git+https://github.com/mdempsky/gocode.git source = git+https://github.com/rogpeppe/godef.git source = https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.33.0/omnisharp.http-linux-x64.tar.gz @@ -57,6 +58,7 @@ pkgbase = vim-youcompleteme-git sha256sums = SKIP sha256sums = SKIP sha256sums = SKIP + sha256sums = cde1d1265be82e246edb6021e0a4b4e01af1a140b8d92b05bde6929e922ae215 sha256sums = SKIP sha256sums = SKIP sha256sums = 74cecc6265969d312b8124cb88152cdd9874f1027957d88ec0268d9c3e6cd3f1 diff --git a/.gitignore b/.gitignore index 327b502a6d81..33ec38c258f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ * !.gitignore !.SRCINFO -!PKGBUILD !install.sh +!PKGBUILD +!rls.patch @@ -45,7 +45,7 @@ pkgver() { cd "YouCompleteMe" || exit printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" } -pkgrel=2 +pkgrel=3 pkgdesc="A code-completion engine for Vim" arch=('x86_64') url='https://ycm-core.github.io/YouCompleteMe/' @@ -69,9 +69,10 @@ source=( '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') + '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') +sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'cde1d1265be82e246edb6021e0a4b4e01af1a140b8d92b05bde6929e922ae215') #=========================================================================================================# # Applying PKBUILD Build Options # @@ -160,14 +161,6 @@ prepare() { local ycmd=("bottle" "regex" "python-frozendict" "python-future" "waitress") - if [[ "$_omnisharp" == "y" ]]; then - ycmd+=("OmniSharpServer") - fi - - if [[ "$_rust" == "y" ]]; then - ycmd+=("rust-completer") - fi - gitprepare "YouCompleteMe/third_party/ycmd" "third_party/" "${ycmd[@]}" local ycmdJediDeps=("jedi" "parso") @@ -184,6 +177,16 @@ prepare() { 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 <rls.patch + rm rls.patch + fi + } build() { @@ -203,24 +206,6 @@ build() { echo 'Skipping Gocode completer...' fi - # TODO there has to be a better way of doing this. - if [[ "$_rust" == "y" ]]; then - echo 'Building Rust completer...' - if [ -d "$srcdir/YouCompleteMe/third_party/ycmd/third_party/rls" ] - then - rm -rf "$srcdir/YouCompleteMe/third_party/ycmd/third_party/rls" - fi - mkdir -p "$srcdir/rust-tmp" - cd "$srcdir/rust-tmp" || exit - export RUSTUP_HOME="$(pwd)" - rustup toolchain install nightly - rustup default nightly - rustup component add rls rust-analysis rust-src - cp -rv "$srcdir/rust-tmp/toolchains/nightly-$CARCH-unknown-linux-gnu" "$srcdir/YouCompleteMe/third_party/ycmd/third_party/rls" - else - echo 'Skipping Rust completer...' - fi - if [[ "$_typescript" == "y" ]]; then echo 'Building Typescipt completer...' cd "$srcdir/YouCompleteMe/third_party/ycmd/" || exit @@ -288,10 +273,9 @@ package() { # There seems to be a case senitivity issue with the packaged release of omnisharp-roslyn # and the filename that ycm expects so we link it. - if [ -f "$pkgdir/$vimfiles_dir/third_party/ycmd/third_party/omnisharp-roslyn/OmniSharp.exe" ] - then + if [ -f "$pkgdir/$vimfiles_dir/third_party/ycmd/third_party/omnisharp-roslyn/OmniSharp.exe" ]; then ln -s "$pkgdir/$vimfiles_dir/third_party/ycmd/third_party/omnisharp-roslyn/OmniSharp.exe" \ - "$pkgdir/$vimfiles_dir/third_party/ycmd/third_party/omnisharp-roslyn/Omnisharp.exe" + "$pkgdir/$vimfiles_dir/third_party/ycmd/third_party/omnisharp-roslyn/Omnisharp.exe" fi fi @@ -300,11 +284,6 @@ package() { "$pkgdir/$vimfiles_dir/third_party/ycmd/third_party/go" fi - if [[ "$_rust" == "y" ]]; then - cp -r "$srcdir/YouCompleteMe/third_party/ycmd/third_party/rls" \ - "$pkgdir/$vimfiles_dir/third_party/ycmd/third_party/rls" - fi - if [[ "$_tern" == "y" ]]; then cp -r "$srcdir/YouCompleteMe/third_party/ycmd/third_party/tern_runtime" \ "$pkgdir/$vimfiles_dir/third_party/ycmd/third_party" diff --git a/install.sh b/install.sh index f010aa8af641..113425cf6953 100644 --- a/install.sh +++ b/install.sh @@ -1,16 +1,28 @@ update_vim_help() { echo -n "Updating Vim help tags..." /usr/bin/vim --noplugin -u NONE -U NONE \ - --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q" > /dev/null 2>&1 + --cmd ":helptags /usr/share/vim/vimfiles/doc" --cmd ":q" >/dev/null 2>&1 echo "done." } post_install() { update_vim_help + echo "For rust support be sure to setup a default toolchain with rustup (and enable rust in PKGBUILD)" + echo "rls, rust-analysis and rust-src are needed for whatever toolchain you are using." + echo "Example:" + echo -e "\trustup toolchain install nightly" + echo -e "\trustup default nightly" + echo -e "\trustup component add rls rust-analysis rust-src" } post_upgrade() { update_vim_help + echo "For rust support be sure to setup a default toolchain with rustup (and enable rust in PKGBUILD)" + echo "rls, rust-analysis and rust-src are needed for whatever toolchain you are using." + echo "Example:" + echo -e "\trustup toolchain install nightly" + echo -e "\trustup default nightly" + echo -e "\trustup component add rls rust-analysis rust-src" } post_remove() { diff --git a/rls.patch b/rls.patch new file mode 100644 index 000000000000..a72804d02769 --- /dev/null +++ b/rls.patch @@ -0,0 +1,19 @@ +diff --git a/ycmd/completers/rust/rust_completer.py b/ycmd/completers/rust/rust_completer.py +index dc14d6ee..cf5fd77c 100644 +--- a/ycmd/completers/rust/rust_completer.py ++++ b/ycmd/completers/rust/rust_completer.py +@@ -33,11 +33,9 @@ from ycmd.utils import LOGGER, re + + + LOGFILE_FORMAT = 'rls_' +-RLS_BIN_DIR = os.path.abspath( +- os.path.join( os.path.dirname( __file__ ), '..', '..', '..', 'third_party', +- 'rls', 'bin' ) ) +-RUSTC_EXECUTABLE = utils.FindExecutable( os.path.join( RLS_BIN_DIR, 'rustc' ) ) +-RLS_EXECUTABLE = utils.FindExecutable( os.path.join( RLS_BIN_DIR, 'rls' ) ) ++RLS_BIN_DIR = '/usr/bin' ++RUSTC_EXECUTABLE = os.path.join( RLS_BIN_DIR, 'rustc' ) ++RLS_EXECUTABLE = os.path.join( RLS_BIN_DIR, 'rls' ) + RLS_VERSION_REGEX = re.compile( r'^rls (?P<version>.*)$' ) + + |