feat: more AyuGram branding

feat: update README
feat: update CONTRIBUTING
fix: add note for Linux
fix: rename xdg shortcut
fix: remove snap
fix: rename AyuGram executable in the updater
fix: use different GUIDs
This commit is contained in:
ZavaruKitsu 2023-08-27 13:40:55 +00:00
parent 3e3f0f0808
commit 58e1c9ff54
15 changed files with 138 additions and 734 deletions

View file

@ -1,6 +1,6 @@
# Contributing
This document describes how you can contribute to Telegram Desktop. Please read it carefully.
This document describes how you can contribute to AyuGram Desktop.
**Table of Contents**
@ -17,20 +17,15 @@ This document describes how you can contribute to Telegram Desktop. Please read
## What contributions are accepted
We highly appreciate your contributions in the matter of fixing bugs and optimizing the Telegram Desktop source code and its documentation. In case of fixing the existing user experience please push to your fork and [submit a pull request][pr].
We highly appreciate your contributions in the matter of fixing bugs and optimizing the AyuGram Desktop source code and its documentation. In case of fixing the existing user experience please push to your fork and [submit a pull request][pr].
Wait for us. We try to review your pull requests as fast as possible.
If we find issues with your pull request, we may suggest some changes and improvements.
If you have a translations-related contribution, check out [our Crowdin][translate].
Unfortunately we **do not merge** any pull requests that have new feature implementations, translations to new languages and those which introduce any new user interface elements.
If you have a translations-related contribution, check out [Translations platform][translate].
Telegram Desktop is not a standalone application but a part of [Telegram project][telegram], so all the decisions about the features, languages, user experience, user interface and the design are made inside Telegram team, often according to some roadmap which is not public.
Highly appreciated feature implementations from [Android app][android_repo].
## Build instructions
See the [README.md][build_instructions] for details on the various build
See [folder with instructions][build_instructions] for details on the various build
environments.
## Pull upstream changes into your fork regularly
@ -39,7 +34,7 @@ Telegram Desktop is advancing quickly. It is therefore critical that you pull up
To pull in upstream changes:
git remote add upstream https://github.com/telegramdesktop/tdesktop.git
git remote add upstream https://github.com/AyuGram/AyuGramDesktop.git
git fetch upstream master
Check the log to be sure that you actually want the changes, before merging:
@ -58,7 +53,7 @@ For more info, see [GitHub Help][help_fork_repo].
## How to get your pull request accepted
We want to improve Telegram Desktop with your contributions. But we also want to provide a stable experience for our users and the community. Follow these rules and you should succeed without a problem!
We want to improve AyuGram Desktop with your contributions. But we also want to provide a stable experience for our users and the community. Follow these rules and you should succeed without a problem!
### Keep your pull requests limited to a single issue
@ -112,7 +107,8 @@ Before you submit a pull request, please test your changes. Verify that Telegram
[help_fork_repo]: https://help.github.com/articles/fork-a-repo/
[help_change_commit_message]: https://help.github.com/articles/changing-a-commit-message/
[commit_message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[pr]: https://github.com/telegramdesktop/tdesktop/compare
[build_instructions]: https://github.com/telegramdesktop/tdesktop/blob/master/README.md#build-instructions
[pr]: https://github.com/AyuGram/AyuGramDesktop/compare
[build_instructions]: https://github.com/AyuGram/AyuGramDesktop/blob/dev/docs
[closing-issues-via-commit-messages]: https://help.github.com/articles/closing-issues-via-commit-messages/
[translate]: https://translations.telegram.org
[translate]: https://crowdin.com/project/ayugram
[android_repo]: https://github.com/AyuGram/AyuGram4A

BIN
.github/preview.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View file

@ -4,38 +4,47 @@
## Features
- Disable read packets sending
- Disable online packets sending
- Disable typing & upload packets sending
- Auto offline
- Messages history (+ deleted ones)
- Using scheduled messages to keep offline
- Full ghost mode (flexible)
- Messages history
- Anti-recall
- Some appearance customization stuff
- Local Telegram Premium
- Sync read states and message history with AyuSync *(TBA)*
Technically, we have the **Ghost mode** starter pack.
![AyuGram Preferences](.github/preview.png)
Also, we have a cool **purple icon**.
## Downloads
## Downloads? / FAQ?
### Windows
We have both **Windows** and **Linux** builds.
You can download prebuilt Windows binary from [Releases tab](https://github.com/AyuGram/AyuGramDesktop/releases) or from the [Telegram topic](https://t.me/ayugramchat/12788).
Follow our [Telegram channel](https://t.me/ayugram1338). FAQ can be found here.
Follow [official guide](https://github.com/AyuGram/AyuGramDesktop/blob/dev/docs/building-win-x64.md) if you want to build by yourself.
## May I get banned?
### Arch Linux
Well, *you* **can't**, because you're just an ordinary user.
You can install `ayugram-desktop-git` or `ayugram-desktop-bin` from [AUR](https://aur.archlinux.org/packages?O=0&K=ayugram).
## How to build
These packages maintained by [westpain](https://github.com/incycledream). *We're not responsible for them.*
Follow [official guide](https://github.com/AyuGram/AyuGramDesktop/blob/dev/docs/building-win-x64.md).
### Any other Linux distro
### Remarks
Follow [official guide](https://github.com/AyuGram/AyuGramDesktop/blob/dev/docs/building-linux.md).
### Remarks for Windows
Make sure you have these components installed with VS Build Tools:
- C++ MFC latest (x86 & x64)
- C++ ATL latest (x86 & x64)
- latest Windows 11 SDK
## Donation
If you enjoy using **AyuGram** and want to send us a tip, here's how you can do it:
- Using [Boosty](https://boosty.to/alexeyzavar) - any card and PayPal
- Using cryptocurrency - `TRpbajq38qU8joThgAfKJLyEPbNjzsdPJ1` (Tron + USDT)
## Credits
- [Telegram Desktop](https://github.com/telegramdesktop/tdesktop)

View file

@ -1808,9 +1808,9 @@ endif()
if (LINUX AND DESKTOP_APP_USE_PACKAGED)
include(GNUInstallDirs)
configure_file("../lib/xdg/org.ayugram.desktop.service" "${CMAKE_CURRENT_BINARY_DIR}/org.ayugram.desktop.service" @ONLY)
configure_file("../lib/xdg/org.ayugram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/org.ayugram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/org.ayugram.desktop.metainfo.xml")
configure_file("../lib/xdg/ayugram.desktop.service" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.service" @ONLY)
configure_file("../lib/xdg/ayugram.desktop.metainfo.xml" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml" @ONLY)
generate_appdata_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml")
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "telegram.png")
@ -1819,7 +1819,7 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "telegram.png")
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "telegram.png")
install(FILES "../lib/xdg/org.ayugram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.ayugram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/org.ayugram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
install(FILES "../lib/xdg/ayugram.desktop.desktop" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/applications")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.service" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/dbus-1/services")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ayugram.desktop.metainfo.xml" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/metainfo")
endif()

View file

@ -54,6 +54,6 @@
</qresource>
<qresource prefix="/misc">
<file alias="default_shortcuts-custom.json">../../default_shortcuts-custom.json</file>
<file alias="org.ayugram.desktop.desktop">../../../../lib/xdg/org.ayugram.desktop.desktop</file>
<file alias="ayugram.desktop.desktop">../../../../lib/xdg/ayugram.desktop.desktop</file>
</qresource>
</RCC>

View file

@ -45,7 +45,7 @@ int APIENTRY wWinMain(
ShellExecute(
nullptr,
nullptr,
(directory + L"\\Telegram.exe").c_str(),
(directory + L"\\AyuGram.exe").c_str(),
L"-autostart",
directory.data(),
SW_SHOWNORMAL);

View file

@ -204,7 +204,7 @@ bool update() {
writeLog(L"Error: bad update, has Updater.exe! '" + tofname + L"' equal '" + updaterName + L"'");
delFolder();
return false;
} else if (equal(tofname, updateTo + L"Telegram.exe") && exeName != L"Telegram.exe") {
} else if (equal(tofname, updateTo + L"AyuGram.exe") && exeName != L"AyuGram.exe") {
wstring fullBinaryPath = updateTo + exeName;
writeLog(L"Target binary found: '" + tofname + L"', changing to '" + fullBinaryPath + L"'");
tofname = fullBinaryPath;
@ -377,14 +377,14 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prevInstance, LPWSTR cmdPara
exeName = args[i];
for (int j = 0, l = exeName.size(); j < l; ++j) {
if (exeName[j] == L'/' || exeName[j] == L'\\') {
exeName = L"Telegram.exe";
exeName = L"AyuGram.exe";
break;
}
}
}
}
if (exeName.empty()) {
exeName = L"Telegram.exe";
exeName = L"AyuGram.exe";
}
if (needupdate) writeLog(L"Need to update!");
if (autostart) writeLog(L"From autostart!");

View file

@ -39,9 +39,9 @@ enum {
inline const char *cGUIDStr() {
#ifndef OS_MAC_STORE
static const char *gGuidStr = "{87A94AB0-E370-4cde-98D3-ACC110C5967D}";
static const char *gGuidStr = "{87A94AB0-E370-4cde-98D3-ACC110C59666}";
#else // OS_MAC_STORE
static const char *gGuidStr = "{E51FB841-8C0B-4EF9-9E9E-5A0078567627}";
static const char *gGuidStr = "{E51FB841-8C0B-4EF9-9E9E-5A0078567666}";
#endif // OS_MAC_STORE
return gGuidStr;

View file

@ -188,7 +188,7 @@ bool GenerateDesktopFile(
DEBUG_LOG(("App Info: placing .desktop file to %1").arg(targetPath));
if (!QDir(targetPath).exists()) QDir().mkpath(targetPath);
const auto sourceFile = u":/misc/org.ayugram.desktop.desktop"_q;
const auto sourceFile = u":/misc/ayugram.desktop.desktop"_q;
const auto targetFile = targetPath
+ QGuiApplication::desktopFileName()
+ u".desktop"_q;
@ -318,7 +318,7 @@ bool GenerateDesktopFile(
hashMd5Hex(exePath.constData(), exePath.size(), md5Hash);
}
QFile::remove(u"%1org.ayugram.desktop.%2.desktop"_q.arg(
QFile::remove(u"%1ayugram.desktop.%2.desktop"_q.arg(
targetPath,
md5Hash));
}
@ -606,10 +606,10 @@ void start() {
md5Hash.data());
}
return u"org.ayugram.desktop._%1"_q.arg(md5Hash.constData());
return u"ayugram.desktop._%1"_q.arg(md5Hash.constData());
}
return u"org.ayugram.desktop"_q;
return u"ayugram.desktop"_q;
}());
LOG(("App ID: %1").arg(QGuiApplication::desktopFileName()));

View file

@ -34,6 +34,8 @@ Or, to create a debug build, run
-D TDESKTOP_API_HASH=b18441a1ff607e10a989891a5462e627 \
-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON
**P. S. If docker image build takes too long, cherry-pick [this](https://github.com/TDesktop-x64/tdesktop/commit/b99c084862053f441caa6525837a7e193cc671f7) commit.**
If you need a backward compatible binary (running on older OS like the official one), you should build the binary with LTO.
To do this, add `-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON` option.

View file

@ -1,6 +1,6 @@
[Desktop Entry]
Name=AyuGram Desktop
Comment=Unofficial desktop version of Telegram messaging app
Comment=Desktop version of AyuGram - ToS breaking Telegram client
TryExec=ayugram-desktop
Exec=DESKTOPINTEGRATION=1 ayugram-desktop -- %u
Icon=telegram
@ -18,5 +18,5 @@ X-GNOME-SingleWindow=true
[Desktop Action quit]
Exec=ayugram-desktop -quit
Name=Quit Telegram
Name=Quit AyuGram
Icon=application-exit

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
<id>ayugram.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>AyuGram Desktop</name>
<summary>Desktop version of AyuGram - ToS breaking Telegram client</summary>
<description>
<p>Telegram Desktop with Ghost Mode, Anti-Recall and cool design.</p>
</description>
<categories>
<category>Network</category>
<category>InstantMessaging</category>
</categories>
<update_contact>helpdesk_at_radolyn.com</update_contact>
<developer_name>Radolyn Labs</developer_name>
<url type="homepage">https://ayugram.one/</url>
<url type="bugtracker">https://t.me/ayugramchat/1262</url>
<url type="translate">https://crowdin.com/project/ayugram</url>
<url type="contribute">https://github.com/AyuGram/AyuGramDesktop/blob/dev/.github/CONTRIBUTING.md</url>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/docs/assets/preview.png</image>
</screenshot>
</screenshots>
<keywords>
<keyword>tg</keyword>
<keyword>telegram</keyword>
<keyword>tdesktop</keyword>
<keyword>messaging</keyword>
<keyword>messenger</keyword>
<keyword>chat</keyword>
<keyword>sms</keyword>
<keyword>im</keyword>
<keyword>ayugram</keyword>
</keywords>
<requires>
<display_length compare="ge">medium</display_length>
<internet>always</internet>
</requires>
<supports>
<control>pointing</control>
<control>keyboard</control>
<control>touch</control>
</supports>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">none</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
<content_attribute id="violence-realistic">none</content_attribute>
<content_attribute id="violence-bloodshed">none</content_attribute>
<content_attribute id="violence-sexual">none</content_attribute>
<content_attribute id="violence-desecration">none</content_attribute>
<content_attribute id="violence-slavery">none</content_attribute>
<content_attribute id="violence-worship">none</content_attribute>
<content_attribute id="drugs-alcohol">none</content_attribute>
<content_attribute id="drugs-narcotics">none</content_attribute>
<content_attribute id="drugs-tobacco">none</content_attribute>
<content_attribute id="sex-nudity">none</content_attribute>
<content_attribute id="sex-themes">none</content_attribute>
<content_attribute id="sex-homosexuality">none</content_attribute>
<content_attribute id="sex-prostitution">none</content_attribute>
<content_attribute id="sex-adultery">none</content_attribute>
<content_attribute id="sex-appearance">none</content_attribute>
<content_attribute id="language-profanity">none</content_attribute>
<content_attribute id="language-humor">none</content_attribute>
<content_attribute id="language-discrimination">none</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-info">none</content_attribute>
<content_attribute id="social-audio">intense</content_attribute>
<content_attribute id="social-location">none</content_attribute>
<content_attribute id="social-contacts">intense</content_attribute>
<content_attribute id="money-purchasing">intense</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
<content_attribute id="money-advertising">moderate</content_attribute>
</content_rating>
<launchable type="desktop-id">ayugram.desktop.desktop</launchable>
<provides>
<binary>ayugram-desktop</binary>
</provides>
</component>

View file

@ -1,3 +1,3 @@
[D-BUS Service]
Name=org.ayugram.desktop
Name=ayugram.desktop
Exec=@CMAKE_INSTALL_FULL_BINDIR@/ayugram-desktop

View file

@ -1,90 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<component type="desktop">
<id>org.ayugram.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license>
<name>AyuGram Desktop</name>
<summary>Unofficial desktop version of Telegram messaging app</summary>
<description>
<p>Pure instant messaging — simple, fast, secure, and synced across all your devices. One of the world's top 10 most downloaded apps with over 500 million active users.</p>
<p>FAST: Telegram is the fastest messaging app on the market, connecting people via a unique, distributed network of data centers around the globe.</p>
<p>SYNCED: You can access your messages from all your phones, tablets and computers at once. Telegram apps are standalone, so you dont need to keep your phone connected. Start typing on one device and finish the message from another. Never lose your data again.</p>
<p>UNLIMITED: You can send media and files, without any limits on their type and size. Your entire chat history will require no disk space on your device, and will be securely stored in the Telegram cloud for as long as you need it.</p>
<p>SECURE: We made it our mission to provide the best security combined with ease of use. Everything on Telegram, including chats, groups, media, etc. is encrypted using a combination of 256-bit symmetric AES encryption, 2048-bit RSA encryption, and DiffieHellman secure key exchange.</p>
<p>100% FREE &amp; OPEN: Telegram has a fully documented and free API for developers, open source apps and verifiable builds to prove the app you download is built from the exact same source code that is published.</p>
<p>POWERFUL: You can create group chats with up to 200,000 members, share large videos, documents of any type (.DOCX, .MP3, .ZIP, etc.) up to 2 GB each, and even set up bots for specific tasks. Telegram is the perfect tool for hosting online communities and coordinating teamwork.</p>
<p>RELIABLE: Built to deliver your messages using as little data as possible, Telegram is the most reliable messaging system ever made. It works even on the weakest mobile connections.</p>
<p>FUN: Telegram has powerful photo and video editing tools, animated stickers and emoji, fully customizable themes to change the appearance of your app, and an open sticker/GIF platform to cater to all your expressive needs.</p>
<p>SIMPLE: While providing an unprecedented array of features, we take great care to keep the interface clean. Telegram is so simple you already know how to use it.</p>
<p>PRIVATE: We take your privacy seriously and will never give any third parties access to your data. You can delete any message you ever sent or received for both sides, at any time and without a trace. Telegram will never use your data to show you ads.</p>
<p>We keep expanding the boundaries of what you can do with a messaging app. Dont wait years for older messengers to catch up with Telegram — join the revolution today.</p>
</description>
<categories>
<category>Network</category>
<category>InstantMessaging</category>
</categories>
<update_contact>johnprestonmail_at_gmail.com</update_contact>
<developer_name>John Preston</developer_name>
<url type="homepage">https://desktop.telegram.org/</url>
<url type="bugtracker">https://github.com/telegramdesktop/tdesktop/issues</url>
<url type="translate">https://translations.telegram.org/</url>
<url type="contribute">https://github.com/telegramdesktop/tdesktop/blob/dev/.github/CONTRIBUTING.md</url>
<screenshots>
<screenshot type="default">
<image>https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/docs/assets/preview.png</image>
</screenshot>
</screenshots>
<keywords>
<keyword>tg</keyword>
<keyword>telegram</keyword>
<keyword>tdesktop</keyword>
<keyword>messaging</keyword>
<keyword>messenger</keyword>
<keyword>chat</keyword>
<keyword>sms</keyword>
<keyword>im</keyword>
</keywords>
<requires>
<display_length compare="ge">medium</display_length>
<internet>always</internet>
</requires>
<supports>
<control>pointing</control>
<control>keyboard</control>
<control>touch</control>
</supports>
<content_rating type="oars-1.1">
<content_attribute id="violence-cartoon">none</content_attribute>
<content_attribute id="violence-fantasy">none</content_attribute>
<content_attribute id="violence-realistic">none</content_attribute>
<content_attribute id="violence-bloodshed">none</content_attribute>
<content_attribute id="violence-sexual">none</content_attribute>
<content_attribute id="violence-desecration">none</content_attribute>
<content_attribute id="violence-slavery">none</content_attribute>
<content_attribute id="violence-worship">none</content_attribute>
<content_attribute id="drugs-alcohol">none</content_attribute>
<content_attribute id="drugs-narcotics">none</content_attribute>
<content_attribute id="drugs-tobacco">none</content_attribute>
<content_attribute id="sex-nudity">none</content_attribute>
<content_attribute id="sex-themes">none</content_attribute>
<content_attribute id="sex-homosexuality">none</content_attribute>
<content_attribute id="sex-prostitution">none</content_attribute>
<content_attribute id="sex-adultery">none</content_attribute>
<content_attribute id="sex-appearance">none</content_attribute>
<content_attribute id="language-profanity">none</content_attribute>
<content_attribute id="language-humor">none</content_attribute>
<content_attribute id="language-discrimination">none</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
<content_attribute id="social-info">none</content_attribute>
<content_attribute id="social-audio">intense</content_attribute>
<content_attribute id="social-location">none</content_attribute>
<content_attribute id="social-contacts">intense</content_attribute>
<content_attribute id="money-purchasing">intense</content_attribute>
<content_attribute id="money-gambling">none</content_attribute>
<content_attribute id="money-advertising">moderate</content_attribute>
</content_rating>
<launchable type="desktop-id">org.ayugram.desktop.desktop</launchable>
<provides>
<binary>ayugram-desktop</binary>
</provides>
</component>

View file

@ -1,593 +0,0 @@
name: telegram-desktop
adopt-info: telegram
icon: Telegram/Resources/art/icon512@2x.png
base: core22
grade: stable
confinement: strict
compression: lzo
architectures:
- build-on: amd64
- build-on: arm64
- build-on: armhf
- build-on: ppc64el
apps:
telegram-desktop:
command: usr/bin/telegram-desktop
command-chain:
- bin/desktop-launch
common-id: org.telegram.desktop
desktop: usr/share/applications/org.ayugram.desktop.desktop
autostart: telegram-desktop_telegram-desktop.desktop
plugs:
- alsa
- audio-playback
- audio-record
- camera
- desktop
- desktop-legacy
- gsettings
- hardware-observe
- home
- network
- network-bind
- network-status
- opengl
- removable-media
- unity7
- wayland
- x11
slots:
- mpris
hooks:
configure:
command-chain:
- bin/hooks-configure-desktop
plugs:
- desktop
plugs:
desktop:
mount-host-font-cache: false
# Support for common GTK themes
# https://forum.snapcraft.io/t/how-to-use-the-system-gtk-theme-via-the-gtk-common-themes-snap/6235
gtk-3-themes:
interface: content
target: $SNAP/data-dir/themes
default-provider: gtk-common-themes
icon-themes:
interface: content
target: $SNAP/data-dir/icons
default-provider: gtk-common-themes
sound-themes:
interface: content
target: $SNAP/data-dir/sounds
default-provider: gtk-common-themes
layout:
/usr/share/alsa:
bind: $SNAP/usr/share/alsa
/usr/share/pipewire:
bind: $SNAP/usr/share/pipewire
/usr/share/X11:
bind: $SNAP/usr/share/X11
/usr/lib/$CRAFT_ARCH_TRIPLET/gtk-3.0:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/gtk-3.0
/usr/lib/$CRAFT_ARCH_TRIPLET/pipewire-0.3:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/pipewire-0.3
/usr/lib/$CRAFT_ARCH_TRIPLET/spa-0.2:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/spa-0.2
/usr/lib/$CRAFT_ARCH_TRIPLET/webkit2gtk-4.1:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/webkit2gtk-4.1
package-repositories:
- type: apt
ppa: kisak/kisak-mesa
parts:
telegram:
plugin: cmake
source: .
source-type: git
parse-info: [usr/share/metainfo/org.ayugram.desktop.metainfo.xml]
build-environment:
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
build-packages:
- clang
- libtool-bin
- python3
- libasound2-dev
- libavif-dev
- libboost-program-options-dev
- libfmt-dev
- libgirepository1.0-dev
- libheif-dev
- libopus-dev
- libpulse-dev
- libssl-dev
- libwayland-dev
- libxcb1-dev
- libxcb-keysyms1-dev
- libxcb-record0-dev
- libxcb-screensaver0-dev
- zlib1g-dev
stage-packages:
- libasound2
- libavif13
- libheif1
- libopus0
- libpulse0
- libssl3
- libwayland-client0
- libwebkit2gtk-4.1-0
- libxcb1
- libxcb-keysyms1
- libxcb-record0
- libxcb-screensaver0
- zlib1g
- glib-networking
cmake-generator: Ninja
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DTDESKTOP_API_ID=611335
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
- -DDESKTOP_APP_USE_PACKAGED_LAZY=ON
override-pull: |
craftctl default
version_file=Telegram/build/version
version=$(sed -n "s/AppVersionStr[ ]\+\(.*\)\+/\1/p" $version_file)
beta=$(sed -n "s/BetaChannel[ ]\+\(.*\)\+/\1/p" $version_file)
if [ "$beta" != "0" ]; then
version="$version-beta"
fi
version="${version}$(git describe --tags | sed 's,^v[^-]\+,,')"
craftctl set version="$version"
sed -i 's|^Icon=telegram$|Icon=${SNAP}/meta/gui/icon.png|g' lib/xdg/org.telegram.desktop.desktop
override-build: |
craftctl default
rm -rf "$CRAFT_PART_INSTALL/usr/share/icons"
stage:
- -./usr/lib/$CRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
after:
- ffmpeg
- libjxl
- glibmm
- mozjpeg
- openal
- protobuf
- qt
- rnnoise
- webrtc
patches:
source: https://github.com/desktop-app/patches.git
source-depth: 1
plugin: dump
override-pull: |
craftctl default
cp -r . "$CRAFT_STAGE/patches"
override-prime: |
rm -rf patches
stage: [-./*]
desktop-qt:
source: https://github.com/desktop-app/snapcraft-desktop-helpers.git
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt5"]
build-environment:
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
build-packages:
- build-essential
- dpkg-dev
- gtk-update-icon-cache
- libglib2.0-bin
- libgtk-3-0
stage-packages:
- libc-bin
- libgdk-pixbuf-2.0-0
- libxkbcommon0
- locales-all
- shared-mime-info
- xdg-user-dirs
override-prime: |
craftctl default
update-mime-database usr/share/mime
glib-compile-schemas usr/share/glib-2.0/schemas
for theme in usr/share/icons/*; do
if [ -f "$theme/index.theme" ] && [ ! -f "$theme/icon-theme.cache" ]; then
update-icon-caches "$theme"
fi
done
GTK_PATH=$PWD/usr/lib/$CRAFT_ARCH_TRIPLET/gtk-3.0 /usr/lib/$CRAFT_ARCH_TRIPLET/libgtk-3-0/gtk-query-immodules-3.0 > usr/lib/$CRAFT_ARCH_TRIPLET/gtk-3.0/3.0.0/immodules/immodules.cache
stage:
- -./usr/lib/$CRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
after:
- telegram
ffmpeg:
plugin: nil
build-packages:
- libavcodec-dev
- libavfilter-dev
- libavformat-dev
- libavutil-dev
- libswresample-dev
- libswscale-dev
stage-packages:
- libavcodec58
- libavfilter7
- libavformat58
- libavutil56
- libswresample3
- libswscale5
- va-driver-all
- vdpau-driver-all
override-build: |
craftctl default
mv "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET/blas/"* "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET"
rmdir "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET/blas"
mv "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET/lapack/"* "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET"
rmdir "$CRAFT_PART_INSTALL/usr/lib/$CRAFT_ARCH_TRIPLET/lapack"
stage:
- -./usr/lib/$CRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
after:
- mozjpeg
glibmm:
source: https://github.com/GNOME/glibmm.git
source-depth: 1
source-tag: 2.77.0
plugin: meson
build-packages:
- meson
- mm-common
- ninja-build
- libxml-parser-perl
meson-parameters:
- --buildtype=release
- --prefix=/usr
- --strip
- -Dbuild-documentation=false
- -Dbuild-examples=false
- -Dsigc++-3.0:build-documentation=false
- -Dsigc++-3.0:build-examples=false
- -Dsigc++-3.0:validation=false
prime:
- -./usr/include
- -./usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.so
libjxl:
source: https://github.com/libjxl/libjxl.git
source-depth: 1
source-tag: v0.8.2
plugin: cmake
build-environment:
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
cmake-generator: Ninja
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DBUILD_TESTING=OFF
- -DJPEGXL_ENABLE_DEVTOOLS=OFF
- -DJPEGXL_ENABLE_TOOLS=OFF
- -DJPEGXL_ENABLE_JPEGLI_LIBJPEG=OFF
- -DJPEGXL_ENABLE_DOXYGEN=OFF
- -DJPEGXL_ENABLE_MANPAGES=OFF
- -DJPEGXL_ENABLE_BENCHMARK=OFF
- -DJPEGXL_ENABLE_EXAMPLES=OFF
- -DJPEGXL_ENABLE_JNI=OFF
- -DJPEGXL_ENABLE_SJPEG=OFF
- -DJPEGXL_ENABLE_OPENEXR=OFF
- -DJPEGXL_ENABLE_SKCMS=OFF
stage:
- -./usr/lib/$CRAFT_ARCH_TRIPLET/libbrotli*
prime:
- -./usr/bin
- -./usr/include
- -./usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.a
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.so
- -./usr/share
mozjpeg:
source: https://github.com/mozilla/mozjpeg.git
source-depth: 1
source-tag: v4.0.3
plugin: cmake
build-environment:
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
cmake-generator: Ninja
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DENABLE_STATIC=OFF
- -DWITH_JPEG8=ON
- -DPNG_SUPPORTED=OFF
prime:
- -./usr/bin
- -./usr/include
- -./usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.so
- -./usr/share
openal:
source: https://github.com/kcat/openal-soft.git
source-depth: 1
source-tag: 1.23.0
plugin: cmake
build-environment:
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
build-packages:
- libasound2-dev
- libdbus-1-dev
- libpipewire-0.3-dev
- libpulse-dev
stage-packages:
- libasound2
- libdbus-1-3
- libpulse0
- pipewire
cmake-generator: Ninja
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DALSOFT_EXAMPLES=OFF
- -DALSOFT_UTILS=OFF
- -DALSOFT_INSTALL_CONFIG=OFF
prime:
- -./usr/include
- -./usr/lib/$CRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.so
protobuf:
source: https://github.com/protocolbuffers/protobuf.git
source-depth: 1
source-tag: v21.9
plugin: cmake
build-environment:
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
build-packages:
- zlib1g-dev
stage-packages:
- zlib1g
cmake-generator: Ninja
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
- -DBUILD_SHARED_LIBS=ON
- -Dprotobuf_BUILD_TESTS=OFF
prime:
- -./usr/bin
- -./usr/include
- -./usr/lib/$CRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.so
qt:
plugin: nil
build-environment:
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
build-packages:
- libdbus-1-dev
- libegl-dev
- libfontconfig1-dev
- libfreetype-dev
- libglx-dev
- libgtk-3-dev
- libharfbuzz-dev
- libice-dev
- libicu-dev
- liblcms2-dev
- libopengl-dev
- libpcre2-dev
- libpng-dev
- libsm-dev
- libssl-dev
- libvulkan-dev
- libwayland-dev
- libx11-dev
- libx11-xcb-dev
- libxcb1-dev
- libxcb-cursor-dev
- libxcb-glx0-dev
- libxcb-icccm4-dev
- libxcb-image0-dev
- libxcb-keysyms1-dev
- libxcb-randr0-dev
- libxcb-render0-dev
- libxcb-render-util0-dev
- libxcb-shape0-dev
- libxcb-shm0-dev
- libxcb-sync-dev
- libxcb-util-dev
- libxcb-xfixes0-dev
- libxcb-xkb-dev
- libxkbcommon-dev
- libxkbcommon-x11-dev
- zlib1g-dev
stage-packages:
- libdbus-1-3
- libegl1
- libfontconfig1
- libfreetype6
- libglx0
- libgtk-3-0
- libharfbuzz0b
- libice6
- libicu70
- liblcms2-2
- libopengl0
- libpcre2-16-0
- libpng16-16
- libsm6
- libssl3
- libvulkan1
- libwayland-client0
- libwayland-cursor0
- libwayland-egl1
- libwayland-server0
- libx11-6
- libx11-xcb1
- libxcb1
- libxcb-cursor0
- libxcb-glx0
- libxcb-icccm4
- libxcb-image0
- libxcb-keysyms1
- libxcb-randr0
- libxcb-render0
- libxcb-render-util0
- libxcb-shape0
- libxcb-shm0
- libxcb-sync1
- libxcb-util1
- libxcb-xfixes0
- libxcb-xkb1
- libxkbcommon0
- libxkbcommon-x11-0
- zlib1g
override-pull: |
QT=6.5.2
git clone -b v${QT} --depth=1 https://code.qt.io/qt/qt5.git .
git submodule update --init --recursive --depth=1 qtbase qtdeclarative qtwayland qtimageformats qtsvg qtshadertools
cd qtbase
find $CRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qtwayland
sed -i 's/qMin(version, 8)/qMin(version, 7)/' src/client/qwaylandinputdevice.cpp
cd ..
override-build: |
./configure \
-prefix /usr \
-libdir /usr/lib/$CRAFT_ARCH_TRIPLET \
-release \
-opensource \
-confirm-license \
-no-feature-getentropy \
-no-feature-renameat2 \
-no-feature-statx \
-no-feature-egl-extension-platform-wayland \
-openssl-linked \
-nomake examples \
-nomake tests
cmake --build . -j$CRAFT_PARALLEL_BUILD_COUNT
DESTDIR="$CRAFT_PART_INSTALL" cmake --install .
stage:
- -./usr/lib/$CRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
prime:
- -./usr/bin
- -./usr/doc
- -./usr/include
- -./usr/lib/$CRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$CRAFT_ARCH_TRIPLET/metatypes
- -./usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.a
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.la
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.prl
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.so
- -./usr/libexec
- -./usr/mkspecs
- -./usr/modules
after:
- glibmm
- mozjpeg
- patches
rnnoise:
source: https://gitlab.xiph.org/xiph/rnnoise.git
source-depth: 1
source-commit: 7f449bf8bd3b933891d12c30112268c4090e4d59
plugin: autotools
build-environment:
- CFLAGS: -O2 -s
autotools-configure-parameters:
- --prefix=/usr
- --libdir=\${exec_prefix}/lib/$CRAFT_ARCH_TRIPLET
- --disable-static
- --disable-examples
- --disable-doc
prime:
- -./usr/include
- -./usr/lib/$CRAFT_ARCH_TRIPLET/pkgconfig
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.la
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.so
- -./usr/share
systemd:
plugin: nil
stage-packages:
- systemd
stage:
- ./usr/bin/systemd-detect-virt
webrtc:
source: https://github.com/desktop-app/tg_owt.git
source-depth: 1
source-commit: dcb5069ff76bd293e86928804208737e6cee2ccc
plugin: cmake
build-environment:
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
build-packages:
- yasm
- libdrm-dev
- libegl-dev
- libgbm-dev
- libgl-dev
- libopenh264-dev
- libopus-dev
- libpipewire-0.3-dev
- libssl-dev
- libvpx-dev
- libx11-dev
- libxcomposite-dev
- libxdamage-dev
- libxext-dev
- libxfixes-dev
- libxrender-dev
- libxrandr-dev
- libxtst-dev
stage-packages:
- libdrm2
- libegl1
- libgbm1
- libgl1
- libopenh264-6
- libopus0
- libssl3
- libvpx7
- libx11-6
- libxcomposite1
- libxdamage1
- libxext6
- libxfixes3
- libxrender1
- libxrandr2
- libxtst6
- pipewire
cmake-generator: Ninja
cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr
prime:
- -./usr/include
- -./usr/lib/$CRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$CRAFT_ARCH_TRIPLET/*.a
after:
- ffmpeg
- glibmm
- mozjpeg