summaryrefslogtreecommitdiffstats
path: root/vim/PKGBUILD
blob: c3faac6dad791024866a6a620eb835c46699f601 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# $Id$
# Maintainer: tobias [ tobias at archlinux org ]

pkgname=vim
_srcver=7.2
_patchlevel=234
pkgver=${_srcver}.${_patchlevel}
pkgrel=1
pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor'
arch=(i686 x86_64)
license=('custom:vim')
url="http://www.vim.org"
depends=('gpm' 'coreutils')
makedepends=('wget' 'sed' 'grep' 'gettext' 'perl')
optdepends=('perl:    the runtime provides a view useful perl scripts')
backup=(etc/vimrc)
install=${pkgname}.install
# we need the extra-stuff to get all patches applied smoothly
source=(ftp://ftp.vim.org/pub/vim/unix/vim-${_srcver}.tar.bz2 \
        ftp://ftp.vim.org/pub/vim/extra/vim-${_srcver}-extra.tar.gz \
        ftp://ftp.vim.org/pub/vim/extra/vim-${_srcver}-lang.tar.gz \
        fetch_patches.sh fetch_runtime.sh vimrc archlinux.vim)

build()
{
  _versiondir="vim"$(echo ${_srcver} | sed "s/\.//")
  # pull in patches from vim.org (or the src cache alternatively)
  . ${srcdir}/fetch_patches.sh
  . ${srcdir}/fetch_runtime.sh
  get_patches || return 1
  cd ${srcdir}/${_versiondir}
  sed -i 's|^.*\(#define SYS_.*VIMRC_FILE.*"\) .*$|\1|' src/feature.h
  sed -i 's|^.*\(#define VIMRC_FILE.*"\) .*$|\1|' src/feature.h
  # build party
  ./configure --prefix=/usr --localstatedir=/var/lib/vim --mandir=/usr/share/man \
    --with-compiledby=ArchLinux --with-features=big \
    --enable-gpm --enable-acl --with-x=no --disable-gui \
    --enable-multibyte --enable-cscope \
    --enable-perlinterp
    #--with-global-runtime=/usr/share/vim --with-vim-name=vim \
  make || return 1
  make  VIMRCLOC=/etc DESTDIR=${pkgdir} install
  cd ${pkgdir}/usr/bin
  rm ex view          # provided by (n)vi in core
  mv vim vim-normal   # we create a vim-symlink on post_install
  ln -sf vim-normal vim
  # ... make g* related symlinks point directly to the actual binary
  ln -sf vim-normal rview
  ln -sf vim-normal rvim
  ln -sf vim-normal vimdiff

  # delete some manpages
  find ${pkgdir}/usr/share/man -type d -name 'man1' 2> /dev/null | \
   while read mandir; do
    cd ${mandir}
    rm -f ex.1 view.1       # provided by (n)vi
    rm -f evim.1            # this does not make sense in the console version
  done

  _runtimedir="${pkgdir}/usr/share/vim/${_versiondir}/"
  update_runtime
  cd ${srcdir}/${_versiondir}
  install -Dm644 ${srcdir}/vimrc  ${pkgdir}/etc/vimrc
  install -Dm644 ${srcdir}/archlinux.vim  \
                 ${pkgdir}/usr/share/vim/vimfiles/archlinux.vim
  install -dm755 ${pkgdir}/usr/share/licenses/vim
  cd ${pkgdir}/usr/share/licenses/vim
  ln -s ../../vim/${_versiondir}/doc/uganda.txt license.txt
}