vim patches 1-200... Fixes #8400. Submitted by Bret Towe
authorRyan Phillips <rphillips@gentoo.org>
Mon, 30 Sep 2002 04:45:30 +0000 (04:45 +0000)
committerRyan Phillips <rphillips@gentoo.org>
Mon, 30 Sep 2002 04:45:30 +0000 (04:45 +0000)
app-editors/gvim/ChangeLog
app-editors/gvim/files/digest-gvim-6.1-r1 [new file with mode: 0644]
app-editors/gvim/gvim-6.1-r1.ebuild [new file with mode: 0644]
app-editors/vim-core/ChangeLog
app-editors/vim-core/files/digest-vim-core-6.1-r1 [new file with mode: 0644]
app-editors/vim-core/vim-core-6.1-r1.ebuild [new file with mode: 0644]
app-editors/vim/ChangeLog
app-editors/vim/files/digest-vim-6.1-r14 [new file with mode: 0644]
app-editors/vim/vim-6.1-r14.ebuild [new file with mode: 0644]

index 6e32edc229e05366649ea2593bb2e2f75c92e3fb..30aab0e9b58b41cfbb83cd78a103d9baf11359c6 100644 (file)
@@ -1,6 +1,6 @@
 # ChangeLog for app-editors/gvim
 # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-editors/gvim/ChangeLog,v 1.2 2002/09/16 10:31:01 hannes Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-editors/gvim/ChangeLog,v 1.3 2002/09/30 04:42:59 rphillips Exp $
 
   16 Sep 2002; Hannes Mehnert <hannes@gentoo.org> gvim-6.1.ebuild:
   added dependency app-editors/vim-core
@@ -8,6 +8,12 @@
   14 Sep 2002; Hannes Mehnert <hannes@gentoo.org> gvim-6.1.ebuild:
   commited wrong ebuild (wrong dependencies), corrected now)
 
+*gvim-6.1-r1.ebuild (29 Sep 2002)
+
+  29 Sep 2002; Ryan Phillips <rphillips@gentoo.org> gvim-6.1-r1.ebuild:
+
+  Added patches 1-200
+
 *gvim-6.1.ebuild (12 Sep 2002)
 
   12 Sep 2002; Hannes Mehnert <hannes@gentoo.org> gvim-6.1.ebuild:
