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-rocketchat = let rev = "5c08ad0eacd39914d27b692d7eb42a94a991fb4c"; in prev.stdenv.mkDerivation { pname = "pidgin-rocketchat"; version = builtins.substring 0 8 rev; src = prev.fetchFromGitHub { owner = "EionRobb"; repo = "purple-rocketchat"; inherit rev; hash = "sha256-UBIp5tpj4Xfo+mPhY51+rzs+ojKr90zWK+XLiK7XvWM="; }; nativeBuildInputs = with final; [ pidgin json-glib glib discount ]; installFlags = [ "ROCKETCHAT_DEST=$(out)/lib/purple-2" "ROCKETCHAT_ICONS_DEST=$(out)/share/pixmaps/pidgin/protocols" ]; }; pidgin-with-plugins = pidginWrapper { inherit (prev) makeWrapper symlinkJoin; plugins = with final; [ purple-lurch pidgin-carbons pidgin-opensteamworks pidgin-xmpp-receipts pidgin-rocketchat ]; pidgin = prev.pidgin.overrideAttrs (oldAttrs: { patches = (oldAttrs.patches or []) ++ [mucHistory]; }); }; }