summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0ac4e5e713b1cf212bd44dd1a1be185e13bab233 (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
70
71
72
73
74
75
# Maintainer: Peter Mattern <pmattern at arcor dot de>

_pkgname=vim
pkgname="$_pkgname-minimal-git"
pkgver=8.0.0342
pkgrel=1
pkgdesc="Vim the editor. CLI version providing small subset of available features."
arch=("i686" "x86_64")
url="http://www.vim.org"
license=("custom:vim")
depends=("vim-runtime-git")
makedepends=("git")
provides=("vim-minimal" "xxd")
conflicts=("vim-git" "gvim-git"
           "vim-minimal" "vim" "vim-python3" "gvim" "gvim-python3")
source=("git+https://github.com/vim/vim.git")
sha256sums=("SKIP")

pkgver() {
    cd $_pkgname
    git describe --tags | sed 's/^v//;s/-/./g'
}

prepare() {

    # set global configuration file to /etc/vimrc
    sed -i 's|^.*\(#define SYS_VIMRC_FILE.*"\) .*$|\1|' $_pkgname/src/feature.h

}

build() {

    cd $_pkgname
    ./configure \
      --enable-fail-if-missing \
      --with-compiledby='Arch Linux AUR' \
      --prefix=/usr \
      --enable-gui=no \
      --with-features=tiny \
      --enable-perlinterp=no \
      --enable-pythoninterp=no \
      --enable-python3interp=no \
      --enable-rubyinterp=no \
      --enable-luainterp=no
    make

}

package() {

    # actual installation
    cd $_pkgname
    make DESTDIR=$pkgdir install

    # remove components provided by other packages

    # ex/view and man pages (normally provided by package 'vi' on Arch Linux) as
    # well as man evim (not needed in a package providing CLI tools only)
    cd $pkgdir/usr/bin ; rm ex view
    find $pkgdir/usr/share/man -type d -name 'man1' 2>/dev/null | \
      while read _mandir; do
        cd ${_mandir}
        rm -f ex.1 view.1
        rm -f evim.1
      done

    # components provided by vim-runtime-git
    cd $pkgdir
    rm -R usr/share/{icons,vim} usr/share/applications/gvim.desktop

    # add license
    install -D -m644 $srcdir/$_pkgname/runtime/doc/uganda.txt \
      $pkgdir/usr/share/licenses/$pkgname/LICENSE

}