summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: fc45a939c13fb80256ac86c4d622bda26e2102ba (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
pkgname=svd2rust-git
pkgdesc='Generate Rust register maps (structs) from SVD files'
pkgrel=1
pkgver=0.24.0.r2.g298f1f9
arch=(i686 x86_64)
provides=(${pkgname%-git})
conflicts=(${pkgname%-git})
url=https://github.com/rust-embedded/svd2rust
license=(Apache MIT)
makedepends=(rust)
source=(git+$url)
sha256sums=(SKIP)

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

build() {
  cd ${pkgname%-git}
  cargo build --release
}

package() {
  cd ${pkgname%-git}
  install -D -m755 target/release/${pkgname%-git} "$pkgdir/usr/bin/${pkgname%-git}"
}