summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 7e97a08ba8395169f7d5f4ce1d1941deda65c139 (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
# Maintainer: Luis Martinez <luis dot martinez at tuta dot io>

pkgbase=sniprun
pkgname=('sniprun' 'neovim-sniprun')
pkgver=0.5.8
pkgrel=1
pkgdesc='A neovim plugin to independently run snippets of code'
arch=('x86_64')
url="https://github.com/michaelb/sniprun"
license=('MIT')
makedepends=('cargo' 'gcc-libs')
source=("$pkgbase-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('94e66fffda73b39bf43e1fc9b5d5f7f05ae1934d09e06455fb2f52316ef27ade')

build() {
  cd "$pkgbase-$pkgver"
  cargo build --release --locked --all-features --target-dir=target
}

# check() {
#   cd "$pkgname-$pkgver"
#   cargo test --release --locked --target-dir=target
# }

package_sniprun() {
  pkgdesc='Compiled binary core for neovim-sniprun'
  depends=('gcc-libs')

  cd "$pkgbase-$pkgver"
  install -Dm 755 target/release/sniprun -t "$pkgdir/usr/bin/"
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
}

package_neovim-sniprun()  {
  arch=('any')
  depends=('neovim-git' "sniprun=$pkgver")
  optdepends=('bash: Bash snippets support'
              'coffeescript: CoffeeScript snippets support'
              'gcc: C/C++ snippets support'
              'gcc-ada: Limited Ada snippets support'
              'go: Go snippets support'
              'ghc: Haskell snippets support'
              'python3: Python3 snippets support'
              'java-environment-openjdk: Java snippets support'
              'julia: Julia snippets support'
              'jupyter: Jupyter support'
              'lua: Lua snippets support'
              'r: R snippets support'
              'ruby: Ruby snippets support'
              'rust: Rust snippets support'
              'scala: Scala snippets support')
  install="$pkgname.install"

  cd "$pkgbase-$pkgver"
  find autoload doc plugin lua \
    -type f -exec install -Dm 644 '{}' "$pkgdir/usr/share/nvim/runtime/{}" \;
  install -d "$pkgdir/usr/share/nvim/runtime/target/release"
  ln -s "/usr/bin/sniprun" "$pkgdir/usr/share/nvim/runtime/target/release/sniprun"
  install -d "$pkgdir/usr/share/licenses/"
  install -d "$pkgdir/usr/share/doc/"
  ln -s "/usr/share/licenses/sniprun/" "$pkgdir/usr/share/licenses/$pkgname"
  ln -s "/usr/share/doc/sniprun/" "$pkgdir/usr/share/doc/$pkgname"
}