summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 75d28084a69aea768137d05008e881ca4918e304 (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
# Maintainer: Sainnhe Park <sainnhe@gmail.com>
_packdir="usr/share/vim/vimfiles/pack/markdown-preview/start/markdown-preview"
pkgname="vim-markdown-preview-git"
url='https://github.com/iamcco/markdown-preview.nvim'
pkgdesc='markdown preview plugin for (neo)vim'
pkgver=r138.94101ef
pkgrel=1
provides=('vim-markdown-preview')
conflicts=('vim-markdown-preview')
arch=('any')
depends=('vim' 'nodejs')
makedepends=('yarn' 'git')
license=('unknown')
source=("git+${url}.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/markdown-preview.nvim"
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
    cd "${srcdir}/markdown-preview.nvim"
    cd app && yarn install --preferred-cache-folder "${srcdir}/.cache" && cd ..
    find app autoload plugin -type f -exec \
        install -Dm 644 '{}' "${pkgdir}/${_packdir}/{}" \;
    find "$pkgdir" -name package.json -print0 | xargs -r -0 sed -i '/_where/d'
    chown -R root:root "${pkgdir}"
}