summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Phillips <rphillips@gentoo.org>2002-10-27 22:40:58 +0000
committerRyan Phillips <rphillips@gentoo.org>2002-10-27 22:40:58 +0000
commitd4e8e1f187da09a716e993aaf41cf7b80b88c59b (patch)
treee23e76a1ea4ee9f2017107bdcb7a9ca27e33b884 /eclass/vim.eclass
parentinitial version (diff)
downloadgentoo-2-d4e8e1f187da09a716e993aaf41cf7b80b88c59b.tar.gz
gentoo-2-d4e8e1f187da09a716e993aaf41cf7b80b88c59b.tar.bz2
gentoo-2-d4e8e1f187da09a716e993aaf41cf7b80b88c59b.zip
Added vim eclass
Diffstat (limited to 'eclass/vim.eclass')
-rw-r--r--eclass/vim.eclass110
1 files changed, 110 insertions, 0 deletions
diff --git a/eclass/vim.eclass b/eclass/vim.eclass
new file mode 100644
index 000000000000..248a0022386c
--- /dev/null
+++ b/eclass/vim.eclass
@@ -0,0 +1,110 @@
+# Copyright 1999-2000 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# Author Ryan Phillips <rphillips@gentoo.org>
+# $Header: /var/cvsroot/gentoo-x86/eclass/vim.eclass,v 1.1 2002/10/27 22:40:58 rphillips Exp $
+# Ripped from the vim ebuilds. src_compile and install
+# should be integrated in at some point
+
+# Calculate the version based on the name of the ebuild
+vim_version="${PV%_pre*}"
+vim_pre="${PV##*_pre}"
+VIMPATCH="vimpatch-1-213.tar.bz2"
+
+if [ "$vim_version" = "$vim_pre" ]; then
+ # Final releases prior to 6.0 include a dash and decimal point in
+ # the directory name
+ if [ "${vim_version%%.*}" -lt 6 ]; then
+ S="$WORKDIR/vim-$vim_version"
+ else
+ S="$WORKDIR/vim${vim_version//.}"
+ fi
+ vim_letters=
+ A="vim-$vim_version.tar.bz2"
+ SRC_URI="ftp://ftp.vim.org/pub/vim/unix/$A
+ ftp://ftp.us.vim.org/pub/vim/unix/$A
+ http://www.ibiblio.org/gentoo/distfiles/${VIMPATCH}"
+elif [ "$vim_pre" -lt 27 ]; then
+ # Handle (prerelease) versions with one trailing letter
+ vim_letters=`echo $vim_pre | awk '{printf "%c", $0+96}'`
+ S="$WORKDIR/vim${vim_version//.}$vim_letters"
+ A="vim-$vim_version$vim_letters.tar.bz2"
+ SRC_URI="ftp://ftp.vim.org/pub/vim/unreleased/unix/$A
+ ftp://ftp.us.vim.org/pub/vim/unreleased/unix/$A
+ http://www.ibiblio.org/gentoo/distfiles/${VIMPATCH}"
+
+elif [ "$vim_pre" -lt 703 ]; then
+ # Handle (prerelease) versions with two trailing letters
+ vim_letters=`echo $vim_pre | awk '{printf "%c%c", $0/26+96, $0%26+96}'`
+ S="$WORKDIR/vim${vim_version//.}$vim_letters"
+ A="vim-$vim_version$vim_letters.tar.bz2"
+ SRC_URI="ftp://ftp.vim.org/pub/vim/unreleased/unix/$A
+ ftp://ftp.us.vim.org/pub/vim/unreleased/unix/$A
+ http://www.ibiblio.org/gentoo/distfiles/${VIMPATCH}"
+else
+ die "Eek! I don't know how to interpret the version!"
+fi
+
+HOMEPAGE="http://www.vim.org/"
+SLOT="0"
+LICENSE="vim"
+KEYWORDS="x86 ppc sparc sparc64 alpha"
+
+DEPEND="dev-util/cscope
+ >=sys-libs/ncurses-5.2-r2
+ gpm? ( >=sys-libs/gpm-1.19.3 )
+ perl? ( sys-devel/perl )
+ python? ( dev-lang/python )
+ ruby? ( >=dev-lang/ruby-1.6.4 )"
+# tcltk? ( dev-lang/tcl )"
+# It appears that the tclinterp stuff in Vim is broken right now (at
+# least on Linux... it works on BSD). When you --enable-tclinterp
+# flag, then the following command never returns:
+#
+# VIMINIT='let OS = system("uname -s")' vim
+#
+# Please don't re-enable the tclinterp flag without verifying first
+# that the above works. Thanks. (08 Sep 2001 agriffis)
+
+
+src_unpack() {
+ unpack ${A}
+ # Fixup a script to use awk instead of nawk
+ cd ${S}/runtime/tools
+ mv mve.awk mve.awk.old
+ ( read l; echo "#!/usr/bin/awk -f"; cat ) <mve.awk.old >mve.awk
+ # Another set of patch's borrowed from src rpm to fix syntax error's etc.
+ cd ${WORKDIR}
+ tar xvjf ${FILESDIR}/vimpatch.tar.bz2
+ cd $S
+ patch -p1 < ${WORKDIR}/vim-4.2-speed_t.patch || die
+ patch -p1 < ${WORKDIR}/vim-5.1-vimnotvi.patch || die
+ patch -p1 < ${WORKDIR}/vim-5.6a-paths.patch || die
+ patch -p1 < ${WORKDIR}/vim-6.0-fixkeys.patch || die
+ patch -p1 < ${WORKDIR}/vim-6.0-specsyntax.patch || die
+ patch -p1 < ${WORKDIR}/vim-6.0r-crv.patch || die
+
+ cd ${WORKDIR}
+ tar xvjf ${DISTDIR}/${VIMPATCH}
+ cd ${S}
+
+ # Apply any patches available for this version
+ local patches=`echo ${WORKDIR}/${PV}.[0-9][0-9][0-9]`
+ case "$patches" in
+ *\])
+ ;; # globbing didn't work; no patches available
+ *)
+ cd $S
+ for a in $patches; do
+ echo -n "Applying patch $a..."
+ patch -p0 < $a > /dev/null || die
+ echo "OK"
+ done
+ ;;
+ esac
+
+ # Also apply the ebuild syntax patch, until this is in Vim proper
+ cd $S/runtime
+ patch -f -p0 < ${FILESDIR}/ebuild.patch
+
+}
+