summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f2fbd7b02afe2584f3c877160e76f15367610fac (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
# Maintainer: atomicfs <https://aur.archlinux.org/account/atomicfs>

pkgname=mdbook-template
pkgver=1.1.1+deprecated
_pkgver=1.1.1-deprecated
pkgrel=1
pkgdesc="A preprocessor for mdbook to use template files with dynamic arguments"
url="https://github.com/sgoudham/mdbook-template"
arch=('x86_64')
license=('MIT')
makedepends=(
  'cargo'
)
depends=(
  'mdbook'
)
source=("${url}/archive/v${pkgver}.tar.gz")
sha256sums=('bd3d4d04f9c8d6313204350660554617329f2226f20f3735cf87ba3aa284988e')

prepare() {
  cd "${pkgname}-${_pkgver}"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --target "$(rustc -vV | sed -n 's/host: //p')"
}

check() {
  cd "${pkgname}-${_pkgver}"
  export RUSTUP_TOOLCHAIN=stable
  cargo test --frozen --all-features
}

build() {
  cd "${pkgname}-${_pkgver}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release --all-features
}

package() {
  cd "${pkgname}-${_pkgver}"
  install -Dm 755 "target/release/${pkgname}" "${pkgdir}/usr/bin/${pkgname}"
}