about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/instant-messengers/telegram
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2020-04-01 15:50:50 +0000
committerAlyssa Ross <hi@alyssa.is>2020-04-01 15:50:50 +0000
commit75eafe97f7df0d653bec67f3962214d7c357831f (patch)
tree09f2cc901e0e637876cbb78d192dfe2fcfef8156 /nixpkgs/pkgs/applications/networking/instant-messengers/telegram
parenta53b121bf4331497da63df3b1b7f1a7897dad146 (diff)
parenta2e06fc3423c4be53181b15c28dfbe0bcf67dd73 (diff)
downloadnixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.gz
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.bz2
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.lz
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.xz
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.tar.zst
nixlib-75eafe97f7df0d653bec67f3962214d7c357831f.zip
Merge commit 'a2e06fc3423c4be53181b15c28dfbe0bcf67dd73'
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/instant-messengers/telegram')
-rw-r--r--nixpkgs/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix69
2 files changed, 69 insertions, 54 deletions
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix b/nixpkgs/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix
new file mode 100644
index 000000000000..862659fde8d9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/instant-messengers/telegram/kotatogram-desktop/default.nix
@@ -0,0 +1,54 @@
+{ mkDerivation, lib, fetchFromGitHub, pkg-config, python3, cmake, ninja
+, qtbase, qtimageformats, enchant, xdg_utils, ffmpeg, openalSoft, lzma
+, lz4, xxHash, zlib, minizip, openssl, libtgvoip, range-v3
+}:
+
+with lib;
+
+mkDerivation rec {
+  pname = "kotatogram-desktop";
+  version = "1.1.5";
+
+  src = fetchFromGitHub {
+    owner = "kotatogram";
+    repo = "kotatogram-desktop";
+    rev = "k${version}";
+    sha256 = "1j5wn3k1mr2c39szmyzm0pf720jmbllcaj40p2ydx0p3lir1s760";
+    fetchSubmodules = true;
+  };
+
+  postPatch = ''
+    substituteInPlace Telegram/lib_spellcheck/spellcheck/platform/linux/linux_enchant.cpp \
+      --replace '"libenchant-2.so.2"' '"${enchant}/lib/libenchant-2.so.2"'
+  '';
+
+  nativeBuildInputs = [ pkg-config python3 cmake ninja ];
+
+  buildInputs = [
+    qtbase qtimageformats ffmpeg openalSoft lzma lz4 xxHash
+    zlib minizip openssl enchant libtgvoip range-v3
+  ];
+
+  qtWrapperArgs = [
+    "--prefix PATH : ${xdg_utils}/bin"
+  ];
+
+  cmakeFlags = [
+    "-DTDESKTOP_API_TEST=ON"
+    "-DTDESKTOP_DISABLE_GTK_INTEGRATION=ON"
+    "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF"
+  ];
+
+  meta = {
+    description = "Kotatogram – experimental Telegram Desktop fork";
+    longDescription = ''
+      Unofficial desktop client for the Telegram messenger, based on Telegram Desktop.
+
+      It contains some useful (or purely cosmetic) features, but they could be unstable. A detailed list is available here: https://kotatogram.github.io/changes
+    '';
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    homepage = https://kotatogram.github.io;
+    maintainers = with maintainers; [ ilya-fedin ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix b/nixpkgs/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix
index 3f6d9c498980..9cd181c591d6 100644
--- a/nixpkgs/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix
+++ b/nixpkgs/pkgs/applications/networking/instant-messengers/telegram/tdesktop/default.nix
@@ -1,7 +1,8 @@
 { mkDerivation, lib, fetchurl, fetchsvn
 , pkgconfig, cmake, ninja, python3, wrapGAppsHook, wrapQtAppsHook
-, qtbase, qtimageformats, gtk3, libappindicator-gtk3, enchant2, lz4, xxHash
+, qtbase, qtimageformats, gtk3, libsForQt5, enchant2, lz4, xxHash
 , dee, ffmpeg_4, openalSoft, minizip, libopus, alsaLib, libpulseaudio, range-v3
+, tl-expected, microsoft_gsl
 # TODO: Shouldn't be required:
 , pcre, xorg, utillinux, libselinux, libsepol, epoxy, at-spi2-core, libXtst
 , xdg_utils
@@ -10,43 +11,27 @@
 with lib;
 
 # Main reference:
-# - This package is based on the Arch package:
+# - This package was originally based on the Arch package but all patches are now upstreamed:
 #   https://git.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/telegram-desktop
-# Other references that could be useful (but we should try to stick to Arch):
+# Other references that could be useful:
 # - https://git.alpinelinux.org/aports/tree/testing/telegram-desktop/APKBUILD
 # - https://github.com/void-linux/void-packages/blob/master/srcpkgs/telegram-desktop/template
 
 mkDerivation rec {
   pname = "telegram-desktop";
-  version = "1.9.8";
-  # Note: Due to our strong dependency on the Arch patches it's probably best
-  # to also wait for the Arch update (especially if the patches don't apply).
+  version = "1.9.14";
 
   # Telegram-Desktop with submodules
   src = fetchurl {
     url = "https://github.com/telegramdesktop/tdesktop/releases/download/v${version}/tdesktop-${version}-full.tar.gz";
-    sha256 = "1rq3180l4ly0n0jj08cxy9l2d07scwp9hasmliva2xspyv7i9ksd";
+    sha256 = "0jsss4b51ylf4qk58frvh2yap1s3cjf3isnlc273cc0fh5g1skc6";
   };
 
-  # Arch patches (svn export telegram-desktop/trunk)
-  archPatches = fetchsvn {
-    url = "svn://svn.archlinux.org/community/telegram-desktop/trunk";
-    # svn log svn://svn.archlinux.org/community/telegram-desktop/trunk
-    rev = "554983";
-    sha256 = "02gk5dlrmxvyl7w1yxmwclknk1k9drpx6rxqc6vmmw85l763m95j";
-  };
-
-  # Note: It would be best if someone could get as many patches upstream as
-  # possible (we currently depend a lot on custom patches...).
-  patches = [
-    "${archPatches}/0005-Use-system-wide-fonts.patch"
-  ];
-
   postPatch = ''
-    substituteInPlace Telegram/SourceFiles/platform/linux/linux_libs.cpp \
-      --replace '"appindicator3"' '"${libappindicator-gtk3}/lib/libappindicator3.so"'
     substituteInPlace Telegram/lib_spellcheck/spellcheck/platform/linux/linux_enchant.cpp \
       --replace '"libenchant-2.so.2"' '"${enchant2}/lib/libenchant-2.so.2"'
+    substituteInPlace Telegram/CMakeLists.txt \
+      --replace '"''${TDESKTOP_LAUNCHER_BASENAME}.appdata.xml"' '"''${TDESKTOP_LAUNCHER_BASENAME}.metainfo.xml"'
   '';
 
   # We want to run wrapProgram manually (with additional parameters)
@@ -56,36 +41,24 @@ mkDerivation rec {
   nativeBuildInputs = [ pkgconfig cmake ninja python3 wrapGAppsHook wrapQtAppsHook ];
 
   buildInputs = [
-    qtbase qtimageformats gtk3 libappindicator-gtk3 enchant2 lz4 xxHash
+    qtbase qtimageformats gtk3 libsForQt5.libdbusmenu enchant2 lz4 xxHash
     dee ffmpeg_4 openalSoft minizip libopus alsaLib libpulseaudio range-v3
+    tl-expected microsoft_gsl
     # TODO: Shouldn't be required:
     pcre xorg.libpthreadstubs xorg.libXdmcp utillinux libselinux libsepol epoxy at-spi2-core libXtst
   ];
 
   enableParallelBuilding = true;
 
-  NIX_CFLAGS_COMPILE = [
-    "-I${minizip}/include/minizip"
-    # See Telegram/gyp/qt.gypi
-    "-I${getDev qtbase}/mkspecs/linux-g++"
-  ] ++ concatMap (x: [
-    "-I${getDev qtbase}/include/${x}"
-    "-I${getDev qtbase}/include/${x}/${qtbase.version}"
-    "-I${getDev qtbase}/include/${x}/${qtbase.version}/${x}"
-    "-I${getDev libopus}/include/opus"
-    "-I${getDev alsaLib}/include/alsa"
-    "-I${getDev libpulseaudio}/include/pulse"
-    ]) [ "QtCore" "QtGui" "QtDBus" ];
-  CPPFLAGS = NIX_CFLAGS_COMPILE;
-
   cmakeFlags = [
     "-Ddisable_autoupdate=ON"
-    #"-DTDESKTOP_API_TEST=ON" # TODO: Officiall API credentials for Nixpkgs
-    "-DTDESKTOP_API_ID=17349" # See: https://github.com/NixOS/nixpkgs/issues/55271
-    "-DTDESKTOP_API_HASH=344583e45741c457fe1862106095a5eb"
+    # TODO: Officiall API credentials for Nixpkgs
+    # (see: https://github.com/NixOS/nixpkgs/issues/55271):
+    "-DTDESKTOP_API_TEST=ON"
     "-DDESKTOP_APP_USE_GLIBC_WRAPS=OFF"
     "-DDESKTOP_APP_USE_PACKAGED=ON"
     "-DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF"
+    "-DDESKTOP_APP_USE_PACKAGED_VARIANT=OFF"
     "-DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON"
     "-DTDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME=ON"
     "-DTDESKTOP_DISABLE_DESKTOP_FILE_GENERATION=ON"
@@ -108,19 +81,7 @@ mkDerivation rec {
   #   - upstream: https://github.com/grishka/libtgvoip
   # Both of these packages are included in this PR (kotatogram-desktop):
   # https://github.com/NixOS/nixpkgs/pull/75210
-
-  installPhase = ''
-    install -Dm755 bin/telegram-desktop $out/bin/telegram-desktop
-
-    mkdir -p $out/share/{kservices5,applications,metainfo}
-    sed "s,/usr/bin,$out/bin,g" "../lib/xdg/tg.protocol" > "$out/share/kservices5/tg.protocol"
-    install -m444 "../lib/xdg/telegramdesktop.desktop" "$out/share/applications/telegram-desktop.desktop"
-    install -m644 "../lib/xdg/telegramdesktop.appdata.xml" "$out/share/metainfo/telegramdesktop.metainfo.xml"
-
-    for icon_size in 16 32 48 64 128 256 512; do
-      install -Dm644 "../Telegram/Resources/art/icon''${icon_size}.png" "$out/share/icons/hicolor/''${icon_size}x''${icon_size}/apps/telegram.png"
-    done
-  '';
+  # TODO: Package mapbox-variant
 
   postFixup = ''
     # This is necessary to run Telegram in a pure environment.