Change flatpak build location

This commit is contained in:
aunetx 2021-10-13 00:19:42 +02:00
parent 77730bae29
commit 4e619fbc86
3 changed files with 92 additions and 14 deletions

12
.gitignore vendored
View File

@ -1,13 +1,5 @@
node_modules
.flatpak-builder
build
repo
generated-sources.json
flatpak
source
app
app-32.7z
deezer-*.exe
package-lock.json
package.json
app.7z
*.AppImage
package-lock.json

View File

@ -83,11 +83,11 @@ prepare_flatpak: prepare
build_flatpak: prepare_flatpak
# Build the flatpak image
cd flatpak && flatpak-builder --force-clean build dev.aunetx.deezer.yml
flatpak-builder --force-clean build dev.aunetx.deezer.yml
export_flatpak: prepare_flatpak
# Build the flatpak package and export it to the repo
cd flatpak && flatpak-builder --gpg-sign=5A7D3B06F15FB60238941027EB3A799E7EE716EB --repo=repo --force-clean build dev.aunetx.deezer.yml
flatpak-builder --gpg-sign=5A7D3B06F15FB60238941027EB3A799E7EE716EB --repo=repo --force-clean build dev.aunetx.deezer.yml
flatpak_bundle: build_flatpak
# Create a flatpak bundle
@ -95,7 +95,7 @@ flatpak_bundle: build_flatpak
install_flatpak: prepare_flatpak
# Build and install locally the flatpak image
cd flatpak && flatpak-builder --force-clean --user --install build dev.aunetx.deezer.yml
flatpak-builder --force-clean --user --install build dev.aunetx.deezer.yml
build_appimage: prepare
# Install required dependencies to pack them with AppImage
@ -107,4 +107,4 @@ run_flatpak:
flatpak run dev.aunetx.deezer
clean:
rm -rf app flatpak/{.flatpak-builder,build} node_modules source app-32.7z app.7z deezer-*.exe package-lock.json
rm -rf app flatpak node_modules source package-lock.json

86
dev.aunetx.deezer.yml Normal file
View File

@ -0,0 +1,86 @@
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.node14
command: run.sh
separate-locales: false
finish-args:
# Basic permissions
- --share=ipc
- --socket=x11
- --socket=pulseaudio
- --share=network
# Allow other instances to see lockfiles
- --env=TMPDIR=/var/tmp
# DBus permissions
- --talk-name=org.freedesktop.Notifications
- --own-name=org.mpris.MediaPlayer2.deezer
# 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/node14/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/node14
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 npm 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:
# Install dependencies
- npm install --offline
# Build the app; the `dist` script in package.json runs electron-builder
- |
. ../flatpak-node/electron-builder-arch-args.sh
npm run dist -- $ELECTRON_BUILDER_ARCH_ARGS --linux --dir
# Bundle app and dependencies
- cp -a dist/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