Skip to content

Commit

Permalink
Merge pull request #19 from o01eg/master
Browse files Browse the repository at this point in the history
dev-utils/racer: Remove vim and emacs plugins installation.
  • Loading branch information
Heather authored and Heather committed Oct 7, 2015
2 parents 75cae1c + 80d6d3d commit 36035c3
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 36 deletions.
12 changes: 12 additions & 0 deletions app-vim/vim-racer/metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<herd>vim</herd>
<maintainer>
<email>o01eg@yandex.ru</email>
<name>O01eg</name>
</maintainer>
<longdescription lang="en">
Vim plugin for racer - RUST completion utility.
</longdescription>
</pkgmetadata>
29 changes: 29 additions & 0 deletions app-vim/vim-racer/vim-racer-9999.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit vim-plugin git-r3

DESCRIPTION="vim plugin: racer support"
HOMEPAGE="https://github.com/racer-rust/vim-racer"
LICENSE="MIT"
KEYWORDS=""
IUSE=""
EGIT_REPO_URI="https://github.com/racer-rust/vim-racer"
RDEPEND="dev-util/racer"

src_prepare() {
sed -i 's|\(g:racer_cmd = \).*|\1"/usr/bin/racer"|' plugin/racer.vim
}

pkg_postinst() {
vim-plugin_pkg_postinst

elog "For vim you can use 'let \$RUST_SRC_PATH=\"<path-to>/rust/src/\"'"
elog "if you don't want to use environment variable"
elog "You also can use \"set hidden\" or else your buffer will be"
elog "unloaded on every goto-definition"
}

4 changes: 0 additions & 4 deletions dev-util/racer/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
<longdescription>
Rust Code Completion utility
</longdescription>
<use>
<flag name="emacs"> install emacs script </flag>
<flag name="vim"> install vim plugin </flag>
</use>
</pkgmetadata>
36 changes: 4 additions & 32 deletions dev-util/racer/racer-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,19 @@

EAPI=5

inherit eutils git-r3 elisp-common
inherit eutils git-r3

DESCRIPTION="Rust Code Completion utility "
HOMEPAGE="https://github.com/phildawes/racer"

LICENSE="MIT"
SLOT="0"
KEYWORDS=""
IUSE="emacs vim"
IUSE=""

EGIT_REPO_URI="https://github.com/phildawes/racer"

COMMON_DEPEND="dev-lang/rust:*
emacs? (
app-emacs/company-mode[ropemacs]
app-emacs/rust-mode
virtual/emacs )
vim? ( || ( app-editors/vim app-editors/gvim ) )"
COMMON_DEPEND="dev-lang/rust:*"
DEPEND="${COMMON_DEPEND}
dev-util/cargo"
RDEPEND="${COMMON_DEPEND}"
Expand All @@ -32,37 +27,14 @@ src_compile() {

src_install() {
dobin target/release/racer
if use emacs; then
elisp-install ${PN} editors/racer.el
elisp-site-file-install "${FILESDIR}/50${PN}-gentoo.el"
fi
if use vim; then
insinto /usr/share/vim/vimfiles/plugin/
sed -i 's|\(g:racer_cmd = \).*|\1"/usr/bin/racer"|' plugin/racer.vim
doins plugin/racer.vim
fi
}

pkg_postinst() {
elog "You most probably should fetch rust sources for best expirience."
elog "Racer will look for sources in path pointed by RUST_SRC_PATH"
elog "environment variable. You can use"
elog "% export RUST_SRC_PATH=<path to>/rust/src."
elog "Use vim-racer or emacs-racer for the editos support"
elog
if use emacs; then
elog "You should use '(setq racer-rust-src-path \"<path-to>/rust/src/\")'"
elog "for emacs plugin to be able to find rust sources for racer."
elog
elisp-site-regen
fi
if use vim; then
elog "For vim you can use 'let \$RUST_SRC_PATH=\"<path-to>/rust/src/\"'"
elog "if you don't want to use environment variable"
elog "You also can use \"set hidden\" or else your buffer will be"
elog "unloaded on every goto-definition"
fi
}

pkg_postrm() {
use emacs && elisp-site-regen
}

0 comments on commit 36035c3

Please sign in to comment.