Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport release-24.05] telegram-desktop: 5.1.7 -> 5.6.3, _64gram: 1.1.22 -> 1.1.43 #342783

Closed
wants to merge 39 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
53fefd8
telegram-desktop: add missing glib-networking dependency
NickCao May 27, 2024
0a6c913
telegram-desktop.tg_owt: 0-unstable-2023-12-21 -> 0-unstable-2024-06-15
oxalica Jun 15, 2024
da89de6
telegram-desktop: 5.1.7 -> 5.1.8
r-ryantm Jun 23, 2024
cee8022
telegram-desktop: 5.1.8 -> 5.2.0
NickCao Jul 1, 2024
af1eef7
telegram-desktop: 5.2.0 -> 5.2.1
NickCao Jul 1, 2024
cd7ff43
telegram-desktop: 5.2.1 -> 5.2.2
NickCao Jul 2, 2024
f9d58cf
telegram-desktop: depends on LocalAuthentication on darwin platforms
NickCao Jul 2, 2024
a26779b
telegram-desktop: update patch for disabling url scheme registration
NickCao Jul 3, 2024
4b0bf95
telegram-desktop: use finalAttrs pattern to simplify packaging tdeskt…
NickCao Jul 4, 2024
9cf5927
telegram-desktop: 5.2.2 -> 5.2.3
r-ryantm Jul 20, 2024
70803d9
telegram-desktop.tg_owt: 0-unstable-2024-06-15 -> 0-unstable-2024-07-30
NickCao Aug 1, 2024
0ad948d
telegram-desktop.tg_owt: 0-unstable-2024-07-30 -> 0-unstable-2024-08-02
NickCao Aug 2, 2024
a675064
telegram-desktop: 5.2.3 -> 5.3.0
NickCao Jul 31, 2024
ff5bec1
ada: init at 2.9.0
NickCao Aug 1, 2024
62e9ad9
ada: 2.9.0 -> 2.9.1
r-ryantm Aug 25, 2024
7dc3df7
ada: 2.9.1 -> 2.9.2
NickCao Sep 3, 2024
a0e9326
telegram-desktop: 5.3.0 -> 5.3.1
NickCao Aug 1, 2024
bfae3cd
telegram-desktop: 5.3.1 -> 5.3.2
NickCao Aug 2, 2024
bf86481
telegram-desktop.tg_owt: 0-unstable-2024-08-02 -> 0-unstable-2024-08-04
NickCao Aug 15, 2024
80a89d7
telegram-desktop: 5.3.2 -> 5.4.0
NickCao Aug 15, 2024
cb3e6ee
telegram-desktop: 5.4.0 -> 5.4.1
NickCao Aug 17, 2024
4ecd4e7
telegram-desktop: 5.4.1 -> 5.5.0
NickCao Sep 6, 2024
f4f72cd
telegram-desktop: 5.5.0 -> 5.5.1
NickCao Sep 6, 2024
e0b10e5
telegram-desktop: 5.5.1 -> 5.5.2
NickCao Sep 9, 2024
30fb51f
telegram-desktop: 5.5.2 -> 5.5.5
r-ryantm Sep 18, 2024
b3f4c6e
telegram-desktop: 5.5.5 -> 5.6.0
NickCao Oct 5, 2024
fad9578
telegram-desktop: 5.6.0 -> 5.6.1
NickCao Oct 7, 2024
89d1ffa
telegram-desktop: 5.6.1 -> 5.6.1-unstable to fix build with Qt 6.8
K900 Oct 8, 2024
6c0f34f
telegram-desktop: 5.6.1-unstable-2024-10-12 -> 5.6.2
K900 Oct 15, 2024
35da629
telegram-desktop: 5.6.2 -> 5.6.3
NickCao Oct 15, 2024
ace534d
_64gram: 1.1.22 -> 1.1.23
r-ryantm May 26, 2024
798e9d4
_64gram: 1.1.23 -> 1.1.24
r-ryantm Jun 1, 2024
073c8fb
_64gram: 1.1.24 -> 1.1.27
r-ryantm Jun 8, 2024
52a3414
_64gram: 1.1.27 -> 1.1.29
r-ryantm Jun 16, 2024
69dc0bf
_64gram: 1.1.29 -> 1.1.30
r-ryantm Jul 6, 2024
3f1b8a9
_64gram: 1.1.30 -> 1.1.31
r-ryantm Jul 18, 2024
e186e2b
_64gram: 1.1.31 -> 1.1.34 and disable self update
DDoSolitary Aug 17, 2024
ed9fbd1
_64gram: 1.1.34 -> 1.1.39
r-ryantm Sep 15, 2024
c2d32e4
_64gram: 1.1.39 -> 1.1.43
r-ryantm Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{ lib
, fetchFromGitHub
, fetchpatch
, callPackage
, pkg-config
, cmake
Expand All @@ -15,6 +14,7 @@
, qtsvg
, qtimageformats
, gtk3
, glib-networking
, boost
, fmt
, libdbusmenu
Expand All @@ -38,6 +38,7 @@
, xdg-utils
, microsoft-gsl
, rlottie
, ada
, stdenv
, darwin
, lld
Expand All @@ -59,29 +60,25 @@ let
cxxStandard = "20";
};
};
mainProgram = if stdenv.isLinux then "telegram-desktop" else "Telegram";
in
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "telegram-desktop";
version = "5.1.7";
version = "5.6.3";

