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

pkgname=mdbook-pagetoc
pkgver=0.2.0
pkgrel=2
pkgdesc="A preprocessor for mdbook to render a table of contents for each page"
url="https://github.com/slowsage/mdbook-pagetoc"
arch=('x86_64')
license=('MPL-2.0')
makedepends=(
  'cargo'
)
depends=(
  'mdbook'
)
source=("${url}/archive/v${pkgver}.tar.gz")
sha256sums=('0101c3d8931345d43a17f02cb12cde86f7120fda51bcdd4137736b6361f6eabf')

prepare() {
  cd "${pkgname}-${pkgver}"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --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}"
}