archrelease: copy trunk to testing-any
[arch-packages.git] / vim / trunk / PKGBUILD
blob1f85289127b2d3aa7344619a0298df70b627d7ac
1 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
2 # Maintainer: Morten Linderud <foxboron@archlinux.org>
3 # Contributor: Anatol Pomozov <anatol.pomozov@gmail.com>
4 # Contributor: Thomas Dziedzic <gostrc@gmail.com>
5 # Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>
6 # Contributor: tobias [ tobias at archlinux org ]
7 # Contributor: Daniel J Griffiths <ghost1227@archlinux.us>
8 # Contributor: Christian Hesse <mail@eworm.de>
9 # Contributor: Eli Schwartz <eschwartz@archlinux.org>
11 pkgbase=vim
12 pkgname=('vim' 'gvim' 'vim-runtime')
13 pkgver=9.0.1506
14 _versiondir=90
15 pkgrel=1
16 pkgdesc='Vi Improved, a highly configurable, improved version of the vi text editor'
17 url='https://www.vim.org'
18 arch=('x86_64' 'x86_64_v3')
19 license=('custom:vim')
20 makedepends=('glibc' 'libgcrypt' 'gpm' 'python' 'ruby' 'libxt' 'gtk3' 'lua'
21              'gawk' 'tcl' 'zlib' 'libcanberra')
22 source=(https://github.com/vim/vim/archive/v${pkgver}/${pkgbase}-${pkgver}.tar.gz
23         vimrc
24         archlinux.vim
25         vimdoc.hook)
26 sha256sums=('86c1ff2c887de702c3fa8bd047c840062441ccd499621ff2fc478ac5cfadec46'
27             'b16e85e457397ab2043a7ee0a3c84307c6b4eac157fd0b721694761f25b3ed5b'
28             'cc3d931129854c298eb22e993ec14c2ad86cc1e70a08a64496f5e06559289972'
29             '8e9656934d9d7793063230d15a689e10455e6db9b9fe73afa0f294792795d8ae')
30 sha512sums=('0e08d1bb7f42146962a5540d13d85d7208f95b12abc7179f1a549ac0e5aae460a70c9994777453d416785685921a0986a5a28ff93f984981e6f39cf63020ddf1'
31             '4b5bed0813f22af9e158ea9aa56a4a9862dd786ba2d201f20159ccf652da6190164aaed0b6b7217d578f7b25c33a8adcc307bfcf3caa8d173a7ff29e2a00fee7'
32             'fe091d289d876f45319c898f6021ef86d6a238b540c225a279c46efc5c36fa7d868cd0cee73a111811c4be90df160f85340bb251be3a437727dbe5c699950363'
33             'a02ad0d66f300160911aeb81d8886c6c558436ac4ee3fcd161dd65c6b1e5d1f41b9005a7f5bb5ba68d57027fc1c8e43daabf055bd6207fb5a216a67f758df8d1')
35 prepare() {
36   (cd vim-${pkgver}/src
37     # define the place for the global (g)vimrc file (set to /etc/vimrc)
38     sed -E 's|^.*(#define SYS_.*VIMRC_FILE.*").*$|\1|g' -i feature.h
39     sed -E 's|^.*(#define VIMRC_FILE.*").*$|\1|g' -i feature.h
40     autoconf
41   )
42   cp -a vim-${pkgver} gvim-${pkgver}
45 build() {
46   echo "Building vim..."
47   (cd vim-${pkgver}
48     ./configure \
49       --prefix=/usr \
50       --localstatedir=/var/lib/vim \
51       --with-features=huge \
52       --with-compiledby='Arch Linux' \
53       --enable-gpm \
54       --enable-acl \
55       --with-x=no \
56       --disable-gui \
57       --enable-multibyte \
58       --enable-cscope \
59       --enable-netbeans \
60       --enable-perlinterp=dynamic \
61       --enable-python3interp=dynamic \
62       --enable-rubyinterp=dynamic \
63       --enable-luainterp=dynamic \
64       --enable-tclinterp=dynamic \
65       --disable-canberra
66     make
67   )
69   echo "Building gvim..."
70   (cd gvim-${pkgver}
71     ./configure \
72       --prefix=/usr \
73       --localstatedir=/var/lib/vim \
74       --with-features=huge \
75       --with-compiledby='Arch Linux' \
76       --enable-gpm \
77       --enable-acl \
78       --with-x=yes \
79       --enable-gui=gtk3 \
80       --enable-multibyte \
81       --enable-cscope \
82       --enable-netbeans \
83       --enable-perlinterp=dynamic \
84       --enable-python3interp=dynamic \
85       --enable-rubyinterp=dynamic \
86       --enable-luainterp=dynamic \
87       --enable-tclinterp=dynamic \
88       --enable-canberra
89     make
90   )
93 check() {
94   cd vim-${pkgver}
95   TERM=xterm make -j1 test
98 package_vim-runtime() {
99   pkgdesc+=' (shared runtime)'
100   optdepends=('sh: support for some tools and macros'
101               'python: demoserver example tool'
102               'gawk: mve tools upport')
103   backup=('etc/vimrc')
105   cd vim-${pkgver}
107   make -j1 VIMRCLOC=/etc DESTDIR="${pkgdir}" install
108   # man and bin files belong to 'vim'
109   rm -r "${pkgdir}"/usr/share/man/ "${pkgdir}"/usr/bin/
111   # Don't forget logtalk.dict
112   install -Dm 644 runtime/ftplugin/logtalk.dict \
113     "${pkgdir}"/usr/share/vim/vim${_versiondir}/ftplugin/logtalk.dict
115   # rc files
116   install -Dm 644 "${srcdir}"/vimrc "${pkgdir}"/etc/vimrc
117   install -Dm 644 "${srcdir}"/archlinux.vim \
118     "${pkgdir}"/usr/share/vim/vimfiles/archlinux.vim
120   # no desktop files and icons
121   rm -r "${pkgdir}"/usr/share/{applications,icons}
123   # license
124   install -dm 755 "${pkgdir}"/usr/share/licenses/vim-runtime
125   ln -s /usr/share/vim/vim${_versiondir}/doc/uganda.txt \
126     "${pkgdir}"/usr/share/licenses/vim-runtime/license.txt
128   # pacman hook for documentation helptags
129   install -Dm 644 "${srcdir}"/vimdoc.hook "${pkgdir}"/usr/share/libalpm/hooks/vimdoc.hook
132 package_vim() {
133   # TODO: move perl back into optdeps after --enable-perlinterp=dynamic
134   #       starts working again (https://github.com/vim/vim/issues/10512)
135   depends=("vim-runtime=${pkgver}-${pkgrel}" 'gpm' 'acl' 'glibc' 'libgcrypt' 'zlib' 'perl')
136   optdepends=('python: Python language support'
137               'ruby: Ruby language support'
138               'lua: Lua language support'
139               #'perl: Perl language support'
140               'tcl: Tcl language support')
141   conflicts=('gvim' 'vim-minimal')
142   provides=('xxd' 'vim-minimal' 'vim-plugin-runtime')
143   replaces=('vim-minimal')
145   cd vim-${pkgver}
146   make -j1 VIMRCLOC=/etc DESTDIR="${pkgdir}" install
148   # provided by (n)vi in core
149   rm "${pkgdir}"/usr/bin/{ex,view}
151   # delete some manpages
152   find "${pkgdir}"/usr/share/man -type d -name 'man1' 2>/dev/null | \
153     while read _mandir; do
154     cd "${_mandir}"
155     rm -f ex.1 view.1 # provided by (n)vi
156     rm -f evim.1    # this does not make sense if we have no GUI
157   done
159   # Runtime provided by runtime package
160   rm -r "${pkgdir}"/usr/share/vim
162   # remove gvim.desktop as not included
163   rm "${pkgdir}"/usr/share/applications/gvim.desktop
165   # license
166   install -Dm 644 runtime/doc/uganda.txt \
167     "${pkgdir}"/usr/share/licenses/${pkgname}/license.txt
170 package_gvim() {
171   pkgdesc+=' (with advanced features, such as a GUI)'
172   # TODO: move perl back into optdeps after --enable-perlinterp=dynamic
173   #       starts working again (https://github.com/vim/vim/issues/10512)
174   depends=("vim-runtime=${pkgver}-${pkgrel}" 'gpm' 'libxt' 'gtk3' 'glibc' 'libgcrypt'
175            'zlib' 'libcanberra' 'perl')
176   optdepends=('python: Python language support'
177               'ruby: Ruby language support'
178               'lua: Lua language support'
179               #'perl: Perl language support'
180               'tcl: Tcl language support')
181   provides=("vim=${pkgver}-${pkgrel}" "xxd" 'vim-plugin-runtime')
182   conflicts=('vim-minimal' 'vim')
184   cd gvim-${pkgver}
185   make -j1 VIMRCLOC=/etc DESTDIR="${pkgdir}" install
187   # provided by (n)vi in core
188   rm "${pkgdir}"/usr/bin/{ex,view}
190   # delete some manpages
191   find "${pkgdir}"/usr/share/man -type d -name 'man1' 2>/dev/null | \
192     while read _mandir; do
193     cd "${_mandir}"
194     rm -f ex.1 view.1 # provided by (n)vi
195   done
197   # need to remove since this is provided by vim-runtime
198   rm -r "${pkgdir}"/usr/share/vim
200   # license
201    install -Dm 644 runtime/doc/uganda.txt \
202     "${pkgdir}"/usr/share/licenses/${pkgname}/license.txt
205 # vim: ts=2 sw=2 et: