deezer-linux/dev.aunetx.deezer.yml

95 lines
2.9 KiB
YAML

app-id: dev.aunetx.deezer
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
base: org.electronjs.Electron2.BaseApp
base-version: '21.08'
sdk-extensions:
- org.freedesktop.Sdk.Extension.node16
command: run.sh
separate-locales: false
finish-args:
# Basic permissions
- --share=ipc
- --socket=x11
- --socket=wayland
- --socket=pulseaudio
- --share=network
# Allow other instances to see lockfiles
- --env=TMPDIR=/var/tmp
# DBus permissions
- --talk-name=org.freedesktop.Notifications
- --talk-name=org.gnome.SettingsDaemon
- --talk-name=org.gnome.SessionManager
- --own-name=org.mpris.MediaPlayer2.chromium.*
# Fs access: music/downloads to send mp3, pictures to change profile picture
- --filesystem=xdg-music:ro
- --filesystem=xdg-pictures
- --filesystem=xdg-download:ro
build-options:
append-path: /usr/lib/sdk/node16/bin
cflags: -O2 -g
cxxflags: -O2 -g
env:
NPM_CONFIG_LOGLEVEL: info
modules:
- name: deezer
buildsystem: simple
build-options:
env:
XDG_CACHE_HOME: /run/build/deezer/flatpak-node/cache
npm_config_cache: /run/build/deezer/flatpak-node/npm-cache
npm_config_nodedir: /usr/lib/sdk/node16
npm_config_offline: 'true'
subdir: main
sources:
# The deezer electron source
- type: dir
path: app
dest: main
# The extra resources
- type: dir
path: extra
dest: extra
# The application datas
- type: file
path: dev.aunetx.deezer.appdata.xml
dest: main
- type: file
path: dev.aunetx.deezer.svg
dest: main
- type: file
path: dev.aunetx.deezer.desktop
dest: main
# The yarn generated sources
- flatpak/generated-sources.json
# Wrapper to launch the app
- type: script
dest-filename: run.sh
commands:
- zypak-wrapper /app/main/deezer-desktop "$@"
build-commands:
# Have Yarn use the offline mirror.
- 'HOME=$PWD yarn config --offline set yarn-offline-mirror $FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn-mirror'
# Install dependencies
- yarn --offline
# Build the app; the `dist` script in package.json runs electron-builder
- |
. ../flatpak-node/electron-builder-arch-args.sh
yarn run --offline prepare-flatpak -- $ELECTRON_BUILDER_ARCH_ARGS
# Bundle app and dependencies
- |
. ../flatpak-node/electron-builder-arch-args.sh
cp -a ../artifacts/${ELECTRON_BUILDER_ARCH_ARGS:2}/linux*unpacked /app/main
# Install app wrapper
- install -Dm755 -t /app/bin/ ../run.sh
# Install app datas
- install -Dm644 dev.aunetx.deezer.appdata.xml /app/share/appdata/dev.aunetx.deezer.appdata.xml
- install -Dm644 dev.aunetx.deezer.svg /app/share/icons/hicolor/scalable/apps/dev.aunetx.deezer.svg
- install -Dm644 dev.aunetx.deezer.desktop /app/share/applications/dev.aunetx.deezer.desktop