0
0
mirror of https://github.com/cucumber-sp/yandex-music-linux.git synced 2024-12-23 22:22:59 +03:00

Update packages script

This commit is contained in:
Andrey Onishchenko 2024-01-30 16:19:10 +03:00
parent ceb7c569e1
commit 59c446c8f7
4 changed files with 93 additions and 15 deletions

37
PKGBUILD Normal file
View File

@ -0,0 +1,37 @@
# Maintainer: Andrey Onischenko loraner123@gmail.com
pkgname=yandexmusic
pkgver="5.0.8"
pkgrel="1"
pkgdesc="Yandex Music Client"
arch=("any")
url="https://github.com/cucumber-sp/yandex-music-linux"
license=("custom")
depends=("electron" "libpulse")
makedepends=("p7zip" "nodejs" "jq")
source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.8.exe")
sha256sums=("78b4e1acb61becbbddeb6f48e9d2b55ed7d718cd99c205b89a94f7c3af9df803")
prepare() {
npm install @electron/asar;
}
build() {
sh "$srcdir/repack.sh" "Yandex_Music_x64_5.0.8.exe"
}
package() {
mkdir -p "$pkgdir/usr/lib/yandexmusic"
mkdir -p "$pkgdir/usr/share/applications"
mkdir -p "$pkgdir/usr/bin"
install -Dm644 "$srcdir/out/yandexmusic.asar" "$pkgdir/usr/lib/yandexmusic/yandexmusic.asar"
install -Dm644 "$srcdir/out/yandexmusic.desktop" "$pkgdir/usr/share/applications/yandexmusic.desktop"
install -Dm644 "$srcdir/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Create a script to launch the app with Electron
echo "#!/bin/sh" > "$pkgdir/usr/bin/yandexmusic"
echo "electron /usr/lib/yandexmusic/yandexmusic.asar" >> "$pkgdir/usr/bin/yandexmusic"
chmod 755 "$pkgdir/usr/bin/yandexmusic"
}

41
generate_packages.sh Normal file
View File

@ -0,0 +1,41 @@
#!/bin/bash
rm -rf ./tmp
mkdir ./tmp
# loading json from file https://music-desktop-application.s3.yandex.net/stable/download.json
curl -s https://music-desktop-application.s3.yandex.net/stable/download.json > ./tmp/download.json
exe_link=$(jq -r '.windows' ./tmp/download.json)
version=$(echo $exe_link | grep -oP '(?<=x64_).*(?=.exe)')
exe_name=$(basename $exe_link)
echo "Windows url: $exe_link"
echo "Version: $version"
echo "Exe name: $exe_name"
curl $exe_link > ./tmp/$exe_name
exe_sha256=$(sha256sum ./tmp/$exe_name | awk '{print $1}')
echo "Exe sha256: $exe_sha256"
rm -rf ./version_info.json
echo "{
\"version\": \"$version\",
\"exe_name\": \"$exe_name\",
\"exe_link\": \"$exe_link\",
\"exe_sha256\": \"$exe_sha256\"
}" > ./version_info.json
rm -rf ./PKGBUILD
cp ./templates/PKGBUILD ./PKGBUILD
sed -i "s#%version%#$version#g" ./PKGBUILD
sed -i "s#%release%#1#g" ./PKGBUILD
sed -i "s#%exe_name%#$exe_name#g" ./PKGBUILD
sed -i "s#%exe_link%#$exe_link#g" ./PKGBUILD
sed -i "s#%exe_sha256%#$exe_sha256#g" ./PKGBUILD
rm -rf ./tmp

View File

@ -1,8 +1,8 @@
# Maintainer: Andrey Onischenko loraner123@gmail.com
pkgname=yandexmusic-bin
pkgver=VERSION
pkgrel=RELEASE_NUMBER
pkgname=yandexmusic
pkgver="%version%"
pkgrel="%release%"
pkgdesc="Yandex Music Client"
arch=("any")
url="https://github.com/cucumber-sp/yandex-music-linux"
@ -10,31 +10,25 @@ license=("custom")
depends=("electron" "libpulse")
makedepends=("p7zip" "nodejs" "jq")
source=("https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_$pkgver.exe" "https://github.com/cucumber-sp/yandex-music-linux/archive/v$pkgver-$pkgrel.tar.gz")
sha256sums=("EXE_HASH" "SOURCE_HASH")
source=("%exe_link%")
sha256sums=("%exe_sha256%")
prepare() {
npm install @electron/asar;
}
build() {
arch_dir="yandex-music-linux-$pkgver-$pkgrel"
mv "$srcdir/Yandex_Music_x64_$pkgver.exe" "$srcdir/$arch_dir"
cd "$srcdir/$arch_dir"
sh "./repack.sh" "Yandex_Music_x64_$pkgver.exe"
sh "$srcdir/repack.sh" "%exe_name%"
}
package() {
arch_dir="yandex-music-linux-$pkgver-$pkgrel"
mkdir -p "$pkgdir/usr/lib/yandexmusic"
mkdir -p "$pkgdir/usr/share/applications"
mkdir -p "$pkgdir/usr/bin"
install -Dm644 "$srcdir/$arch_dir/out/yandexmusic.asar" "$pkgdir/usr/lib/yandexmusic/yandexmusic.asar"
install -Dm644 "$srcdir/$arch_dir/out/yandexmusic.desktop" "$pkgdir/usr/share/applications/yandexmusic.desktop"
install -Dm644 "$srcdir/$arch_dir/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
rm -rf "$srcdir/$arch_dir"
install -Dm644 "$srcdir/out/yandexmusic.asar" "$pkgdir/usr/lib/yandexmusic/yandexmusic.asar"
install -Dm644 "$srcdir/out/yandexmusic.desktop" "$pkgdir/usr/share/applications/yandexmusic.desktop"
install -Dm644 "$srcdir/LICENSE.md" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# Create a script to launch the app with Electron
echo "#!/bin/sh" > "$pkgdir/usr/bin/yandexmusic"

6
version_info.json Normal file
View File

@ -0,0 +1,6 @@
{
"version": "5.0.8",
"exe_name": "Yandex_Music_x64_5.0.8.exe",
"exe_link": "https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.8.exe",
"exe_sha256": "78b4e1acb61becbbddeb6f48e9d2b55ed7d718cd99c205b89a94f7c3af9df803"
}