final: prev: let mucHistory = prev.fetchpatch { url = "https://developer.pidgin.im/raw-attachment/ticket/16524/0001-only-request-unseed-chat-history-from-jabber-group-c.patch"; sha256 = "083wvmq7417xz55fxxhllqwql1hgjvin2sak08844121yw1jvc44"; }; pidginWrapper = { symlinkJoin, pidgin, makeWrapper, plugins }: let extraArgs = map (x: x.wrapArgs or "") plugins; majorVersion = prev.lib.versions.major pidgin.version; in symlinkJoin { name = "pidgin-with-plugins-${pidgin.version}"; paths = [ pidgin ] ++ plugins; buildInputs = [ makeWrapper ]; postBuild = '' wrapProgram $out/bin/pidgin \ --suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${majorVersion} $out/lib/pidgin" \ ${toString extraArgs} wrapProgram $out/bin/finch \ --suffix-each PURPLE_PLUGIN_PATH ':' "$out/lib/purple-${majorVersion}" \ ${toString extraArgs} ''; }; in { pidgin-with-plugins = pidginWrapper { inherit (prev) makeWrapper symlinkJoin; plugins = with final; [ purple-lurch pidgin-carbons pidgin-opensteamworks pidgin-xmpp-receipts ]; pidgin = prev.pidgin.overrideAttrs (oldAttrs: { patches = (oldAttrs.patches or []) ++ [mucHistory]; }); }; }