summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 699438a22f19bb0419aecb7e49a8ec0936c6d39d (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
# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgbase=firecracker
pkgname=('firecracker' 'firecracker-docs')
pkgver=0.25.0
pkgrel=1
pkgdesc="Secure and fast microVMs for serverless computing"
arch=('x86_64')
url="https://firecracker-microvm.github.io"
license=('Apache')
makedepends=('rust' 'rust-musl' 'git')
source=("$pkgname-$pkgver.tar.gz::https://github.com/firecracker-microvm/firecracker/archive/v$pkgver.tar.gz")
b2sums=('6377b04844f3aae5cbd8dfb2abe6d23556887a6ff8b1d447b4d77214674c65a4330551c9300704576cfc9689ea609746d562cfe6df95548914ec3afd95910ccb')

_cargo_target="$CARCH-unknown-linux-musl"

prepare() {
  cd "$pkgbase-$pkgver"
  cargo fetch --locked --target="$_cargo_target"
}

build() {
  cd "$pkgbase-$pkgver"
  cargo build \
    --package firecracker \
    --package jailer \
    --release \
    --frozen \
    --all-features \
    --target-dir=target \
    --target="$_cargo_target"
}

package_firecracker() {
  find "$pkgbase-$pkgver/target/$_cargo_target/release" \
    -maxdepth 1 \
    -executable \
    -type f \
    -exec install -vDm0755 -t "$pkgdir/usr/bin/" {} +
}

package_firecracker-docs() {
  arch=('any')
  pkgdesc+=" (documentation)"
  cd "$pkgbase-$pkgver"
  install -vDm644 -t "$pkgdir/usr/share/doc/$pkgbase" *.md
  cp -vr docs "$pkgdir/usr/share/doc/$pkgbase"
}