summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f3041401d6fd088c454c35de97ccdc17e1de63f2 (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
# Maintainer: Christian Hesse <mail@eworm.de>

pkgname=vis-git
pkgver=0.7.1.r31.g73401a3
pkgrel=1
pkgdesc='modern, legacy free, simple yet efficient vim-like editor - git checkout'
arch=('i686' 'x86_64')
url='https://github.com/martanne/vis#vis-a-vim-like-text-editor'
depends=('acl' 'libacl.so' 'bash' 'ncurses' 'libncursesw.so' 'libtermkey'
         'libtermkey.so' 'lua' 'lua-lpeg' 'tre' 'file')
optdepends=('wl-clipboard: wayland clipboard support'
            'xclip: X11 clipboard support'
            'xsel: X11 clipboard support')
makedepends=('git')
checkdepends=('vim')
conflicts=('vis')
provides=('vis')
license=('custom:ISC')
backup=('etc/vis/visrc.lua')
source=('git+https://github.com/martanne/vis.git'
        'git+https://github.com/martanne/vis-test.git')
sha256sums=('SKIP'
            'SKIP')

prepare() {
  cd vis/

  git config --file=.gitmodules submodule.test.url ../vis-test/
  git update-index --assume-unchanged .gitmodules
  git submodule init
  git -c protocol.file.allow=always submodule update
}

pkgver() {
	cd vis/

	if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
		printf '%s.r%s.g%s' \
			"$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG})" \
			"$(git rev-list --count ${GITTAG}..)" \
			"$(git rev-parse --short HEAD)"
	else
		printf '0.r%s.g%s' \
			"$(git rev-list --count master)" \
			"$(git rev-parse --short HEAD)"
	fi
}

build() {
  cd vis/

  ./configure \
    --prefix=/usr

  make
}

check() {
  cd vis/

  make -C test/
}

package() {
  cd vis/

  make DESTDIR="${pkgdir}" install

  install -D -m0644 lua/visrc.lua "${pkgdir}"/etc/vis/visrc.lua

  install -D -m0644 'LICENSE' "${pkgdir}/usr/share/licenses/vis/LICENSE"
}