summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2e8ba7d9100ad8b70024f74f9fab3d92399731c6 (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
# Maintainer: Sainnhe Park <sainnhe@gmail.com>
pkgbase=clap-git
pkgname=('vim-clap-git'
         'neovim-clap-git')
_pkgname=clap
pkgver=v0.19.r14.g91331ea
pkgrel=1
pkgdesc='Modern performant generic finder and dispatcher for Vim and NeoVim'
arch=('any')
url='https://github.com/liuchengxu/vim-clap'
license=('MIT')
source=("${_pkgname}::git+https://github.com/liuchengxu/vim-clap.git")
sha256sums=('SKIP')
makedepends=('git'
             'rustup'
             'make')

pkgver() {
    cd "${srcdir}/${_pkgname}"
    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
    cd "${srcdir}/${_pkgname}"
    make
}

package_vim-clap-git() {
    depends=('vim')
    optdepends=('python: for built-in fzy python implementation'
                'fzf: fzf external filter'
                'fzy: fzy external filter'
                'skim: skim external filter')
    provides=('vim-clap')
    conflicts=('vim-clap')
    _packdir="usr/share/vim/vimfiles/pack/${_pkgname}/start/${_pkgname}"
    _variant='vim'

    cd "${srcdir}/${_pkgname}"
    vim -es --cmd ":helptags doc" --cmd ":q"
    find autoload doc ftplugin plugin pythonx/clap/fuzzymatch_rs.so pythonx/clap/*.py syntax -type f -exec \
        install -Dm 644 '{}' "${pkgdir}/${_packdir}/{}" \;
    install -Dm 755 "${srcdir}/${_pkgname}/target/release/maple" \
        "${pkgdir}/${_packdir}/bin/maple"
    install -Dm 644 "${srcdir}/${_pkgname}/LICENSE" \
        "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}

package_neovim-clap-git() {
    depends=('neovim')
    optdepends=('python-pynvim: for built-in fzy python implementation'
                'fzf: fzf external filter'
                'fzy: fzy external filter'
                'skim: skim external filter')
    provides=('neovim-clap')
    conflicts=('neovim-clap')
    _packdir="usr/local/share/nvim/site/pack/${_pkgname}/start/${_pkgname}"
    _variant='neovim'

    cd "${srcdir}/${_pkgname}"
    nvim -es --cmd ":helptags doc" --cmd ":q"
    find autoload doc ftplugin plugin pythonx/clap/fuzzymatch_rs.so pythonx/clap/*.py syntax -type f -exec \
        install -Dm 644 '{}' "${pkgdir}/${_packdir}/{}" \;
    install -Dm 755 "${srcdir}/${_pkgname}/target/release/maple" \
        "${pkgdir}/${_packdir}/bin/maple"
    install -Dm 644 "${srcdir}/${_pkgname}/LICENSE" \
        "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}