deezer-desktop: init at 7.1.100#488329
Conversation
|
|
RossSmyth
left a comment
There was a problem hiding this comment.
Hello, I am someone working on Electron packaging within Nixpkgs. I have some PRs open for automating some of this. But basically:
- Most of your buildInputs can be removed
- Just write something like
cp resources{,.pak} "$out/share/deezer-desktop" - Then have Nixpkgs Electron call it. Something like:
makeWrapper "${lib.getExe electron}" "$out/bin/deezer-desktop" \
--inherit-argv0 \
--add-flag "$out/share/deezer-desktop/resources/app.asar" \
--set-default ELECTRON_FORCE_IS_PACKAGED 1then still copy the desktop file and icons as appropriate.
This means that your application will receive Electron security patches when the occur, not just whenever this package updates. It is then likely you won't need most or all your buildInputs.
ad2a2d2 to
75561aa
Compare
Hi @RossSmyth , Good idea thank you for the suggestion. I did the modifications you proposed, it simplifies a lot, but I have now a problem when the application is starting. The official Electron cannot load the ❯ deezer-desktop
13:47:27.399 › Init App
(node:138859) UnhandledPromiseRejectionWarning: Error: Failed to load image from path '/nix/store/6ppl38w30hiygnhzkxagm6yrw9jdl15x-electron-unwrapped-38.7.2/libexec/electron/resources/linux/systray.png'
at TrayService.init (/nix/store/ffxw5dysivcsw0y18fysxl255rkjyjdq-deezer-desktop-7.1.70/share/deezer-desktop/resources/app.asar/build/main.js:2246:25)
at Object.<anonymous> (/nix/store/ffxw5dysivcsw0y18fysxl255rkjyjdq-deezer-desktop-7.1.70/share/deezer-desktop/resources/app.asar/build/main.js:2934:25)
at Generator.next (<anonymous>)
at fulfilled (/nix/store/ffxw5dysivcsw0y18fysxl255rkjyjdq-deezer-desktop-7.1.70/share/deezer-desktop/resources/app.asar/build/main.js:2836:26)
(Use `electron --trace-warnings ...` to show where the warning was created)
(node:138859) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
^CDo you have ideas to solve that ? Due to the Deezer license, we are not really allowed to modify the app.asar... I drafted this PR until we resolve this. |
|
Try removing |
|
Same error... |
|
is it exactly the same, or are the paths different? |
|
You may be able to mess with argv0 to get it to work, another option is unpacking the asar and patching the Something like: function getAppIcon(app) {
let appIcon = "";
switch (getPlatformName()) {
case PLATFORM.WINDOWS:
appIcon = "win/systray.png";
break;
case PLATFORM.DARWIN:
appIcon = "mac/trayTemplate.png";
break;
case PLATFORM.LINUX:
appIcon = "linux/systray.png";
}
return external_path_default().join(
isDev(app)
? external_path_default().join(app.getAppPath(), "resources")
: process.resourcesPath,
appIcon
);
}-> function getAppIcon(app) {
let appIcon = "";
switch (getPlatformName()) {
case PLATFORM.WINDOWS:
appIcon = "win/systray.png";
break;
case PLATFORM.DARWIN:
appIcon = "mac/trayTemplate.png";
break;
case PLATFORM.LINUX:
appIcon = "linux/systray.png";
}
return "$out/path/to/icon"
);
} |
75561aa to
88937ec
Compare
|
I opened a PR aunetx/deezer-linux#215 to implement properly a patch ! I will keep updated the feedbacks here. |
|
I would just vendor the patch and apply it after unpacking the asar. But having a PR open is good too. |
|
Yes I managed to repair the build using this but Deezer is unfree so I think that it is better to add a patch where there are patches instead of taking the responsibility of opening ourself the asar on Nixpkgs |
|
Hi, The upstream PR has been accepted and merged. The next Deezer release will be published within 1 or 2 weeks. Then the deezer-linux project will be released with my patch. Thank you for your suggestions ! |
|
Hi @RossSmyth @SuperSandro2000 , The PR is now ready for rereview with your suggested changes applied. Thanks again for the feedbacks :) |
|
|
Successfully created backport PR for |
This is an UNOFFICIAL linux port (legal notice) of the official windows-only Deezer app. Being based on the native Windows app, it allows downloading your songs to listen to them offline!
https://github.com/aunetx/deezer-linux
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.