Merge pull request #317309 from cjshearer/ytmdesktop_init_at_2.0.5
This commit is contained in:
@@ -0,0 +1,106 @@
|
||||
{
|
||||
lib,
|
||||
asar,
|
||||
binutils,
|
||||
commandLineArgs ? "",
|
||||
copyDesktopItems,
|
||||
electron_30,
|
||||
fetchurl,
|
||||
makeDesktopItem,
|
||||
makeWrapper,
|
||||
nix-update-script,
|
||||
stdenv,
|
||||
zstd,
|
||||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "ytmdesktop";
|
||||
version = "2.0.5";
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
desktopName = "Youtube Music Desktop App";
|
||||
exec = "ytmdesktop";
|
||||
icon = "ytmdesktop";
|
||||
name = "ytmdesktop";
|
||||
genericName = finalAttrs.meta.description;
|
||||
mimeTypes = [ "x-scheme-handler/ytmd" ];
|
||||
categories = [
|
||||
"AudioVideo"
|
||||
"Audio"
|
||||
];
|
||||
startupNotify = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
asar
|
||||
copyDesktopItems
|
||||
makeWrapper
|
||||
zstd
|
||||
];
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ytmdesktop/ytmdesktop/releases/download/v${finalAttrs.version}/youtube-music-desktop-app_${finalAttrs.version}_amd64.deb";
|
||||
hash = "sha256-0j8HVmkFyTk/Jpq9dfQXFxd2jnLwzfEiqCgRHuc5g9o=";
|
||||
};
|
||||
|
||||
unpackPhase = ''
|
||||
runHook preUnpack
|
||||
|
||||
ar x $src data.tar.zst
|
||||
tar xf data.tar.zst
|
||||
|
||||
runHook preUnpack
|
||||
'';
|
||||
|
||||
postPatch = ''
|
||||
pushd usr/lib/youtube-music-desktop-app
|
||||
|
||||
asar extract resources/app.asar patched-asar
|
||||
|
||||
# workaround for https://github.com/electron/electron/issues/31121
|
||||
substituteInPlace patched-asar/.webpack/main/index.js \
|
||||
--replace-fail "process.resourcesPath" "'$out/lib/resources'"
|
||||
|
||||
asar pack patched-asar resources/app.asar
|
||||
|
||||
popd
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/{lib,share/pixmaps}
|
||||
|
||||
cp -r usr/lib/youtube-music-desktop-app/{locales,resources{,.pak}} $out/lib
|
||||
cp usr/share/pixmaps/youtube-music-desktop-app.png $out/share/pixmaps/ytmdesktop.png
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
fixupPhase = ''
|
||||
runHook preFixup
|
||||
|
||||
makeWrapper ${lib.getExe electron_30} $out/bin/ytmdesktop \
|
||||
--add-flags $out/lib/resources/app.asar \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \
|
||||
--add-flags ${lib.escapeShellArg commandLineArgs}
|
||||
|
||||
runHook preFixup
|
||||
'';
|
||||
|
||||
meta = {
|
||||
changelog = "https://github.com/ytmdesktop/ytmdesktop/tag/v${finalAttrs.version}";
|
||||
description = "A Desktop App for YouTube Music";
|
||||
downloadPage = "https://github.com/ytmdesktop/ytmdesktop/releases";
|
||||
homepage = "https://ytmdesktop.app/";
|
||||
license = lib.licenses.gpl3Only;
|
||||
mainProgram = finalAttrs.pname;
|
||||
maintainers = [ lib.maintainers.cjshearer ];
|
||||
inherit (electron_30.meta) platforms;
|
||||
# While the files we extract from the .deb are cross-platform (javascript), the installation
|
||||
# process for darwin is different, and I don't have a test device. PRs are welcome if you can
|
||||
# add the correct installation steps. I would suggest looking at the following:
|
||||
# https://www.electronjs.org/docs/latest/tutorial/application-distribution#manual-packaging
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/applications/networking/instant-messengers/jitsi-meet-electron/default.nix
|
||||
badPlatforms = lib.platforms.darwin;
|
||||
};
|
||||
})
|
||||
@@ -1487,7 +1487,6 @@ mapAliases ({
|
||||
yarn2nix-moretea-openssl_1_1 = throw "'yarn2nix-moretea-openssl_1_1' has been removed."; # Added 2023-02-04
|
||||
yi = throw "'yi' has been removed, as it was broken and unmaintained"; # added 2024-05-09
|
||||
yrd = throw "'yrd' has been removed, as it was broken and unmaintained"; # added 2024-05-27
|
||||
ytmdesktop = throw "ytmdesktop was removed because upstream vanished"; # added 2024-03-24
|
||||
yubikey-manager4 = throw "yubikey-manager4 has been removed, since it is no longer required by yubikey-manager-qt. Please update to yubikey-manager."; # Added 2024-01-14
|
||||
yuzu-ea = throw "yuzu-ea has been removed from nixpkgs, as it has been taken down upstream"; # Added 2024-03-04
|
||||
yuzu-early-access = throw "yuzu-early-access has been removed from nixpkgs, as it has been taken down upstream"; # Added 2024-03-04
|
||||
|
||||
Reference in New Issue
Block a user