<commit_before>{ mkDerivation, lib, fetchgit, fetchpatch
, pkgconfig, gyp, cmake, makeWrapper
, qtbase, qtimageformats, gtk3, libappindicator-gtk3
, dee, ffmpeg, openalSoft, minizip, libopus, alsaLib, libpulseaudio, range-v3
}:

mkDerivation rec {
  name = "telegram-desktop-${version}";
  version = "1.2.6";

  # Submodules
  src = fetchgit {
    url = "git://github.com/telegramdesktop/tdesktop";
    rev = "v${version}";
    sha256 = "15g0m2wwqfp13wd7j31p8cx1kpylx5m8ljaksnsqdkgyr9l1ar8w";
    fetchSubmodules = true;
  };

  # TODO: Not active anymore.
  tgaur = fetchgit {
    url = "https://aur.archlinux.org/telegram-desktop-systemqt.git";
    rev = "1ed27ce40913b9e6e87faf7a2310660c2790b98e";
    sha256 = "1i7ipqgisaw54g1nbg2cvpbx89g9gyjjb3sak1486pxsasp1qhyc";
  };

  patches = [
    (fetchpatch {
      name = "tdesktop.patch";
      url = "https://git.archlinux.org/svntogit/community.git/plain/repos/community-x86_64/tdesktop.patch?h=packages/telegram-desktop&id=f0eefac36f529295f8b065a14b6d5f1a51d7614d";
      sha256 = "1a4wap5xnp6zn4913r3zdpy6hvkcfxcy4zzimy7fwzp7iwy20iqa";
    })
  ];

  nativeBuildInputs = [ pkgconfig gyp cmake makeWrapper ];

  buildInputs = [
    qtbase qtimageformats gtk3 libappindicator-gtk3
    dee ffmpeg openalSoft minizip libopus alsaLib libpulseaudio range-v3
  ];<commit_msg>tdesktop: add native notifications support By patching paths to required libs in sources, application is able to load them and provide an option to use native notifications.<commit_after>{ mkDerivation, lib, fetchgit, fetchpatch
, pkgconfig, gyp, cmake, makeWrapper
, qtbase, qtimageformats, gtk3, libappindicator-gtk3, libnotify
, dee, ffmpeg, openalSoft, minizip, libopus, alsaLib, libpulseaudio, range-v3
}:

mkDerivation rec {
  name = "telegram-desktop-${version}";
  version = "1.2.6";

  # Submodules
  src = fetchgit {
    url = "git://github.com/telegramdesktop/tdesktop";
    rev = "v${version}";
    sha256 = "15g0m2wwqfp13wd7j31p8cx1kpylx5m8ljaksnsqdkgyr9l1ar8w";
    fetchSubmodules = true;
  };

  # TODO: Not active anymore.
  tgaur = fetchgit {
    url = "https://aur.archlinux.org/telegram-desktop-systemqt.git";
    rev = "1ed27ce40913b9e6e87faf7a2310660c2790b98e";
    sha256 = "1i7ipqgisaw54g1nbg2cvpbx89g9gyjjb3sak1486pxsasp1qhyc";
  };

  patches = [
    (fetchpatch {
      name = "tdesktop.patch";
      url = "https://git.archlinux.org/svntogit/community.git/plain/repos/community-x86_64/tdesktop.patch?h=packages/telegram-desktop&id=f0eefac36f529295f8b065a14b6d5f1a51d7614d";
      sha256 = "1a4wap5xnp6zn4913r3zdpy6hvkcfxcy4zzimy7fwzp7iw<PASSWORD>";
    })
  ];

  postPatch = ''
    substituteInPlace Telegram/SourceFiles/platform/linux/linux_libs.cpp --replace '"appindicator"' '"${libappindicator-gtk3}/lib/libappindicator3.so"'
    substituteInPlace Telegram/SourceFiles/platform/linux/linux_libnotify.cpp --replace '"notify"' '"${libnotify}/lib/libnotify.so"'
  '';

  nativeBuildInputs = [ pkgconfig gyp cmake makeWrapper ];

  buildInputs = [
    qtbase qtimageformats gtk3 libappindicator-gtk3
    dee ffmpeg openalSoft minizip libopus alsaLib libpulseaudio range-v3
  ];
{'fraction_non_alphanumeric': 0.11349104859335038, 'fraction_numerical': 0.07544757033248081, 'mean_word_length': 4.557726465364121, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3959334', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1241, 'n_words': 190}