src = fetchFromGitHub {
owner = "telegramdesktop";
repo = "tdesktop";
rev = "v${version}";
rev = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-OH9+cH5CQyrp4DSKXEMs6csGiH+GAtxJT4P9YidmAcM=";
hash = "sha256-frz425V5eRulNVxCf457TWQAzU/f9/szD/sx3/LYQ2Y=";
};

patches = [
./macos.patch
# the generated .desktop files contains references to unwrapped tdesktop, breaking scheme handling
# and the scheme handler is already registered in the packaged .desktop file, rendering this unnecessary
# see https://github.com/NixOS/nixpkgs/issues/218370
(fetchpatch {
url = "https://salsa.debian.org/debian/telegram-desktop/-/raw/09b363ed5a4fcd8ecc3282b9bfede5fbb83f97ef/debian/patches/Disable-register-custom-scheme.patch";
hash = "sha256-B8X5lnSpwwdp1HlvyXJWQPybEN+plOwimdV5gW6aY2Y=";
})
./scheme.patch
];

postPatch = lib.optionalString stdenv.isLinux ''
Expand Down Expand Up @@ -134,9 +131,11 @@ stdenv.mkDerivation rec {
tg_owt
microsoft-gsl
rlottie
ada
] ++ lib.optionals stdenv.isLinux [
qtwayland
gtk3
glib-networking
fmt
libdbusmenu
alsa-lib
Expand Down Expand Up @@ -177,6 +176,7 @@ stdenv.mkDerivation rec {
IOSurface
Metal
NaturalLanguage
LocalAuthentication
libicns
]);

Expand All @@ -185,13 +185,12 @@ stdenv.mkDerivation rec {
};

cmakeFlags = [
"-Ddisable_autoupdate=ON"
(lib.cmakeBool "DESKTOP_APP_DISABLE_AUTOUPDATE" true)
# We're allowed to used the API ID of the Snap package:
"-DTDESKTOP_API_ID=611335"
"-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
(lib.cmakeFeature "TDESKTOP_API_ID" "611335")
(lib.cmakeFeature "TDESKTOP_API_HASH" "d524b414d21f4d37f08684c1df41ac9c")
# See: https://github.com/NixOS/nixpkgs/pull/130827#issuecomment-885212649
"-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF"
"-DDESKTOP_APP_DISABLE_SCUDO=ON"
(lib.cmakeBool "DESKTOP_APP_USE_PACKAGED_FONTS" false)
];

