diff --git a/pkgs/discord-music-presence.nix b/pkgs/discord-music-presence.nix index 120f0c9..687d46d 100644 --- a/pkgs/discord-music-presence.nix +++ b/pkgs/discord-music-presence.nix @@ -1,35 +1,70 @@ { lib, - stdenv, fetchurl, - appimageTools, - makeDesktopItem, + stdenv, + autoPatchelfHook, + + wayland, + libGL, + + zlib, + fontconfig, + freetype, + + krb5, + e2fsprogs, + + libgpg-error, }: -appimageTools.wrapType2 rec { - pname = "discord-music-presence"; + +stdenv.mkDerivation rec { + pname = "musicpresence"; version = "2.3.5"; src = fetchurl { - url = "https://github.com/ungive/discord-music-presence/releases/download/v${version}/musicpresence-${version}-linux-x86_64.AppImage"; - hash = "sha256-M7oDxVevspA3SGuHktS8ChQAYopgIqypiVlzyE4uyqI="; + url = "https://github.com/ungive/discord-music-presence/releases/download/v${version}/${pname}-${version}-linux-x86_64.tar.gz"; + hash = "sha256-BDgM1SfyEXC0oW+J33mYKwqRrvZX3cy/X9k7Yuk4kS8="; }; - extraInstallCommands = - let - contents = appimageTools.extract { inherit pname version src; }; - in - '' - install -m 444 -D ${contents}/musicpresence.desktop -t $out/share/applications - substituteInPlace $out/share/applications/musicpresence.desktop \ - --replace-fail Exec=musicpresence Exec=$out/bin/${pname} - cp -r ${contents}/usr/share/icons $out/share - ''; + nativeBuildInputs = [ + autoPatchelfHook + ]; + + buildInputs = [ + stdenv.cc.cc + + wayland + libGL + + zlib + fontconfig + freetype + + e2fsprogs + krb5 + + libgpg-error + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share + + cp -r usr/* $out + + install -m 444 -D usr/share/applications/${pname}.desktop -t $out/share/applications + + substituteInPlace $out/share/applications/${pname}.desktop \ + --replace-fail Exec=${pname} Exec=$out/bin/${pname} + + runHook postInstall + ''; meta = { description = "The Discord music status that works with any media player"; homepage = "https://github.com/ungive/discord-music-presence"; license = lib.licenses.unfreeRedistributable; maintainers = with lib.maintainers; [ ]; - mainProgram = "discord-music-presence"; + mainProgram = "musicpresence"; }; -} +} \ No newline at end of file