diff --git a/.github/workflows/build.sh b/.github/workflows/build.sh index 146cd20..4064f77 100755 --- a/.github/workflows/build.sh +++ b/.github/workflows/build.sh @@ -29,7 +29,7 @@ case $OS in mkdir dist mv *.pkg.tar.zst dist - mv ./src/app/yandexmusic.asar dist/yandexmusic.asar + mv ./src/app/yandex-music.asar dist/yandex-music.asar mv ./src/app/release_notes.json dist/release_notes.json sh ./build_deb.sh -a all diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2782a5f..878b770 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,8 +64,8 @@ jobs: - uses: DeterminateSystems/magic-nix-cache-action@v2 - - name: Build yandexmusic - run: nix build --impure .#yandexmusic - - name: Build yandexmusic without flakes binaries - run: nix build --impure .#yandexmusic-noflakes + - name: Build yandex-music + run: nix build --impure .#yandex-music + - name: Build yandex-music without flakes binaries + run: nix build --impure .#yandex-music-noflakes diff --git a/.github/workflows/update-build-release.yml b/.github/workflows/update-build-release.yml index 35cd9fe..1947fa5 100644 --- a/.github/workflows/update-build-release.yml +++ b/.github/workflows/update-build-release.yml @@ -41,7 +41,7 @@ jobs: - name: Publish AUR package uses: KSXGitHub/github-actions-deploy-aur@v2.7.0 with: - pkgname: "yandexmusic" + pkgname: "yandex-music" pkgbuild: "PKGBUILD" updpkgsums: false allow_empty_commits: false diff --git a/PKGBUILD b/PKGBUILD index a9b53eb..31af4e4 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com -pkgname=yandexmusic +pkgname=yandex-music pkgver="5.0.10" pkgrel="1" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" @@ -18,17 +18,17 @@ build() { } package() { - mkdir -p "$pkgdir/usr/lib/yandexmusic" + mkdir -p "$pkgdir/usr/lib/yandex-music" mkdir -p "$pkgdir/usr/share/applications" mkdir -p "$pkgdir/usr/bin" - install -Dm644 "$srcdir/app/yandexmusic.asar" "$pkgdir/usr/lib/yandexmusic/yandexmusic.asar" - install -Dm644 "$srcdir/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandexmusic.png" - install -Dm644 "$srcdir/yandex-music-linux/templates/desktop" "$pkgdir/usr/share/applications/yandexmusic.desktop" + install -Dm644 "$srcdir/app/yandex-music.asar" "$pkgdir/usr/lib/yandex-music/yandex-music.asar" + install -Dm644 "$srcdir/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandex-music.png" + install -Dm644 "$srcdir/yandex-music-linux/templates/desktop" "$pkgdir/usr/share/applications/yandex-music.desktop" install -Dm644 "$srcdir/yandex-music-linux/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 'exec electron /usr/lib/yandexmusic/yandexmusic.asar "$@"' >> "$pkgdir/usr/bin/yandexmusic" - chmod 755 "$pkgdir/usr/bin/yandexmusic" + echo "#!/bin/sh" > "$pkgdir/usr/bin/yandex-music" + echo 'exec electron /usr/lib/yandex-music/yandex-music.asar "$@"' >> "$pkgdir/usr/bin/yandex-music" + chmod 755 "$pkgdir/usr/bin/yandex-music" } diff --git a/README.md b/README.md index e93f6c3..5ede817 100644 --- a/README.md +++ b/README.md @@ -32,12 +32,12 @@ Native YandexMusic client for Linux. Built using repacking of Windows client (El #### AUR -You can obtain the latest version of package from `AUR` using one of the [AUR Helpers](https://wiki.archlinux.org/title/AUR_helpers). Then install it with `yandexmusic` as package name. +You can obtain the latest version of package from `AUR` using one of the [AUR Helpers](https://wiki.archlinux.org/title/AUR_helpers). Then install it with `yandex-music` as package name. For this example I will use [yay](https://github.com/Jguer/yay) ``` -yay -S yandexmusic +yay -S yandex-music ``` #### Binary package file @@ -47,7 +47,7 @@ Download prebuilt binary package from [Releases](https://github.com/cucumber-sp/ Then you can install it with the following command ``` -pacman -U yandexmusic--any.pkg.tar.zst +pacman -U yandex-music--any.pkg.tar.zst ``` *** @@ -67,7 +67,7 @@ Download prebuilt binary package from [Releases](https://github.com/cucumber-sp/ Then you can install it with the following command ``` -dpkg -i yandexmusic__.deb +dpkg -i yandex-music__.deb ``` *** @@ -139,7 +139,7 @@ sh build_deb.sh [-a default=x64] ## Run with nix -The `yandexmusic` package has unlicensed license, so you need to have +The `yandex-music` package has unlicensed license, so you need to have `allowUnfree` option enabled. ### Run with flakes @@ -152,7 +152,7 @@ nix run github:cucumber-sp/yandex-music-linux ### Run old style -Execute next in this repository to build yandexmusic package without using +Execute next in this repository to build yandex-music package without using flakes. ``` @@ -162,4 +162,4 @@ nix-build --expr '(import {}).callPackage ./nix {}' ### Install to NixOS This flake exports `modules` list. Append it to your system modules and add -`yandexmusic` package to `environment.systemPackages`. +`yandex-music` package to `environment.systemPackages`. diff --git a/build_deb.sh b/build_deb.sh index f0d8084..ad15f06 100755 --- a/build_deb.sh +++ b/build_deb.sh @@ -100,84 +100,84 @@ mkdir -p "deb" #bulding packages if [ $x64 -eq 1 ]; then echo "Building x64 package" - pkgdir="$TEMPDIR/yandexmusic-x64" + pkgdir="$TEMPDIR/yandex-music-x64" mkdir -p "$pkgdir/DEBIAN" cp "./templates/control" "$pkgdir/DEBIAN/control" sed -i "s/%version%/$version/g" "$pkgdir/DEBIAN/control" sed -i "s/%arch%/amd64/g" "$pkgdir/DEBIAN/control" - mkdir -p "$pkgdir/usr/lib/yandexmusic" + mkdir -p "$pkgdir/usr/lib/yandex-music" mkdir -p "$pkgdir/usr/share/applications" - mkdir -p "$pkgdir/usr/share/licenses/yandexmusic" + mkdir -p "$pkgdir/usr/share/licenses/yandex-music" mkdir -p "$pkgdir/usr/share/pixmaps" mkdir -p "$pkgdir/usr/bin" - install -Dm644 "$TEMPDIR/app/yandexmusic.asar" "$pkgdir/usr/lib/yandexmusic/yandexmusic.asar" - install -Dm644 "$TEMPDIR/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandexmusic.png" - install -Dm644 "./templates/desktop" "$pkgdir/usr/share/applications/yandexmusic.desktop" - install -Dm644 "./LICENSE.md" "$pkgdir/usr/share/licenses/yandexmusic/LICENSE" - mv "$TEMPDIR/electron-x64/" "$pkgdir/usr/lib/yandexmusic/electron" + install -Dm644 "$TEMPDIR/app/yandex-music.asar" "$pkgdir/usr/lib/yandex-music/yandex-music.asar" + install -Dm644 "$TEMPDIR/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandex-music.png" + install -Dm644 "./templates/desktop" "$pkgdir/usr/share/applications/yandex-music.desktop" + install -Dm644 "./LICENSE.md" "$pkgdir/usr/share/licenses/yandex-music/LICENSE" + mv "$TEMPDIR/electron-x64/" "$pkgdir/usr/lib/yandex-music/electron" - echo "#!/bin/sh" > "$pkgdir/usr/bin/yandexmusic" - echo 'exec /usr/lib/yandexmusic/electron/electron /usr/lib/yandexmusic/yandexmusic.asar "$@"' >> "$pkgdir/usr/bin/yandexmusic" - chmod 755 "$pkgdir/usr/bin/yandexmusic" + echo "#!/bin/sh" > "$pkgdir/usr/bin/yandex-music" + echo 'exec /usr/lib/yandex-music/electron/electron /usr/lib/yandex-music/yandex-music.asar "$@"' >> "$pkgdir/usr/bin/yandex-music" + chmod 755 "$pkgdir/usr/bin/yandex-music" - dpkg-deb --build "$pkgdir" "deb/yandexmusic_${version}_amd64.deb" + dpkg-deb --build "$pkgdir" "deb/yandex-music_${version}_amd64.deb" fi if [ $armv7l -eq 1 ]; then echo "Building armv7l package" - pkgdir="$TEMPDIR/yandexmusic-armv7l" + pkgdir="$TEMPDIR/yandex-music-armv7l" mkdir -p "$pkgdir/DEBIAN" cp "./templates/control" "$pkgdir/DEBIAN/control" sed -i "s/%version%/$version/g" "$pkgdir/DEBIAN/control" sed -i "s/%arch%/armhf/g" "$pkgdir/DEBIAN/control" - mkdir -p "$pkgdir/usr/lib/yandexmusic" + mkdir -p "$pkgdir/usr/lib/yandex-music" mkdir -p "$pkgdir/usr/share/applications" - mkdir -p "$pkgdir/usr/share/licenses/yandexmusic" + mkdir -p "$pkgdir/usr/share/licenses/yandex-music" mkdir -p "$pkgdir/usr/share/pixmaps" mkdir -p "$pkgdir/usr/bin" - install -Dm644 "$TEMPDIR/app/yandexmusic.asar" "$pkgdir/usr/lib/yandexmusic/yandexmusic.asar" - install -Dm644 "$TEMPDIR/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandexmusic.png" - install -Dm644 "./templates/desktop" "$pkgdir/usr/share/applications/yandexmusic.desktop" - install -Dm644 "./LICENSE.md" "$pkgdir/usr/share/licenses/yandexmusic/LICENSE" - mv "$TEMPDIR/electron-armv7l/" "$pkgdir/usr/lib/yandexmusic/electron" + install -Dm644 "$TEMPDIR/app/yandex-music.asar" "$pkgdir/usr/lib/yandex-music/yandex-music.asar" + install -Dm644 "$TEMPDIR/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandex-music.png" + install -Dm644 "./templates/desktop" "$pkgdir/usr/share/applications/yandex-music.desktop" + install -Dm644 "./LICENSE.md" "$pkgdir/usr/share/licenses/yandex-music/LICENSE" + mv "$TEMPDIR/electron-armv7l/" "$pkgdir/usr/lib/yandex-music/electron" - echo "#!/bin/sh" > "$pkgdir/usr/bin/yandexmusic" - echo 'exec /usr/lib/yandexmusic/electron/electron /usr/lib/yandexmusic/yandexmusic.asar "$@"' >> "$pkgdir/usr/bin/yandexmusic" - chmod 755 "$pkgdir/usr/bin/yandexmusic" + echo "#!/bin/sh" > "$pkgdir/usr/bin/yandex-music" + echo 'exec /usr/lib/yandex-music/electron/electron /usr/lib/yandex-music/yandex-music.asar "$@"' >> "$pkgdir/usr/bin/yandex-music" + chmod 755 "$pkgdir/usr/bin/yandex-music" - dpkg-deb --build "$pkgdir" "deb/yandexmusic_${version}_armhf.deb" + dpkg-deb --build "$pkgdir" "deb/yandex-music_${version}_armhf.deb" fi if [ $arm64 -eq 1 ]; then echo "Building arm64 package" - pkgdir="$TEMPDIR/yandexmusic-arm64" + pkgdir="$TEMPDIR/yandex-music-arm64" mkdir -p "$pkgdir/DEBIAN" cp "./templates/control" "$pkgdir/DEBIAN/control" sed -i "s/%version%/$version/g" "$pkgdir/DEBIAN/control" sed -i "s/%arch%/arm64/g" "$pkgdir/DEBIAN/control" - mkdir -p "$pkgdir/usr/lib/yandexmusic" + mkdir -p "$pkgdir/usr/lib/yandex-music" mkdir -p "$pkgdir/usr/share/applications" - mkdir -p "$pkgdir/usr/share/licenses/yandexmusic" + mkdir -p "$pkgdir/usr/share/licenses/yandex-music" mkdir -p "$pkgdir/usr/share/pixmaps" mkdir -p "$pkgdir/usr/bin" - install -Dm644 "$TEMPDIR/app/yandexmusic.asar" "$pkgdir/usr/lib/yandexmusic/yandexmusic.asar" - install -Dm644 "$TEMPDIR/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandexmusic.png" - install -Dm644 "./templates/desktop" "$pkgdir/usr/share/applications/yandexmusic.desktop" - install -Dm644 "./LICENSE.md" "$pkgdir/usr/share/licenses/yandexmusic/LICENSE" - mv "$TEMPDIR/electron-arm64/" "$pkgdir/usr/lib/yandexmusic/electron" + install -Dm644 "$TEMPDIR/app/yandex-music.asar" "$pkgdir/usr/lib/yandex-music/yandex-music.asar" + install -Dm644 "$TEMPDIR/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandex-music.png" + install -Dm644 "./templates/desktop" "$pkgdir/usr/share/applications/yandex-music.desktop" + install -Dm644 "./LICENSE.md" "$pkgdir/usr/share/licenses/yandex-music/LICENSE" + mv "$TEMPDIR/electron-arm64/" "$pkgdir/usr/lib/yandex-music/electron" - echo "#!/bin/sh" > "$pkgdir/usr/bin/yandexmusic" - echo 'exec /usr/lib/yandexmusic/electron/electron /usr/lib/yandexmusic/yandexmusic.asar "$@"' >> "$pkgdir/usr/bin/yandexmusic" - chmod 755 "$pkgdir/usr/bin/yandexmusic" + echo "#!/bin/sh" > "$pkgdir/usr/bin/yandex-music" + echo 'exec /usr/lib/yandex-music/electron/electron /usr/lib/yandex-music/yandex-music.asar "$@"' >> "$pkgdir/usr/bin/yandex-music" + chmod 755 "$pkgdir/usr/bin/yandex-music" - dpkg-deb --build "$pkgdir" "deb/yandexmusic_${version}_arm64.deb" + dpkg-deb --build "$pkgdir" "deb/yandex-music_${version}_arm64.deb" fi \ No newline at end of file diff --git a/flake.nix b/flake.nix index 543bec8..8a54351 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ }; outputs = { self, ymExe, nixpkgs, flake-utils }: let - yandexmusic-with = pkgs: pkgs.callPackage ./nix { + yandex-music-with = pkgs: pkgs.callPackage ./nix { inherit ymExe; }; in @@ -17,17 +17,17 @@ in { packages = rec { - yandexmusic = yandexmusic-with pkgs; - yandexmusic-noflakes = pkgs.callPackage ./nix {}; + yandex-music = yandex-music-with pkgs; + yandex-music-noflakes = pkgs.callPackage ./nix {}; generate_packages = pkgs.callPackage ./nix/generate_packages.nix {}; - default = yandexmusic; + default = yandex-music; }; } ) // { modules = [{ nixpkgs.overlays = [ (final: prev: { - yandexmusic = yandexmusic-with prev; + yandex-music = yandex-music-with prev; }) ]; }]; diff --git a/nix/default.nix b/nix/default.nix index 1e8c17f..9f10944 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -16,7 +16,7 @@ let in stdenvNoCC.mkDerivation { - name = "yandexmusic"; + name = "yandex-music"; inherit (version_info) version; nativeBuildInputs = [ @@ -50,19 +50,19 @@ stdenvNoCC.mkDerivation installPhase = '' mkdir -p "$out/share/nodejs" - mv app/yandexmusic.asar "$out/share/nodejs" + mv app/yandex-music.asar "$out/share/nodejs" # use makeWrapper on electron binary to make it call our asar package - makeWrapper "${electron}/bin/electron" "$out/bin/yandexmusic" \ - --add-flags "$out/share/nodejs/yandexmusic.asar" + makeWrapper "${electron}/bin/electron" "$out/bin/yandex-music" \ + --add-flags "$out/share/nodejs/yandex-music.asar" mkdir -p "$out/share/pixmaps" mkdir -p "$out/share/icons/hicolor/48x48/apps/" - cp ./app/favicon.png "$out/share/icons/hicolor/48x48/apps/yandexmusic.png" - ln -s ../icons/hicolor/48x48/apps/yandexmusic.png "$out/share/pixmaps" + cp ./app/favicon.png "$out/share/icons/hicolor/48x48/apps/yandex-music.png" + ln -s ../icons/hicolor/48x48/apps/yandex-music.png "$out/share/pixmaps" mkdir -p $out/share/applications - cp $desktopItem $out/share/applications/yandexmusic.desktop + cp $desktopItem $out/share/applications/yandex-music.desktop ''; meta = { diff --git a/patches/0001-Add-package-licence.patch b/patches/0001-Add-package-licence.patch index 7a4c3a5..7aaeaf5 100644 --- a/patches/0001-Add-package-licence.patch +++ b/patches/0001-Add-package-licence.patch @@ -4,7 +4,7 @@ diff --git a/package.json b/package.json @@ -39,5 +39,6 @@ "COPYRIGHT": "Яндекс Музыка", "TRADEMARK": "Яндекс Музыка", - "DEEPLINK_PROTOCOL": "yandexmusic" + "DEEPLINK_PROTOCOL": "yandex-music" - } + }, + "license": "UNLICENSED" diff --git a/patches/0002-Add-package-icon.patch b/patches/0002-Add-package-icon.patch index e464f38..ecf1b2d 100644 --- a/patches/0002-Add-package-icon.patch +++ b/patches/0002-Add-package-icon.patch @@ -3,7 +3,7 @@ diff --git a/package.json b/package.json +++ b/package.json @@ -40,5 +40,9 @@ "TRADEMARK": "Яндекс Музыка", - "DEEPLINK_PROTOCOL": "yandexmusic" + "DEEPLINK_PROTOCOL": "yandex-music" }, - "license": "UNLICENSED" + "license": "UNLICENSED", diff --git a/repack.sh b/repack.sh index f30f912..5087d14 100755 --- a/repack.sh +++ b/repack.sh @@ -125,7 +125,7 @@ fi echo "Packing" cd "$curdir" -asar pack "$TEMPDIR/app" "$dst/yandexmusic.asar" +asar pack "$TEMPDIR/app" "$dst/yandex-music.asar" for ext in png svg; do mv "$TEMPDIR/app/build/next-desktop/favicon.$ext" "$dst" done diff --git a/templates/PKGBUILD b/templates/PKGBUILD index a767815..7f0f63e 100644 --- a/templates/PKGBUILD +++ b/templates/PKGBUILD @@ -1,6 +1,6 @@ # Maintainer: Andrey Onischenko loraner123@gmail.com -pkgname=yandexmusic +pkgname=yandex-music pkgver="%version%" pkgrel="%release%" pkgdesc="Yandex Music - Personal recommendations, selections for any occasion and new music" @@ -18,17 +18,17 @@ build() { } package() { - mkdir -p "$pkgdir/usr/lib/yandexmusic" + mkdir -p "$pkgdir/usr/lib/yandex-music" mkdir -p "$pkgdir/usr/share/applications" mkdir -p "$pkgdir/usr/bin" - install -Dm644 "$srcdir/app/yandexmusic.asar" "$pkgdir/usr/lib/yandexmusic/yandexmusic.asar" - install -Dm644 "$srcdir/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandexmusic.png" - install -Dm644 "$srcdir/yandex-music-linux/templates/desktop" "$pkgdir/usr/share/applications/yandexmusic.desktop" + install -Dm644 "$srcdir/app/yandex-music.asar" "$pkgdir/usr/lib/yandex-music/yandex-music.asar" + install -Dm644 "$srcdir/app/favicon.png" "$pkgdir/usr/share/pixmaps/yandex-music.png" + install -Dm644 "$srcdir/yandex-music-linux/templates/desktop" "$pkgdir/usr/share/applications/yandex-music.desktop" install -Dm644 "$srcdir/yandex-music-linux/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 'exec electron /usr/lib/yandexmusic/yandexmusic.asar "$@"' >> "$pkgdir/usr/bin/yandexmusic" - chmod 755 "$pkgdir/usr/bin/yandexmusic" + echo "#!/bin/sh" > "$pkgdir/usr/bin/yandex-music" + echo 'exec electron /usr/lib/yandex-music/yandex-music.asar "$@"' >> "$pkgdir/usr/bin/yandex-music" + chmod 755 "$pkgdir/usr/bin/yandex-music" } diff --git a/templates/control b/templates/control index 71d46fa..ccfa2df 100644 --- a/templates/control +++ b/templates/control @@ -1,4 +1,4 @@ -Package: yandexmusic +Package: yandex-music Version: %version% Section: sound Priority: optional diff --git a/templates/desktop b/templates/desktop index 08657d0..8f96734 100644 --- a/templates/desktop +++ b/templates/desktop @@ -4,8 +4,8 @@ Name[ru]=Яндекс Музыка Comment=Yandex Music — we collect music for you Comment[ru]=Яндекс Музыка — собираем музыку для вас GenericName=YandexMusic -Exec=yandexmusic %U -Icon=yandexmusic +Exec=yandex-music %U +Icon=yandex-music Type=Application StartupNotify=true Categories=Audio;Music;Player;AudioVideo