diff --git a/app-editors/gvim/files/digest-gvim-6.1-r1 b/app-editors/gvim/files/digest-gvim-6.1-r1
new file mode 100644 (file)
index 0000000..6dc32bf
--- /dev/null
@@ -0,0 +1,2 @@
+MD5 7fd0f915adc7c0dab89772884268b030 vim-6.1.tar.bz2 2890049
+MD5 cbbec4728fcee63ce994339340e4769b vimpatch-1-200.tar.bz2 152558
diff --git a/app-editors/gvim/gvim-6.1-r1.ebuild b/app-editors/gvim/gvim-6.1-r1.ebuild
new file mode 100644 (file)
index 0000000..b0e73a9
--- /dev/null
@@ -0,0 +1,165 @@
+# Copyright 2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/app-editors/gvim/gvim-6.1-r1.ebuild,v 1.1 2002/09/30 04:42:59 rphillips Exp $
+
+# Please name the ebuild as follows.  If this is followed, there
+# should be no need to modify this ebuild when the Vim version is
+# updated.  (Yes it's overkill, but it was fun!)
+#
+#   vim-6.0, when 6.0 is finally released
+#   vim-6.0_pre9, where 9 = (i), for vim-6.0i
+#   vim-6.0_pre47, where 47 = 26(a) + 21(u), for vim-6.0au
+#   vim-6.0_pre72, where 72 = 52(b) + 20(t), for vim-6.0bt
+#
+# Quick reference:
+#   a=1   e=5   i=9   m=13  q=17  u=21  y=25
+#   b=2   f=6   j=10  n=14  r=18  v=22  z=26
+#   c=3   g=7   k=11  o=15  s=19  w=23 aa=27
+#   d=4   h=8   l=12  p=16  t=20  x=24 ab=28 (etc.)
+#
+# (08 Sep 2001 agriffis)
+
+# Calculate the version based on the name of the ebuild
+vim_version="${PV%_pre*}"
+vim_pre="${PV##*_pre}"
+VIMPATCH="vimpatch-1-200.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
+
+DESCRIPTION="gvim"
+HOMEPAGE="http://www.vim.org/"
+
+SLOT="0"
+LICENSE="vim"
+KEYWORDS="x86 ppc sparc sparc64"
+
+DEPEND="dev-util/cscope
+       >=sys-libs/ncurses-5.2-r2
+       =app-editors/vim-core-6.1
+       x11-base/xfree
+       gpm?    ( >=sys-libs/gpm-1.19.3 )
+       gnome?  ( gnome-base/gnome-libs )
+       gtk?    ( =x11-libs/gtk+-1.2* )
+       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
+                               patch -p0 < $a
+                       done
+                       ;;
+       esac
+}
+
+src_compile() {
+       local myconf
+       use nls    && myconf="--enable-multibyte" || myconf="--disable-nls"
+       use perl   && myconf="$myconf --enable-perlinterp"
+       use python && myconf="$myconf --enable-pythoninterp"
+       use ruby   && myconf="$myconf --enable-rubyinterp"
+       
+# tclinterp is BROKEN.  See note above DEPEND=
+#      use tcltk  && myconf="$myconf --enable-tclinterp"
+
+# Added back gpm for temporary will remove if necessary, I think that I have
+# fixed most of gpm so it should be fine.
+       use gpm    || myconf="$myconf --disable-gpm"
+
+       if use gnome; then
+               guiconf="--enable-gui=gnome --with-x"
+       elif use gtk; then
+               guiconf="--enable-gui=gtk --with-x"
+       else
+               guiconf="--enable-gui=athena --with-x"
+       fi
+       
+       # This should fix a sandbox violation. 
+       addwrite /dev/pty/*
+       
+       if [ -n "$guiconf" ]; then
+               ./configure \
+                       --prefix=/usr --mandir=/usr/share/man --host=$CHOST \
+                       --with-features=huge --enable-cscope $myconf $guiconf \
+                       --with-vim-name=gvim || die "gvim configure failed"
+               # Parallel make does not work
+               make || die "gvim make failed"
+       fi
+}
+
+src_install() {
+       dobin src/gvim
+       ln -s gvim ${D}/usr/bin/gvimdiff
+       # Default gvimrc
+       insinto /usr/share/vim
+       doins ${FILESDIR}/gvimrc
+}
index 1e77436c27eda67e179666d80046dde3ddc980ae..09621b381167e40a5e6c230b85587b1589edf3b8 100644 (file)
@@ -1,50 +1,16 @@
 # ChangeLog for app-editors/vim-core
 # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-editors/vim-core/ChangeLog,v 1.1 2002/09/13 09:16:58 hannes Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-editors/vim-core/ChangeLog,v 1.2 2002/09/30 04:45:30 rphillips Exp $
 
-*vim-core-6.1.ebuild (12 Sep 2002)
+*vim-core-6.1-r1 (29 Sep 2002)
 
-  12 Sep 2002; Hannes Mehnert <hannes@gentoo.org> vim-core-6.1.ebuild:
-  splitted vim into gvim, vim and vim-core
-
-*<PACKAGE_NAME>-<PACKAGE_VERSION>-<PACKAGE_RELEASE> (DD MMM YYYY)
+  29 Sep 2002; Ryan Phillips <rphillips@gentoo.org> vim-core-6.1-r1.ebuild :
 
-  DD MMM YYYY; YOUR_NAME <YOUR_EMAIL> changed_file1, changed_file2: Initial
-  import. Ebuild submitted by submitter_name <submitter_email>.  Note that the
-  "changed_file" listing is optional if you are simply bumping the rev of the
-  ebuild and are only making changes to the .ebuild file itself.  Also note
-  that we now have a single unified paragraph rather than having the first line
-  separated from the rest by a newline.  Everything should be in one block like
-  this. (note by drobbins, 16 Jul 2002)
+  Added patches 1-200. Submitted by Bret Towe. Fixes #8400
 
-  DD MMM YYYY; YOUR_NAME <YOUR_EMAIL> changed_file1, changed_file2: this is
-  an earlier ChangeLog enty.
- 
--- Explanation of ChangeLog format:
+*vim-core-6.1 (12 Sep 2002)
 
-  This changelog is targetted to users. This means that the comments should be
-  well explained and written in clean English.
- 
-  Every new version or revision of the package should be marked by a '*'
-  seperator line as above. Changes since the last revision have to be added to
-  the top of the file, underneath the initial copyright and cvs header
-  comments, in exactly the same format as this comment.
-  
-  This means that you start with header line that has the following format,
-  indented two spaces:
-  
-  DD MMM YYYY; your_name <your_email> changed_file1, changed_file2: Your
-  explanation should follow. It should be indented and wrapped at a line width
-  of 80 characters.  The changed_files can be omitted if they are obvious; for
-  example, if you are only modifying the .ebuild file and committing a new rev
-  of a package.  Any details about what exactly changed in the code should be
-  added as a message when the changes are committed to cvs, not in this file.
-
--- A word regarding credit:
+  12 Sep 2002; Hannes Mehnert <hannes@gentoo.org> vim-core-6.1.ebuild:
 
-  Please add credit information ("ebuild submitted by ...", "patch submitted
-  by ...") to the ChangeLog. Do not add this information to the ebuilds
-  themselves.
+  splitted vim into gvim, vim and vim-core
 
-  And remember: Give credit where credit is due. We're all doing this for
-  free, so the best we can hope (and expect!) to receive is credit.
diff --git a/app-editors/vim-core/files/digest-vim-core-6.1-r1 b/app-editors/vim-core/files/digest-vim-core-6.1-r1
new file mode 100644 (file)
index 0000000..6dc32bf
--- /dev/null
@@ -0,0 +1,2 @@
+MD5 7fd0f915adc7c0dab89772884268b030 vim-6.1.tar.bz2 2890049
+MD5 cbbec4728fcee63ce994339340e4769b vimpatch-1-200.tar.bz2 152558
diff --git a/app-editors/vim-core/vim-core-6.1-r1.ebuild b/app-editors/vim-core/vim-core-6.1-r1.ebuild
new file mode 100644 (file)
index 0000000..9d955d0
--- /dev/null
@@ -0,0 +1,172 @@
+# Copyright 2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/app-editors/vim-core/vim-core-6.1-r1.ebuild,v 1.1 2002/09/30 04:45:30 rphillips Exp $
+
+# Please name the ebuild as follows.  If this is followed, there
+# should be no need to modify this ebuild when the Vim version is
+# updated.  (Yes it's overkill, but it was fun!)
+#
+#   vim-6.0, when 6.0 is finally released
+#   vim-6.0_pre9, where 9 = (i), for vim-6.0i
+#   vim-6.0_pre47, where 47 = 26(a) + 21(u), for vim-6.0au
+#   vim-6.0_pre72, where 72 = 52(b) + 20(t), for vim-6.0bt
+#
+# Quick reference:
+#   a=1   e=5   i=9   m=13  q=17  u=21  y=25
+#   b=2   f=6   j=10  n=14  r=18  v=22  z=26
+#   c=3   g=7   k=11  o=15  s=19  w=23 aa=27
+#   d=4   h=8   l=12  p=16  t=20  x=24 ab=28 (etc.)
+#
+# (08 Sep 2001 agriffis)
+
+# Calculate the version based on the name of the ebuild
+vim_version="${PV%_pre*}"
+vim_pre="${PV##*_pre}"
+VIMPATCH="vimpatch-1-200.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
+
+DESCRIPTION="vim, gvim and kvim shared files"
+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
+                               patch -p0 < $a
+                       done
+                       ;;
+       esac
+       
+       # Also apply the ebuild syntax patch, until this is in Vim proper
+       cd $S/runtime
+       patch -f -p0 < ${FILESDIR}/ebuild.patch
+
+}
+
+src_compile() {
+
+       local myconf
+       use nls    && myconf="--enable-multibyte" || myconf="--disable-nls"
+       use perl   && myconf="$myconf --enable-perlinterp"
+       use python && myconf="$myconf --enable-pythoninterp"
+       use ruby   && myconf="$myconf --enable-rubyinterp"
+       
+# tclinterp is BROKEN.  See note above DEPEND=
+#      use tcltk  && myconf="$myconf --enable-tclinterp"
+
+# Added back gpm for temporary will remove if necessary, I think that I have
+# fixed most of gpm so it should be fine.
+       use gpm    || myconf="$myconf --disable-gpm"
+
+       # This should fix a sandbox violation. 
+       addwrite /dev/pty/*
+       
+       #
+       # Build a nogui version, this will install as /usr/bin/vim
+       #
+       ./configure \
+               --prefix=/usr --mandir=/usr/share/man --host=$CHOST \
+               --with-features=huge --with-cscope $myconf \
+               --enable-gui=no \
+               || die "vim configure failed"
+       # Parallel make does not work
+       make || die "vim make failed"
+       cd ${S}
+       rm src/vim
+}
+
+src_install() {
+       mkdir -p $D/usr/{bin,share/man/man1,share/vim}
+       cd src
+       make installruntime installhelplinks installmacros installtutor installtools install-languages install-icons DESTDIR=$D \
+               BINDIR=/usr/bin MANDIR=/usr/share/man DATADIR=/usr/share
+       # Docs
+       dodoc README*
+       cd $D/usr/share/doc/$PF
+       ln -s ../../vim/*/doc $P
+
+       #fix problems with vim not finding its data files.
+       dodir /etc/env.d
+       echo "VIMRUNTIME=/usr/share/vim/vim${vim_version/.}" \
+               >${D}/etc/env.d/40vim
+}
+
index 7446db0afab3768c91d10d5eb647c87ea0097c3e..108f52b61bd7853e74ba5783ee4e423a2ee3d0b2 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for app-editors/vim
 # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/app-editors/vim/ChangeLog,v 1.21 2002/09/25 03:34:53 jnelson Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-editors/vim/ChangeLog,v 1.22 2002/09/30 04:42:59 rphillips Exp $
