snapcraft.yaml 3.4 KB
Newer Older
S
Simon Fels 已提交
1 2 3 4 5 6 7 8
name: anbox
version: 1
summary: Android in a Box
description: |
  Runtime for Android applications which runs a full Android system
  in a container using Linux namespaces (user, ipc, net, mount) to
  separate the Android system fully from the host.
confinement: devmode
9
grade: devel
S
Simon Fels 已提交
10 11

apps:
12
  anbox:
13
    command: bin/anbox-wrapper.sh
14
  container-manager:
15 16
    command: bin/container-manager.sh start
    stop-command: bin/container-manager.sh stop
S
Simon Fels 已提交
17
    daemon: simple
18 19 20 21 22 23
# FIXME: a oneshot unit with start/stop commands needs also RemainAfterExit=yes
# but this isn't supported by snapd yet. See LP #1647169 for details.
#  bridge:
#    command: bin/anbox-bridge.sh start
#    stop-command: bin/anbox-bridge.sh stop
#    daemon: oneshot
S
Simon Fels 已提交
24 25

parts:
26
  android:
27
    plugin: copy
28
    source: .
29
    files:
30 31
      system.img: system.img
      ramdisk.img: ramdisk.img
32 33 34
  kernel-modules:
    plugin: dump
    source: kernel
35
  anbox-common:
36
    plugin: copy
37
    source: .
38
    files:
39
      scripts/snap-wrapper.sh: bin/anbox-wrapper.sh
40
      scripts/container-manager.sh: bin/container-manager.sh
S
Simon Fels 已提交
41
      scripts/anbox-bridge.sh: bin/anbox-bridge.sh
42 43 44
      scripts/classic: bin/classic
      scripts/classic-create: bin/classic-create
      scripts/classic-reset: bin/classic-reset
45
    snap:
S
Simon Fels 已提交
46
      - bin/anbox-bridge.sh
47
      - bin/anbox-wrapper.sh
48
      - bin/container-manager.sh
49 50 51
      - bin/classic
      - bin/classic-create
      - bin/classic-reset
52 53 54 55
  apparmor:
    plugin: nil
    stage-packages:
      - apparmor
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
  lxc:
    source: git://github.com/morphis/lxc
    source-branch: snappy-support
    build-packages:
      - libapparmor-dev
      - libcap-dev
      - libgnutls28-dev
      - libseccomp-dev
      - pkg-config
    plugin: autotools
    configflags:
      - --disable-selinux
      - --disable-python
      - --disable-lua
      - --disable-tests
      - --disable-examples
      - --disable-doc
      - --disable-api-docs
      - --disable-bash
      - --disable-cgmanager
76
      # FIXME: Enable again once stacked AppArmor support has landed
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
      - --disable-apparmor
      - --disable-seccomp
      - --enable-capabilities
      - --with-rootfs-path=/var/snap/anbox/common/lxc/
    snap:
      - bin/lxc-attach
      - bin/lxc-ls
      - bin/lxc-start
      - bin/lxc-stop
      - lib/liblxc.so.1
      - lib/liblxc.so.1.2.0
      - libexec/lxc/lxc-monitord
  anbox:
    plugin: cmake
    after:
      - lxc
    source: .
    configflags:
      # FIXME: Anbox currently has some paths with hard coded prefixes. Once
      # that is fixed we can avoid using a prefix here.
      - -DCMAKE_INSTALL_PREFIX:PATH=/usr
      # FIXME: When building in release mode we get a lot of error which cause
      # the build to fail.
      - -DCMAKE_BUILD_TYPE=debug
    build-packages:
      - build-essential
      - cmake
      - cmake-data
      - debhelper
      - dbus
      - google-mock
      - libboost-dev
      - libboost-filesystem-dev
      - libboost-log-dev
      - libboost-iostreams-dev
      - libboost-program-options-dev
      - libboost-system-dev
      - libboost-thread-dev
      - libcap-dev
      - libdbus-1-dev
      - libdbus-cpp-dev
      - libegl1-mesa-dev
      - libgles2-mesa-dev
      - libglib2.0-dev
      - libgtest-dev
      - libprotobuf-dev
      - libsdl2-dev
      - pkg-config
      - protobuf-compiler
    stage-packages:
      - libegl1-mesa
      - libgles2-mesa
      - libgl1-mesa-glx
      - libsdl2-2.0-0
      - libsdl2-gfx-1.0-0
    snap:
      - usr/bin/anbox
      - usr/lib/*-linux-*/