summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 186e1e07dd813fed79bdcc030fbb56d75c0403ce (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
# Maintainer: KokaKiwi <kokakiwi+aur at kokakiwi dot net>

pkgname=autokernel-git
pkgver=2.0.1.r2.gee75705
pkgrel=1
pkgdesc='A tool for managing your kernel configuration that guarantees semantic correctness'
url='https://github.com/oddlama/autokernel'
license=('MIT')
arch=('x86_64' 'i686' 'arm' 'aarch64')
depends=('gcc-libs' 'sqlite')
makedepends=('git' 'cargo')
source=("$pkgname::git+https://github.com/oddlama/autokernel.git")
sha256sums=('SKIP')
b2sums=('SKIP')

case $CARCH in
  x86_64|i686|aarch64)
    _target="$CARCH-unknown-linux-gnu" ;;
  arm)
    _target="arm-unknown-linux-gnueabi" ;;
esac

pkgver() {
  cd "$pkgname"

  git describe --long --tags --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$pkgname"

  cargo fetch --locked --target $_target
}

build() {
  cd "$pkgname"

  CARGO_TARGET_DIR='target' \
    cargo build --frozen --release --features 'index'
}

package() {
  cd "$pkgname"

  install -Dm0755 -t "$pkgdir/usr/bin" \
    target/release/autokernel{,-index}

  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}