preBuild = ''
Expand All @@ -201,37 +200,37 @@ stdenv.mkDerivation rec {

installPhase = lib.optionalString stdenv.isDarwin ''
mkdir -p $out/Applications
cp -r ${mainProgram}.app $out/Applications
ln -s $out/{Applications/${mainProgram}.app/Contents/MacOS,bin}
cp -r ${finalAttrs.meta.mainProgram}.app $out/Applications
ln -s $out/{Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS,bin}
'';

postFixup = lib.optionalString stdenv.isLinux ''
# This is necessary to run Telegram in a pure environment.
# We also use gappsWrapperArgs from wrapGAppsHook.
wrapProgram $out/bin/${mainProgram} \
wrapProgram $out/bin/${finalAttrs.meta.mainProgram} \
"''${gappsWrapperArgs[@]}" \
"''${qtWrapperArgs[@]}" \
--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}
'' + lib.optionalString stdenv.isDarwin ''
wrapQtApp $out/Applications/${mainProgram}.app/Contents/MacOS/${mainProgram}
wrapQtApp $out/Applications/${finalAttrs.meta.mainProgram}.app/Contents/MacOS/${finalAttrs.meta.mainProgram}
'';

passthru = {
inherit tg_owt;
updateScript = nix-update-script { };
};

meta = with lib; {
meta = {
description = "Telegram Desktop messaging app";
longDescription = ''
Desktop client for the Telegram messenger, based on the Telegram API and
the MTProto secure protocol.
'';
license = licenses.gpl3Only;
platforms = platforms.all;
license = lib.licenses.gpl3Only;
platforms = lib.platforms.all;
homepage = "https://desktop.telegram.org/";
changelog = "https://github.com/telegramdesktop/tdesktop/releases/tag/v${version}";
maintainers = with maintainers; [ nickcao ];
inherit mainProgram;
changelog = "https://github.com/telegramdesktop/tdesktop/releases/tag/v${finalAttrs.version}";
maintainers = with lib.maintainers; [ nickcao ];
mainProgram = if stdenv.hostPlatform.isLinux then "telegram-desktop" else "Telegram";
};
}
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/Telegram/SourceFiles/core/application.cpp b/Telegram/SourceFiles/core/application.cpp
index e3e0de6c6..d5851bd6e 100644
--- a/Telegram/SourceFiles/core/application.cpp
+++ b/Telegram/SourceFiles/core/application.cpp
@@ -421,7 +421,6 @@ void Application::run() {

void Application::autoRegisterUrlScheme() {
if (!OptionSkipUrlSchemeRegister.value()) {
- InvokeQueued(this, [] { RegisterUrlScheme(); });
}
}

Original file line number Diff line number Diff line change
@@ -1,79 +1,117 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch
, pkg-config, cmake, ninja, yasm
, libjpeg, openssl, libopus, ffmpeg, alsa-lib, libpulseaudio, protobuf
, openh264, usrsctp, libevent, libvpx
, libX11, libXtst, libXcomposite, libXdamage, libXext, libXrender, libXrandr, libXi
, glib, abseil-cpp, pcre, util-linuxMinimal, libselinux, libsepol, pipewire
, mesa, libepoxy, libglvnd, unstableGitUpdater, darwin
{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
cmake,
crc32c,
python3,
libjpeg,
openssl,
libopus,
ffmpeg,
openh264,
libvpx,
libXi,
libXfixes,
libXtst,
libXcomposite,
libXdamage,
libXext,
libXrender,
libXrandr,
glib,
abseil-cpp,
pipewire,
mesa,
libGL,
unstableGitUpdater,
darwin,
}:

stdenv.mkDerivation {
pname = "tg_owt";
version = "0-unstable-2023-12-21";
version = "0-unstable-2024-08-04";

src = fetchFromGitHub {
owner = "desktop-app";
repo = "tg_owt";
rev = "afd9d5d31798d3eacf9ed6c30601e91d0f1e4d60";
sha256 = "sha256-/1cghoxmm+6uFEUgCjh1Xhb0CTnd1XAq1M21FruDRek=";
rev = "dc17143230b5519f3c1a8da0079e00566bd4c5a8";
sha256 = "sha256-7j7hBIOXEdNJDnDSVUqy234nkTCaeZ9tDAzqvcuaq0o=";
fetchSubmodules = true;
};

outputs = [ "out" "dev" ];
outputs = [
"out"
"dev"
];

nativeBuildInputs = [ pkg-config cmake ninja yasm ];
nativeBuildInputs = [
cmake
pkg-config
python3
];

buildInputs = [
libjpeg libopus ffmpeg protobuf openh264 usrsctp libevent libvpx abseil-cpp
] ++ lib.optionals stdenv.isLinux [
libX11 libXtst libXcomposite libXdamage libXext libXrender libXrandr libXi
glib pcre util-linuxMinimal libselinux libsepol pipewire alsa-lib libpulseaudio
mesa libepoxy libglvnd
] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
Cocoa
AppKit
IOKit
IOSurface
Foundation
AVFoundation
CoreMedia
VideoToolbox
CoreGraphics
CoreVideo
OpenGL
Metal
MetalKit
CoreFoundation
ApplicationServices
]);
buildInputs =
[
openssl
libjpeg
libopus
ffmpeg
]
++ lib.optionals stdenv.hostPlatform.isLinux [
glib
libXi
libXcomposite
libXdamage
libXext
libXfixes
libXrender
libXrandr
libXtst
pipewire
mesa
libGL
]
++ lib.optionals stdenv.hostPlatform.isDarwin (
with darwin.apple_sdk.frameworks;
[
Cocoa
AppKit
IOKit
IOSurface
Foundation
AVFoundation
CoreMedia
VideoToolbox
CoreGraphics
CoreVideo
Metal
MetalKit
CoreFoundation
ApplicationServices
]
);

