summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0cd81f4c3dd9640cef02f2887a4743ae00bac2a2 (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
50
51
52
53
# Maintainer: Damjan Georgievski <gdamjan@gmail.com>

pkgname=crosvm-git
pkgver=r5881.4a740f380
pkgrel=1
pkgdesc="The Chrome OS Virtual Machine Monitor"
url="https://chromium.googlesource.com/crosvm/crosvm"
depends=('gcc-libs' 'libcap' 'dtc')
makedepends=('rustup' 'rust-bindgen' 'wayland-protocols')
conflicts=('crosvm')
provides=('crosvm')
arch=('x86_64')
license=('custom:chromiumos')
source=("git+https://chromium.googlesource.com/crosvm/crosvm"
        "git+https://chromium.googlesource.com/chromiumos/third_party/tpm2"
        "git+https://chromium.googlesource.com/chromiumos/platform/minigbm"
        "git+https://chromium.googlesource.com/chromiumos/third_party/virglrenderer"
        "git+https://chromium.googlesource.com/chromiumos/platform/minijail"
        "git+https://chromium.googlesource.com/chromium/tools/depot_tools"
        "git+https://chromium.googlesource.com/chromiumos/third_party/rust-vmm/vhost"
        )
sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP')

prepare() {
  cd crosvm
  git submodule init
  git config submodule."tpm2-sys/libtpm2".url "$srcdir/tpm2"
  git config submodule."third_party/minigbm".url "$srcdir/minigbm"
  git config submodule."third_party/virglrenderer".url "$srcdir/virglrenderer"
  git config submodule."third_party/minijail".url "$srcdir/minijail"
  git config submodule."third_party/depot_tools".url "$srcdir/depot_tools"
  git config submodule."third_party/vmm_vhost".url "$srcdir/vhost"
  git -c protocol.file.allow=always submodule update
}

pkgver() {
  cd crosvm
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd crosvm
  cargo build --release
}

package() {
  cd crosvm
  install -Dm755 target/release/crosvm "$pkgdir/usr/bin/crosvm"
  install -d "$pkgdir/usr/share/policy/crosvm/"
  cp -r jail/seccomp/x86_64/* "$pkgdir/usr/share/policy/crosvm/"
  install -m644 -D LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
  install -m644 -D README.md "$pkgdir"/usr/share/licenses/$pkgname/README.md
}