summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b02b124d6379dfd575486a4b40107d8fcbf87d18 (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
# Maintainer: Christopher Arndt <aur -at- chrisarndt -dot- de>
# Contributor: Andy Weidenbaum <archbaum@gmail.com>

pkgname=c2nim
pkgver=0.9.19
pkgrel=1
pkgdesc="A tool to translate Ansi C code to Nim"
arch=(i686 x86_64)
depends=(glibc)
optdepends=('nim: to compile generated Nim code')
makedepends=(git nim nimble)
groups=(nim)
url="https://github.com/nim-lang/c2nim"
license=(MIT)
source=("$pkgname-$pkgver.tar.gz::https://github.com/nim-lang/c2nim/archive/refs/tags/$pkgver.tar.gz")
sha256sums=('f63f99e684d62722b912c6bcf470d7ae7d32a92f6f11c356325ba2a1d916b90d')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  echo 'Building...'
  nimble build -y
  # nim rst2html is currently broken:
  # https://github.com/nim-lang/Nim/issues/14424
  # nimble docs
}

check()  {
  cd "$srcdir/$pkgname-$pkgver"

  echo 'Running tests...'
  nimble test
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  echo 'Installing documentation...'
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 doc/c2nim.rst -t "$pkgdir/usr/share/doc/$pkgname/doc"

  echo 'Installing license...'
  install -Dm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname"

  echo 'Installing binary...'
  install -Dm 755 c2nim -t "$pkgdir/usr/bin"
}