mirror of
https://github.com/aunetx/deezer-linux.git
synced 2025-07-22 21:24:41 +02:00
Fix #1, add comments
This commit is contained in:
parent
d5fdcc4b0c
commit
1b007615f9
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,9 +4,9 @@ build
|
|||||||
/dist
|
/dist
|
||||||
source
|
source
|
||||||
app
|
app
|
||||||
|
extra
|
||||||
app-32.7z
|
app-32.7z
|
||||||
deezer-*.exe
|
deezer-*.exe
|
||||||
package-lock.json
|
package-lock.json
|
||||||
package.json
|
package.json
|
||||||
app.7z
|
app.7z
|
||||||
systray.png
|
|
45
Makefile
45
Makefile
@ -5,7 +5,7 @@ PKGVER = 5.30.0
|
|||||||
BASE_URL = https://www.deezer.com/desktop/download/artifact/win32/x86/$(PKGVER)
|
BASE_URL = https://www.deezer.com/desktop/download/artifact/win32/x86/$(PKGVER)
|
||||||
EXE_NAME = $(PKGNAME)-$(PKGVER)-setup.exe
|
EXE_NAME = $(PKGNAME)-$(PKGVER)-setup.exe
|
||||||
|
|
||||||
json_add = '},\
|
pkg_json_append = '},\
|
||||||
"scripts": {\
|
"scripts": {\
|
||||||
"dist": "electron-builder",\
|
"dist": "electron-builder",\
|
||||||
"start": "electron ."\
|
"start": "electron ."\
|
||||||
@ -20,7 +20,16 @@ json_add = '},\
|
|||||||
],\
|
],\
|
||||||
"directories": {\
|
"directories": {\
|
||||||
"buildResources": "build"\
|
"buildResources": "build"\
|
||||||
|
},\
|
||||||
|
"extraResources": [\
|
||||||
|
{\
|
||||||
|
"from": "../extra/",\
|
||||||
|
"to": ".",\
|
||||||
|
"filter": [\
|
||||||
|
"**"\
|
||||||
|
]\
|
||||||
}\
|
}\
|
||||||
|
]\
|
||||||
}\
|
}\
|
||||||
}'
|
}'
|
||||||
|
|
||||||
@ -31,35 +40,47 @@ install_build_deps:
|
|||||||
|
|
||||||
|
|
||||||
prepare: install_build_deps
|
prepare: install_build_deps
|
||||||
wget -c $(BASE_URL) -O $(EXE_NAME)
|
mkdir -p source
|
||||||
# Extract app from installer
|
# Download installer
|
||||||
7z x -so $(EXE_NAME) '$$PLUGINSDIR/app-32.7z' > app-32.7z
|
wget -c $(BASE_URL) -O source/$(EXE_NAME)
|
||||||
# Extract app archive
|
# Extract app archive from installer
|
||||||
7z x -y -bsp0 -bso0 app-32.7z -osource
|
cd source && 7z x -so $(EXE_NAME) '$$PLUGINSDIR/app-32.7z' > app-32.7z
|
||||||
|
# Extract app from app archive
|
||||||
|
cd source && 7z x -y -bsp0 -bso0 app-32.7z
|
||||||
|
# Extract app sources from the app
|
||||||
asar extract source/resources/app.asar app
|
asar extract source/resources/app.asar app
|
||||||
|
|
||||||
cp source/resources/win/systray.png .
|
# Add extra resources to be used at runtime
|
||||||
|
mkdir -p extra/linux
|
||||||
|
cp source/resources/win/systray.png extra/linux/
|
||||||
|
|
||||||
|
# Prettier the sources to patch successfully
|
||||||
prettier --write "app/build/*.js"
|
prettier --write "app/build/*.js"
|
||||||
# Hide to tray (https://github.com/SibrenVasse/deezer/issues/4)
|
# Patch hide to tray (https://github.com/SibrenVasse/deezer/issues/4)
|
||||||
patch -p1 -dapp < quit.patch
|
patch -p1 -dapp < quit.patch
|
||||||
# Add start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)
|
# Add start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)
|
||||||
patch -p1 -dapp < start-hidden-in-tray.patch
|
patch -p1 -dapp < start-hidden-in-tray.patch
|
||||||
|
|
||||||
|
# Append `pkg_json_append` to the `package.json` of the app
|
||||||
|
# Adds electron, elecron-builder dependencies, and build directives
|
||||||
head -n -2 app/package.json > tmp.txt && mv tmp.txt app/package.json
|
head -n -2 app/package.json > tmp.txt && mv tmp.txt app/package.json
|
||||||
echo $(json_add) | tee -a app/package.json
|
echo $(pkg_json_append) | tee -a app/package.json
|
||||||
|
|
||||||
|
|
||||||
build_flatpak: prepare
|
build_flatpak: prepare
|
||||||
|
# Generate npm sources (without installing them)
|
||||||
npm i --prefix=app --package-lock-only
|
npm i --prefix=app --package-lock-only
|
||||||
|
# Package the sources to use them in flatpak-builder offline
|
||||||
./flatpak-node-generator.py npm app/package-lock.json -o flatpak/generated-sources.json --electron-node-headers --xdg-layout
|
./flatpak-node-generator.py npm app/package-lock.json -o flatpak/generated-sources.json --electron-node-headers --xdg-layout
|
||||||
|
|
||||||
|
# Build the Flatpak app
|
||||||
cd flatpak && flatpak-builder build dev.aunetx.deezer.yml --install --force-clean --user
|
cd flatpak && flatpak-builder build dev.aunetx.deezer.yml --install --force-clean --user
|
||||||
|
|
||||||
|
|
||||||
build_appimage: prepare
|
build_appimage: prepare
|
||||||
npm install --prefix=app
|
# Install required dependencies to pack them with AppImage
|
||||||
|
npm i --prefix=app
|
||||||
|
# Build the AppImage package
|
||||||
npm run dist --prefix=app
|
npm run dist --prefix=app
|
||||||
|
|
||||||
|
|
||||||
@ -68,4 +89,4 @@ run_flatpak:
|
|||||||
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf app flatpak/{.flatpak-builder,build} node_modules source app-32.7z app.7z deezer-*.exe package-lock.json systray.png
|
rm -rf app extra flatpak/{.flatpak-builder,build} node_modules source app-32.7z app.7z deezer-*.exe package-lock.json
|
Loading…
x
Reference in New Issue
Block a user