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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ayugram-desktop: init at 4.16.8 #307584

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5508,6 +5508,10 @@
fingerprint = "9484 44FC E03B 05BA 5AB0 591E C37B 1C1D 44C7 86EE";
}];
};
duvetfall = {
name = "Darya Mukhina";
email = "nix@myxa.me";
};
dvn0 = {
email = "git@dvn.me";
github = "dvn0";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
, lld
, libicns
, nix-update-script
, mainProgram ? if stdenv.isLinux then "telegram-desktop" else "Telegram"
# We're allowed to used the API ID of the Snap package:
, apiId ? 611335
, apiHash ? "d524b414d21f4d37f08684c1df41ac9c"
}:

# Main reference:
Expand All @@ -59,7 +63,6 @@ let
cxxStandard = "20";
};
};
mainProgram = if stdenv.isLinux then "telegram-desktop" else "Telegram";
in
stdenv.mkDerivation rec {
pname = "telegram-desktop";
Expand Down Expand Up @@ -186,9 +189,8 @@ stdenv.mkDerivation rec {

cmakeFlags = [
"-Ddisable_autoupdate=ON"
# We're allowed to used the API ID of the Snap package:
"-DTDESKTOP_API_ID=611335"
"-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c"
"-DTDESKTOP_API_ID=${toString apiId}"
"-DTDESKTOP_API_HASH=${apiHash}"
# See: https://github.com/NixOS/nixpkgs/pull/130827#issuecomment-885212649
"-DDESKTOP_APP_USE_PACKAGED_FONTS=OFF"
"-DDESKTOP_APP_DISABLE_SCUDO=ON"
Expand Down
56 changes: 56 additions & 0 deletions pkgs/by-name/ay/ayugram-desktop/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
stdenv,
lib,
fetchFromGitHub,
telegram-desktop,
# AyuGram doesn't have its own API keys, so these are provided by @duvetfall.
apiId ? 20393039,
apiHash ? "c18dc825962eef0b528a4ccd9482c14f"
}:
let
mainProgram = if stdenv.isLinux then "ayugram-desktop" else "Ayugram";
in
(telegram-desktop.override { inherit mainProgram apiId apiHash; }).overrideAttrs (
finalAttrs: previousAttrs: {
pname = "ayugram-desktop";
version = "4.16.8";

src = fetchFromGitHub {
owner = "AyuGram";
repo = "AyuGramDesktop";
rev = "v${finalAttrs.version}";
fetchSubmodules = true;
hash = "sha256-HrvqENRRyRzTDUUgzAHPBwNVo5dDTUsGIFOH75RQes0=";
};

# Since the original .desktop file is for Flatpak, we need to fix it.
postInstall =
lib.optionalString stdenv.isLinux
# Rudiment: related functionality is disabled by disabling the auto-updater
# and it breaks the .desktop file in Aylur's Gtk Shell
# (with it, it causes the application to not be seen by the app launcher).
# https://github.com/AyuGram/AyuGramDesktop/blob/5566a8ca0abe448a7f1865222b64b68ed735ee07/Telegram/SourceFiles/platform/linux/specific_linux.cpp#L455
''
substituteInPlace $out/share/applications/com.ayugram.desktop.desktop \
--replace-fail 'Exec=DESKTOPINTEGRATION=1 ' 'Exec='
''
+
# Since we aren't in Flatpak, "DBusActivatable" has no unit to
# activate and it causes the .desktop file to show the error "Could not activate remote peer
# 'com.ayugram.desktop': unit failed" (at least on KDE6).
''
substituteInPlace $out/share/applications/com.ayugram.desktop.desktop \
--replace-fail 'DBusActivatable=true' '# DBusActivatable=true'
'';

meta = {
description = "A desktop Telegram client with great customization and Ghost mode";
license = lib.licenses.gpl3Only;
platforms = lib.platforms.all;
homepage = "https://github.com/AyuGram/AyuGramDesktop";
changelog = "https://github.com/AyuGram/AyuGramDesktop/blob/v${finalAttrs.version}/changelog.txt";
maintainers = with lib.maintainers; [ duvetfall ];
inherit mainProgram;
};
}
)