patches = [
# GCC 12 Fix
(fetchpatch {
url = "https://github.com/desktop-app/tg_owt/pull/101/commits/86d2bcd7afb8706663d29e30f65863de5a626142.patch";
hash = "sha256-iWS0mB8R0vqPU/0qf6Ax54UCAKYDVCPac2mi/VHbFm0=";
})
# additional fix for GCC 12 + musl
(fetchpatch {
url = "https://git.alpinelinux.org/aports/plain/community/tg_owt/gcc12.patch?id=8120df03fa3b6db5b8ff92c7a52b680290ad6e20";
hash = "sha256-ikgxUH1e7pz0n0pKUemrPXXa4UkECX+w467M9gU68zs=";
})
propagatedBuildInputs = [
abseil-cpp
crc32c
openh264
libvpx
];

cmakeFlags = [
# Building as a shared library isn't officially supported and may break at any time.
"-DBUILD_SHARED_LIBS=OFF"
];

propagatedBuildInputs = [
# Required for linking downstream binaries.
abseil-cpp openh264 usrsctp libevent libvpx openssl
(lib.cmakeBool "BUILD_SHARED_LIBS" false)
];

passthru.updateScript = unstableGitUpdater { };

meta = with lib; {
license = licenses.bsd3;
maintainers = with maintainers; [ oxalica ];
meta = {
description = "Fork of Google's webrtc library for telegram-desktop";
homepage = "https://github.com/desktop-app/tg_owt";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ oxalica ];
platforms = lib.platforms.linux ++ lib.platforms.darwin;
};
}
17 changes: 15 additions & 2 deletions pkgs/by-name/_6/_64gram/package.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, telegram-desktop
, nix-update-script
}:

telegram-desktop.overrideAttrs (old: rec {
pname = "64gram";
version = "1.1.22";
version = "1.1.43";

src = fetchFromGitHub {
owner = "TDesktop-x64";
repo = "tdesktop";
rev = "v${version}";

fetchSubmodules = true;
hash = "sha256-Fhix+kCqUTr9qGMzDc2undxmhjmM6fPorZebeqXNHHE=";
hash = "sha256-vRiAIGY3CU5+hsdn8xiNbgvSM3eGRVwnvsSmSoaDN/k=";
};

patches = (old.patches or []) ++ [
(fetchpatch {
url = "https://github.com/TDesktop-x64/tdesktop/commit/c996ccc1561aed089c8b596f6ab3844335bbf1df.patch";
revert = true;
hash = "sha256-Hz7BXl5z4owe31l9Je3QOXT8FAyKcbsXsKjGfCmXhzE=";
})
];

cmakeFlags = (old.cmakeFlags or []) ++ [
(lib.cmakeBool "disable_autoupdate" true)
];

passthru.updateScript = nix-update-script {};

meta = with lib; {
Expand Down
Loading
Loading