deezer-linux/Makefile

111 lines
3.3 KiB
Makefile
Raw Permalink Normal View History

2021-10-09 20:26:33 +02:00
# Maintainer: Aurélien Hamy <aunetx@yandex.com>
2021-10-13 00:53:38 +02:00
APPNAME = dev.aunetx.deezer
BASE_URL = $(shell jq ".modules[0].sources[0].url" dev.aunetx.deezer.json)
SHA256 = $(shell jq ".modules[0].sources[0].sha256" dev.aunetx.deezer.json)
PKGVER = $(shell echo $(BASE_URL) | grep -Eo "([0-9]+\.[0-9]+\.[0-9]+)" | head -1)
2022-02-01 00:05:16 +01:00
VERSION_REGEX = ^v$(PKGVER)-[0-9]{1,}$$
2021-10-09 20:26:33 +02:00
2021-10-10 11:57:39 +02:00
2021-10-09 20:26:33 +02:00
install_build_deps:
2022-02-01 00:05:16 +01:00
@npm install --engine-strict asar
@npm install prettier@2.8.8
2022-02-01 00:05:16 +01:00
prepare: clean install_build_deps
@mkdir -p source
@echo "Download installer"
@wget -nv $(BASE_URL) -O source/deezer-setup-$(PKGVER).exe
2024-06-22 17:39:49 +02:00
@echo "Verify installer"
@echo "$(SHA256) source/deezer-setup-$(PKGVER).exe" | sha256sum -c --status || exit 1
2022-02-01 00:05:16 +01:00
@echo "Extract app archive from installer"
@cd source && 7z x -so deezer-setup-$(PKGVER).exe '$$PLUGINSDIR/app-32.7z' > app-32.7z
@echo "Extract app from app archive"
@cd source && 7z x -y -bsp0 -bso0 app-32.7z
@echo "Extract app sources from the app"
@node_modules/asar/bin/asar.js extract source/resources/app.asar app
@echo "Prettier the sources to patch successfully"
@node_modules/prettier/bin-prettier.js --write "app/build/*.js"
@echo "Apply patches from ./patches, default ones:"
@echo "Hide to tray when closing (https://github.com/SibrenVasse/deezer/issues/4)"
@echo "Start in tray cli option (https://github.com/SibrenVasse/deezer/pull/12)"
@echo "Remove kernel version from User-Agent (https://github.com/aunetx/deezer-linux/pull/9)"
2022-05-02 20:40:06 +02:00
@echo "Avoid to set the text/html mime type (https://github.com/aunetx/deezer-linux/issues/13)"
@echo "Add a better management of MPRIS (https://github.com/aunetx/deezer-linux/pull/61)"
2021-10-13 00:14:07 +02:00
$(foreach p, $(wildcard ./patches/*), patch -p1 -dapp < $(p);)
2021-10-09 20:26:33 +02:00
2022-02-01 00:05:16 +01:00
@echo "Append `package-append.json` to the `package.json` of the app"
@echo "Adds electron, elecron-builder dependencies, and build directives"
@head -n -1 app/package.json > tmp.txt && mv tmp.txt app/package.json
@cat package-append.json | tee -a app/package.json
2021-10-09 20:26:33 +02:00
@echo "Download new packages"
@npm i
2021-10-13 20:19:59 +02:00
2021-11-15 19:38:57 +01:00
#! PACKAGES
2021-10-13 20:19:59 +02:00
install_deps: prepare
2022-02-01 00:05:16 +01:00
@echo "Install yarn dependencies to pack them later"
@yarn --cwd=app install
2021-10-13 20:19:59 +02:00
2023-06-22 18:01:25 +02:00
build_tar.xz_x64:
@echo "Build tar.xz archive"
@yarn --cwd=app run build-tar.xz-x64
build_deb_x64:
2022-02-01 00:05:16 +01:00
@echo "Build deb package"
@yarn --cwd=app run build-deb-x64
2021-10-13 20:19:59 +02:00
build_rpm_x64:
2022-02-01 00:05:16 +01:00
@echo "Build rpm package"
@yarn --cwd=app run build-rpm-x64
2021-11-15 17:14:41 +01:00
build_appimage_x64:
2022-02-01 00:05:16 +01:00
@echo "Build AppImage binary"
@yarn --cwd=app run build-appimage-x64
2021-11-15 17:14:41 +01:00
2022-02-01 00:05:16 +01:00
build_tar.xz_arm64:
2023-06-22 14:22:09 +02:00
@echo "Build tar.xz archive"
@yarn --cwd=app run build-tar.xz-arm64
build_deb_arm64:
@echo "Build deb package"
@yarn --cwd=app run build-deb-arm64
2023-06-22 14:22:09 +02:00
build_rpm_arm64:
@echo "Build rpm package"
@yarn --cwd=app run build-rpm-arm64
build_appimage_arm64:
@echo "Build AppImage binary"
@yarn --cwd=app run build-appimage-arm64
2023-06-22 14:22:09 +02:00
2022-02-01 00:05:16 +01:00
#! UTILS
prepare-release:
@echo $(DEEZER_RELEASE) | egrep "$(VERSION_REGEX)" > /dev/null || \
(echo "$(DEEZER_RELEASE) is not a correct release version of v$(PKGVER)" && false)
@desktop-file-validate $(APPNAME).desktop || \
(echo "Desktop file validation failed" && false)
release: prepare-release
@echo "Updating to $(DEEZER_RELEASE)..."
git tag -s $(DEEZER_RELEASE) -m ""
git push origin $(DEEZER_RELEASE)
git push
2021-10-13 22:58:10 +02:00
2021-10-09 20:26:33 +02:00
clean:
2022-02-01 00:05:16 +01:00
@rm -rf app flatpak node_modules source artifacts package-lock.json package.json