0
0
mirror of https://github.com/cucumber-sp/yandex-music-linux.git synced 2024-12-24 14:34:39 +03:00
yandex-music-linux/nix/default.nix

89 lines
2.1 KiB
Nix
Raw Normal View History

{ fetchurl
, stdenvNoCC
, lib
, makeWrapper
, p7zip
, asar
, jq
2024-02-09 17:35:17 +03:00
, python3
, electron
, ymExe ? null
}:
let
2024-02-09 15:07:50 +03:00
version_info = with builtins; fromJSON (readFile ../utility/version_info.json);
in
stdenvNoCC.mkDerivation
{
2024-02-14 14:07:10 +03:00
name = "yandex-music";
2024-02-18 21:00:32 +03:00
inherit (version_info.ym) version;
nativeBuildInputs = [
p7zip
asar
jq
2024-02-09 17:35:17 +03:00
python3
makeWrapper
];
repack = ./../repack.sh;
patches = ./../patches;
utility = ./../utility;
2024-03-07 22:16:21 +03:00
icons = ./../icons;
desktopItem = ../templates/desktop;
src =
if ymExe != null
then ymExe
else
fetchurl {
2024-02-18 21:00:32 +03:00
url = version_info.ym.exe_link;
sha256 = version_info.ym.exe_sha256;
};
unpackPhase = ''
cp -r $repack ./repack.sh
cp -r $patches ./patches
cp -r $utility ./utility
2024-03-07 22:16:21 +03:00
cp -r $icons ./icons
bash "./repack.sh" -o "./app" "$src"
'';
dontPatch = true;
installPhase = ''
mkdir -p "$out/share/nodejs"
2024-02-14 14:07:10 +03:00
mv app/yandex-music.asar "$out/share/nodejs"
# use makeWrapper on electron binary to make it call our asar package
2024-02-14 14:07:10 +03:00
makeWrapper "${electron}/bin/electron" "$out/bin/yandex-music" \
--add-flags "$out/share/nodejs/yandex-music.asar"
install -Dm644 "./app/favicon.png" "$out/share/pixmaps/yandex-music.png"
install -Dm644 "./app/favicon.png" "$out/share/icons/hicolor/48x48/apps/yandex-music.png"
install -Dm644 "./app/favicon.svg" "$out/share/icons/hicolor/scalable/apps/yandex-music.svg"
install -Dm644 "$desktopItem" "$out/share/applications/yandex-music.desktop"
'';
meta = {
description = "Yandex Music - Personal recommendations, selections for any occasion and new music";
homepage = "https://music.yandex.ru/";
downloadPage = "https://music.yandex.ru/download/";
license = lib.licenses.unfree;
platforms = [ "x86_64-linux" "aarch64-linux" ];
maintainers = [
{
name = "Yury Shvedov";
email = "mestofel13@gmail.com";
github = "ein-shved";
githubId = 3513222;
}
{
github = "cucumber-sp";
githubId = 100789522;
name = "Andrey Onishchenko";
}
];
};
}