diff --git a/.gitignore b/.gitignore index ccebb8b..33dd123 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules flatpak source app -package-lock.json \ No newline at end of file +package-lock.json +artifacts \ No newline at end of file diff --git a/Makefile b/Makefile index d7bacfa..bd5b76c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # Maintainer: Aurélien Hamy APPNAME = dev.aunetx.deezer -PKGVER = 5.30.0 +PKGVER = 5.30.80 BASE_URL = https://www.deezer.com/desktop/download/artifact/win32/x86/$(PKGVER) GPG_KEY_ID = 5A7D3B06F15FB60238941027EB3A799E7EE716EB @@ -34,6 +34,8 @@ prepare: install_build_deps head -n -1 app/package.json > tmp.txt && mv tmp.txt app/package.json cat package-append.json | tee -a app/package.json + +#! FLATPAK prepare_flatpak: prepare # Generate npm sources (without installing them) npm i --prefix=app --package-lock-only @@ -57,14 +59,34 @@ install_flatpak: prepare_flatpak # Build and install locally the flatpak image flatpak-builder --force-clean --state-dir=flatpak/flatpak-builder --user --install flatpak/build $(APPNAME).yml -build_appimage: prepare - # Install required dependencies to pack them with AppImage - npm i --prefix=app - # Build the AppImage package - npm run dist --prefix=app - run_flatpak: flatpak run $(APPNAME) + +#! APPIMAGE +install_deps: prepare + # Install npm dependencies to pack them later + npm i --prefix=app + +build_appimage: install_deps + # Build the AppImage package + npm run build-appimage --prefix=app + + +#! PKGS +build_pkgs: install_deps + # Build everything + npm run build --prefix=app + + +build_pkgs_arm64: install_deps + # Build everything + npm run build-arm --prefix=app + +build_pkgs_x86: install_deps + # Build everything + npm run build-x86 --prefix=app + + clean: - rm -rf app flatpak node_modules source package-lock.json \ No newline at end of file + rm -rf app flatpak node_modules source artifacts package-lock.json \ No newline at end of file diff --git a/dev.aunetx.deezer.yml b/dev.aunetx.deezer.yml index e1f13be..42b4daa 100644 --- a/dev.aunetx.deezer.yml +++ b/dev.aunetx.deezer.yml @@ -18,7 +18,7 @@ finish-args: - --env=TMPDIR=/var/tmp # DBus permissions - --talk-name=org.freedesktop.Notifications - - --own-name=org.mpris.MediaPlayer2.deezer + - --own-name=org.mpris.MediaPlayer2.deezer-desktop # Fs access: music/downloads to send mp3, pictures to change profile picture - --filesystem=xdg-music:ro - --filesystem=xdg-pictures @@ -72,7 +72,7 @@ modules: # 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 + npm run prepare-flatpak -- $ELECTRON_BUILDER_ARCH_ARGS # Bundle app and dependencies - cp -a dist/linux*unpacked /app/main diff --git a/package-append.json b/package-append.json index 788f474..1948811 100644 --- a/package-append.json +++ b/package-append.json @@ -1,6 +1,31 @@ ,"scripts": { - "dist": "electron-builder", - "start": "electron ." + "copy-resources": "mkdir -p resources/linux && cp ../extra/linux/* ./resources/linux", + "start": "npm copy-resources && electron .", + "prepare-flatpak": "electron-builder --linux --dir", + + "build": "electron-builder --x64 --linux deb rpm snap AppImage 7z tar.gz zip", + "build-deb": "electron-builder --x64 --linux deb", + "build-rpm": "electron-builder --x64 --linux rpm", + "build-snap": "electron-builder --x64 --linux snap", + "build-appimage": "electron-builder --x64 --linux AppImage", + "build-7z": "electron-builder --x64 --linux 7z", + "build-tar.gz": "electron-builder --x64 --linux tar.gz", + "build-zip": "electron-builder --x64 --linux zip", + + "build-arm": "electron-builder --arm64 --linux deb rpm snap AppImage 7z tar.gz zip", + "build-deb-arm": "electron-builder --arm64 --linux deb", + "build-rpm-arm": "electron-builder --arm64 --linux rpm", + "build-snap-arm": "electron-builder --arm64 --linux snap", + "build-appimage-arm": "electron-builder --arm64 --linux AppImage", + "build-7z-arm": "electron-builder --arm64 --linux 7z", + "build-tar.gz-arm": "electron-builder --arm64 --linux tar.gz", + "build-zip-arm": "electron-builder --arm64 --linux zip", + + "build-x86": "electron-builder --ia32 --linux deb", + "build-deb-x86": "electron-builder --ia32 --linux deb", + "build-7z-x86": "electron-builder --ia32 --linux 7z", + "build-tar.gz-x86": "electron-builder --ia32 --linux tar.gz", + "build-zip-x86": "electron-builder --ia32 --linux zip" }, "devDependencies": { "electron": "^13.5.1", @@ -11,7 +36,8 @@ "**" ], "directories": { - "buildResources": "build" + "buildResources": "build", + "output": "../artifacts/${arch}" }, "extraResources": [ { @@ -31,7 +57,17 @@ "Comment": "Listen and download all your favorite music", "MimeType": "x-scheme-handler/deezer;", "Keywords": "Music;Player;Streaming;Online;" - } + }, + "artifactName": "${productName}-${version}-${arch}.${ext}" + }, + "snap": { + "artifactName": "${productName}_${version}_${arch}.${ext}" + }, + "deb": { + "artifactName": "${productName}_${version}_${arch}.${ext}" + }, + "rpm": { + "artifactName": "${productName}-${version}.${arch}.${ext}" } } } \ No newline at end of file