Skip to content

Commit

Permalink
ayugram-desktop: init at 4.16.8
Browse files Browse the repository at this point in the history
  • Loading branch information
duvetfall committed May 14, 2024
1 parent 8ee7da0 commit feb115e
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions pkgs/by-name/ay/ayugram-desktop/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
stdenv,
lib,
fetchFromGitHub,
telegram-desktop,
}:
let
mainProgram = if stdenv.isLinux then "ayugram-desktop" else "Ayugram";
in
(telegram-desktop.override { inherit mainProgram; }).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;
};
}
)

0 comments on commit feb115e

Please sign in to comment.