name: mir-kiosk-kodi adopt-info: kodi summary: Kodi packaged as a Frame snap description: Kodi packaged as a Frame snap confinement: strict grade: stable base: core22 license: GPL-2.0 architectures: - build-on: amd64 - build-on: arm64 - build-on: armhf # - build-on: i386 environment: SHELL: bash LC_ALL: C.UTF-8 # XDG config XDG_CACHE_HOME: $SNAP_USER_COMMON/.cache XDG_CONFIG_HOME: $SNAP_USER_DATA/.config WINDOWING: wayland layout: /usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/kodi: bind: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/kodi /usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/pulseaudio: bind: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/pulseaudio /usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/samba: bind: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/samba /usr/share/kodi: bind: $SNAP/usr/share/kodi /usr/share/samba: bind: $SNAP/usr/share/samba /usr/share/X11/xkb: bind: $SNAP/usr/share/X11/xkb /usr/share/libdrm: bind: $SNAP/graphics/libdrm /usr/share/drirc.d: symlink: $SNAP/graphics/drirc.d plugs: graphics-core22: interface: content target: $SNAP/graphics default-provider: mesa-core22 apps: daemon: command-chain: - bin/graphics-core22-wrapper - bin/run-daemon - bin/wayland-launch - bin/run-kodi command: usr/bin/kodi daemon: simple restart-condition: always environment: # Prep PulseAudio PULSE_SYSTEM: 1 PULSE_RUNTIME_PATH: /var/run/pulse plugs: &plugs - alsa - audio-playback - avahi-observe - graphics-core22 - hardware-observe - locale-control - mount-observe - network-bind - network-observe - opengl - pulseaudio - removable-media - shutdown - system-observe - wayland mir-kiosk-kodi: command-chain: - bin/graphics-core22-wrapper - bin/wayland-launch - bin/run-kodi command: usr/bin/kodi desktop: usr/share/applications/kodi.desktop environment: # Prep PulseAudio PULSE_SERVER: unix:$XDG_RUNTIME_DIR/../pulse/native plugs: *plugs parts: glue: plugin: dump source: glue kodi: plugin: nil override-pull: | craftctl default kodi_version=`LANG=C apt-cache policy kodi | sed -rne 's/^\s+Candidate:\s+([^-]*)-.+$/\1/p'` craftctl set version=$kodi_version stage-packages: - kodi - kodi-data - kodi-inputstream-adaptive - kodi-inputstream-ffmpegdirect - kodi-repository-kodi - kodi-visualization-spectrum - python3 - samba-libs - samba-common-bin - samba-common - libblas3 - liblapack3 - libfstrcmp0 - libpulse0 organize: usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/blas/*: usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/ usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/lapack/*: usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/ setup: plugin: dump source: wayland-launch override-build: | PLUGS="opengl wayland graphics-core22 network-observe network-bind audio-playback" sed --in-place "s/%PLUGS%/$PLUGS/g" $CRAFT_PART_BUILD/bin/wayland-launch sed --in-place "s/%PLUGS%/$PLUGS/g" $CRAFT_PART_BUILD/bin/setup.sh craftctl default stage-packages: - inotify-tools graphics-core22: after: [kodi, setup] source: https://github.com/canonical/gpu-snap.git plugin: dump override-prime: | craftctl default ${CRAFT_PART_SRC}/bin/graphics-core22-cleanup mesa-core22 nvidia-core22 prime: - bin/graphics-core22-wrapper