anchor.diff:      sed -i 'Telegram/Telegram.pro' \
         -e 's,CUSTOM_API_ID,,g' \
         -e 's,/usr,/does-not-exist,g' \
  -      -e '/LIBS += .*libxkbcommon.a/d' \
  -      -e 's,LIBS += .*libz.a,LIBS += -lz,' \
  +      -e 's, -flto,,g' \
         -e 's,LIBS += .*libbreakpad_client.a,LIBS += ${breakpad}/lib/libbreakpad_client.a,' \
  -      -e 's, -flto,,g' \
  -      -e 's, -static-libstdc++,,g'
  +      -e 's, -static-libstdc++,,g' \
  +      -e '/LIBS += .*libxkbcommon.a/d'
   
       export qmakeFlags="$qmakeFlags QT_TDESKTOP_PATH=$PWD/../qt"
   
  
positive.code: 
  in stdenv.mkDerivation rec {
    name = "telegram-desktop-${version}";
    version = "0.9.56";
    qtVersion = lib.replaceStrings ["."] ["_"] packagedQt;
  
    src = fetchFromGitHub {
      owner = "telegramdesktop";
      repo = "tdesktop";
      rev = "v${version}";
      sha256 = "000ngg6arfb6mif0hvin099f83q3sn7mw4vfvrikskczblw3a5lc";
    };
  
    tgaur = fetchgit {
      url = "https://aur.archlinux.org/telegram-desktop.git";
      rev = "f8907d1ccaf8345c06232238342921213270e3d8";
      sha256 = "04jh0fsrh4iwg188d20z15qkxv05wa5lpd8h21yxx3jxqljpdkws";
    };
  
    buildInputs = [
  
negative.code:       export configureFlags="-prefix "$PWD/../qt" -release -opensource -confirm-license -system-zlib \
          -system-libpng -system-libjpeg -system-freetype -system-harfbuzz -system-pcre -system-xcb \
          -system-xkbcommon-x11 -no-opengl -static -nomake examples -nomake tests \
          -openssl-linked -dbus-linked -system-sqlite -verbose -no-gtkstyle \
          ${lib.optionalString (!system-x86_64) "-no-sse2"} -no-sse3 -no-ssse3 \
          -no-sse4.1 -no-sse4.2 -no-avx -no-avx2 -no-mips_dsp -no-mips_dspr2"
        export dontAddPrefix=1
  