snapcraft.yaml 3.5 KB
Newer Older
S
Simon Fels 已提交
1
name: anbox
2 3 4 5
# NOTE: Always only use increasing numeric values here. This is
# passed down into cmake and assigned to an integer variable which
# can be used for version number comparision inside the code base
# to accomondate for any breaking changes.
S
Simon Fels 已提交
6
version: 2
S
Simon Fels 已提交
7 8 9 10 11 12
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
13
grade: devel
S
Simon Fels 已提交
14 15

apps:
16
  anbox:
17
    command: bin/anbox-wrapper.sh
18
  container-manager:
19 20
    command: bin/container-manager.sh start
    stop-command: bin/container-manager.sh stop
S
Simon Fels 已提交
21
    daemon: simple
S
Simon Fels 已提交
22 23

parts:
24
  android-images:
25
    plugin: dump
26 27
    build-packages:
      - wget
28 29 30
    install: |
      # FIXME: downloading with a source: field doesn't work as snapcraft
      # expects the downloaded file to be an archive it can extract.
31
      wget http://build.anbox.io/android-images/2017/04/12/android_1_amd64.img
32 33 34
      mv android_1_amd64.img $SNAPCRAFT_PART_INSTALL/android.img
    prime:
      - android.img
35
  anbox-common:
36
    plugin: dump
37
    source: scripts
38 39 40 41 42
    organize:
      snap-wrapper.sh: bin/anbox-wrapper.sh
      container-manager.sh: bin/container-manager.sh
      anbox-bridge.sh: bin/anbox-bridge.sh
    prime:
S
Simon Fels 已提交
43
      - bin/anbox-bridge.sh
44
      - bin/anbox-wrapper.sh
45
      - bin/container-manager.sh
46 47 48 49
  apparmor:
    plugin: nil
    stage-packages:
      - apparmor
50
  lxc:
51 52 53
    source: https://github.com/lxc/lxc
    source-type: git
    source-tag: lxc-2.0.7
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
    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
      - --disable-apparmor
      - --disable-seccomp
      - --enable-capabilities
      - --with-rootfs-path=/var/snap/anbox/common/lxc/
75 76 77
      - --libexecdir=/snap/anbox/current/libexec/
    organize:
      snap/anbox/current/libexec: libexec
78
    prime:
79 80 81 82 83 84 85
      - lib/liblxc.so.1
      - lib/liblxc.so.1.2.0
      - libexec/lxc/lxc-monitord
  anbox:
    plugin: cmake
    after:
      - lxc
86
    source: .
87 88 89 90
    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
91
      - -DVERSION=$SNAPCRAFT_PROJECT_VERSION
92 93 94 95
    build-packages:
      - build-essential
      - cmake
      - cmake-data
96
      - cmake-extras
97 98 99 100 101 102 103 104 105
      - debhelper
      - dbus
      - google-mock
      - libboost-dev
      - libboost-filesystem-dev
      - libboost-log-dev
      - libboost-iostreams-dev
      - libboost-program-options-dev
      - libboost-system-dev
106
      - libboost-test-dev
107 108 109 110 111 112 113
      - libboost-thread-dev
      - libcap-dev
      - libdbus-1-dev
      - libdbus-cpp-dev
      - libegl1-mesa-dev
      - libgles2-mesa-dev
      - libglib2.0-dev
S
Simon Fels 已提交
114
      - libglm-dev
115 116
      - libgtest-dev
      - libprotobuf-dev
S
Simon Fels 已提交
117
      - libproperties-cpp-dev
118
      - libsdl2-dev
119
      - libsdl2-image-dev
120 121 122 123 124 125 126 127
      - pkg-config
      - protobuf-compiler
    stage-packages:
      - libegl1-mesa
      - libgles2-mesa
      - libgl1-mesa-glx
      - libsdl2-2.0-0
      - libsdl2-gfx-1.0-0
128 129
    install: |
      make test
130
    prime:
131
      - usr/bin/anbox
132
      - usr/share/anbox
133
      - usr/lib/*-linux-*/