From 2cb5be87cb750dc4711ec89116dd7d0cfad4a8ac Mon Sep 17 00:00:00 2001 From: josselinonduty Date: Wed, 21 May 2025 15:36:38 +0900 Subject: [PATCH] feat: add build targets for snap; update snap artifact; update README. Fix #113 --- .github/workflows/build-artifacts.yml | 8 +++++- README.md | 32 ++++++++++++++++++------ package-append.json | 35 ++++++++++++++++++++++++++- 3 files changed, 65 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index eaad276..b6b2f0b 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -25,6 +25,8 @@ jobs: run: make build_rpm_x64 - name: build_appimage_x64 run: make build_appimage_x64 + - name: build_snap_x64 + run: make build_snap_x64 - name: build_tar.xz_x64 run: make build_tar.xz_x64 @@ -34,6 +36,8 @@ jobs: run: make build_rpm_arm64 - name: build_appimage_arm64 run: make build_appimage_arm64 + - name: build_snap_arm64 + run: make build_snap_arm64 - name: build_tar.xz_arm64 run: make build_tar.xz_arm64 @@ -41,7 +45,7 @@ jobs: run: echo "version=${GITHUB_REF/refs\/tags\//}" >> "$GITHUB_ENV" - name: Generate sha256 - run: echo "$(sha256sum artifacts/{x64,arm64}/*.{deb,rpm,AppImage,tar.xz})" > sha256 + run: echo "$(sha256sum artifacts/{x64,arm64}/*.{deb,rpm,AppImage,snap,tar.xz})" > sha256 - name: create release uses: softprops/action-gh-release@v2 @@ -53,9 +57,11 @@ jobs: artifacts/x64/*.deb artifacts/x64/*.rpm artifacts/x64/*.AppImage + artifacts/x64/*.snap artifacts/x64/*.tar.xz artifacts/arm64/*.deb artifacts/arm64/*.rpm artifacts/arm64/*.AppImage + artifacts/arm64/*.snap artifacts/arm64/*.tar.xz sha256 diff --git a/README.md b/README.md index f203c20..9c7ca17 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ It packages the app in a number of formats: - Flatpak, [available on flathub](https://flathub.org/apps/dev.aunetx.deezer) - AppImage +- Snapcraft - `rpm` (Fedora, Red Hat, CentOS, openSUSE, ...) - `deb` (Debian, Ubuntu, Pop!\_OS, elementary OS, ...) - `tar.xz` to install anywhere else @@ -59,16 +60,16 @@ Other packages can be installed from you package manager, either by clicking on | deb | ⚠️ | ✅ | | rpm | ⚠️ | ✅ | | tar.xz | ⚠️ | ✅ | -| snap | ⛔ | ⛔ | +| snap | ⚠️ | ✅ | -✅ Available ; ⚠️ Not tested ; ❌ Not available ; ⛔ Not planned (see [FAQ](#faq)) +✅ Available ; ⚠️ Not tested ; ❌ Not available ; ⛔ Not planned > [!NOTE] -> Please open an issue if you want a specific target to be added. +> Please open an issue if you want a specific target to be tested or added. ### Requirements -- Node.js (20 recommended) +- Node.js (22+ recommended) - npm (or yarn, see [FAQ](#i-want-to-use-yarn-instead-of-npm-is-it-possible)) - 7z (try installing `p7zip` and `p7zip-full`) - make @@ -132,6 +133,25 @@ Artifacts will be generated in `artifacts/{arch}`. If you generate the `tar.xz` package, you can run it directly by extracting to a directory, and calling `./deezer-desktop` from there. +### snap + +To build the `snap` package, you can use: + +```sh +make build_snap_{arch} +``` + +Then, you can install the package using: + +```sh +sudo snap install ./artifacts/{arch}/deezer-desktop-{version}-{arch}.snap --dangerous --classic +``` + +> [!NOTE] +> Snap packages require classic mode because of electron. +> Because of this, it is not able to use your usual browser. +> It will launch a clean instance of the browser, without extensions, settings, history, etc. + ## Development If you want to contribute to this project, please read the [contribution guidelines](CONTRIBUTING.md) file. @@ -142,10 +162,6 @@ If you want to contribute to this project, please read the [contribution guideli Deezer can be used on Linux through the web interface, but it does not allow downloading songs for offline listening. This project allows you to use the official Deezer app on Linux, with the same features as on Windows (plus some Linux-specific features). -### Why can't I get the snap package? - -Please see [this issue](https://github.com/babluboy/bookworm/issues/178) or [this issue](https://github.com/babluboy/nutty/issues/68). Prefer using Flatpak or AppImage. - ### Why are the patches published but not the app's source code? patches? The source code of the Deezer app is not open-source. Reverse-engineering the app would be illegal and would violate the Deezer EULA. This project is a port of the official Windows app, and does not contain any reverse-engineered code, rather it bundles the official Windows app with a compatibility layer. diff --git a/package-append.json b/package-append.json index caff523..1162fc0 100644 --- a/package-append.json +++ b/package-append.json @@ -61,7 +61,40 @@ "artifactName": "${productName}-${version}-${arch}.${ext}" }, "snap": { - "artifactName": "${productName}_${version}_${arch}.${ext}" + "artifactName": "${productName}_${version}_${arch}.${ext}", + "base": "core22", + "grade": "stable", + "confinement": "classic", + "after": ["desktop-gtk4", "libnotify-bin"], + "slots": [ + { + "mpris": { + "name": "deezer" + }, + "desktop": { + "name": "deezer" + } + } + ], + "plugs": [ + "desktop", + "desktop-legacy", + "wayland", + "x11", + "unity7", + "alsa", + "avahi-observe", + "browser-support", + "camera", + "cups-control", + "gsettings", + "home", + "network", + "opengl", + "audio-playback", + "screen-inhibit-control", + "upower-observe" + ] }, "deb": { "artifactName": "${productName}_${version}_${arch}.${ext}"