+
+*vim-6.1-r14.ebuild (29 Sep 2002)
+
+  29 Sep 2002l Ryan Phillips <rphillips@gentoo.org> vim-6.1-r14.ebuild :
+
+  Added patched 1-200.... Jon's fix for bug #8237 should be taken care of
+  within this patch set.
 
 *vim-6.1-r13.ebuild (24 Sep 2002)
   24 Sep 2002; Jon Nelson <jnelson@gentoo.org> vim-6.1-r13.ebuild:
diff --git a/app-editors/vim/files/digest-vim-6.1-r14 b/app-editors/vim/files/digest-vim-6.1-r14
new file mode 100644 (file)
index 0000000..6dc32bf
--- /dev/null
@@ -0,0 +1,2 @@
+MD5 7fd0f915adc7c0dab89772884268b030 vim-6.1.tar.bz2 2890049
+MD5 cbbec4728fcee63ce994339340e4769b vimpatch-1-200.tar.bz2 152558
diff --git a/app-editors/vim/vim-6.1-r14.ebuild b/app-editors/vim/vim-6.1-r14.ebuild
new file mode 100644 (file)
index 0000000..0a4cf5d
--- /dev/null
@@ -0,0 +1,167 @@
+# Copyright 2002 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License, v2 or later
+# $Header: /var/cvsroot/gentoo-x86/app-editors/vim/vim-6.1-r14.ebuild,v 1.1 2002/09/30 04:42:59 rphillips Exp $
+
+# Please name the ebuild as follows.  If this is followed, there
+# should be no need to modify this ebuild when the Vim version is
+# updated.  (Yes it's overkill, but it was fun!)
+#
+#   vim-6.0, when 6.0 is finally released
+#   vim-6.0_pre9, where 9 = (i), for vim-6.0i
+#   vim-6.0_pre47, where 47 = 26(a) + 21(u), for vim-6.0au
+#   vim-6.0_pre72, where 72 = 52(b) + 20(t), for vim-6.0bt
+#
+# Quick reference:
+#   a=1   e=5   i=9   m=13  q=17  u=21  y=25
+#   b=2   f=6   j=10  n=14  r=18  v=22  z=26
+#   c=3   g=7   k=11  o=15  s=19  w=23 aa=27
+#   d=4   h=8   l=12  p=16  t=20  x=24 ab=28 (etc.)
+#
+# (08 Sep 2001 agriffis)
+
+set -e
+
+# Calculate the version based on the name of the ebuild
+vim_version="${PV%_pre*}"
+vim_pre="${PV##*_pre}"
+VIMPATCH="vimpatch-1-200.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
+
+DESCRIPTION="Vi IMproved!"
+HOMEPAGE="http://www.vim.org/"
+
+SLOT="0"
+LICENSE="vim"
+KEYWORDS="x86 ppc sparc sparc64 alpha"
+
+DEPEND="=app-editors/vim-core-6.1
+       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
+}
+
+src_compile() {
+       local myconf
+       myconf="--without-x"
+       use nls    && myconf="$myconf --enable-multibyte"
+       use nls    || myconf="$myconf --disable-nls"
+       use perl   && myconf="$myconf --enable-perlinterp"
+       use python && myconf="$myconf --enable-pythoninterp"
+       use ruby   && myconf="$myconf --enable-rubyinterp"
+       
+# tclinterp is BROKEN.  See note above DEPEND=
+#      use tcltk  && myconf="$myconf --enable-tclinterp"
+
+# Added back gpm for temporary will remove if necessary, I think that I have
+# fixed most of gpm so it should be fine.
+       use gpm    || myconf="$myconf --disable-gpm"
+
+       # This should fix a sandbox violation. 
+       addwrite "${SSH_TTY}"
+       
+       #
+       # Build a nogui version, this will install as /usr/bin/vim
+       #
+       ./configure \
+               --prefix=/usr --mandir=/usr/share/man --host=$CHOST \
+               --with-features=huge --with-cscope $myconf \
+               --enable-gui=no \
+               || die "vim configure failed"
+       # Parallel make does not work
+       make || die "vim make failed"
+}
+
+src_install() {
+       dobin src/vim
+       ln -s vim ${D}/usr/bin/vimdiff
+       # Default vimrc
+       insinto /usr/share/vim
+       doins ${FILESDIR}/vimrc
+}
+
+pkg_postinst() {
+       einfo ""
+       einfo "gvim has now a seperate ebuild, 'emerge gvim' will install gvim"
+}