mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
fix: make it build
This commit is contained in:
@@ -1,47 +0,0 @@
|
|||||||
name: Changelog
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [dev]
|
|
||||||
paths: [changelog.txt]
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: pages
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v6
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
|
|
||||||
- name: Generate HTML
|
|
||||||
run: python .github/scripts/generate_changelog.py
|
|
||||||
|
|
||||||
- name: Upload pages artifact
|
|
||||||
uses: actions/upload-pages-artifact@v4
|
|
||||||
with:
|
|
||||||
path: docs
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
needs: build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deploy.outputs.page_url }}
|
|
||||||
steps:
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
id: deploy
|
|
||||||
uses: actions/deploy-pages@v5
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
name: Unused styles updater.
|
|
||||||
|
|
||||||
on:
|
|
||||||
repository_dispatch:
|
|
||||||
types: ["Restart unused_styles_updater workflow."]
|
|
||||||
schedule:
|
|
||||||
- cron: "0 3 1 * *"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Unused-styles:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: desktop-app/action_code_updater@master
|
|
||||||
with:
|
|
||||||
type: "unused-styles"
|
|
||||||
@@ -2,116 +2,9 @@
|
|||||||
|
|
||||||
This guide defines repository-wide instructions for coding agents working with the Telegram Desktop codebase.
|
This guide defines repository-wide instructions for coding agents working with the Telegram Desktop codebase.
|
||||||
|
|
||||||
## Build System Structure
|
Avoid building the project.
|
||||||
|
|
||||||
The build system expects this directory layout:
|
If you're asked to create a Pull Request, then clearly state in PR description that it was AI generated.
|
||||||
|
|
||||||
```text
|
|
||||||
L:\Telegram\ # BuildPath
|
|
||||||
L:\Telegram\tdesktop\ # Repository (you work here)
|
|
||||||
L:\Telegram\Libraries\ # 32-bit dependencies (Linux/macOS)
|
|
||||||
L:\Telegram\win64\Libraries\ # 64-bit dependencies (Windows)
|
|
||||||
L:\Telegram\ThirdParty\ # Build tools (NuGet, Python, etc.)
|
|
||||||
```
|
|
||||||
|
|
||||||
Dependencies are located relative to the repository: `../Libraries`, `../win64/Libraries`, or `../ThirdParty`.
|
|
||||||
|
|
||||||
## Build Configuration
|
|
||||||
|
|
||||||
### Build Commands
|
|
||||||
|
|
||||||
**From repository root, run:**
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cmake --build out --config Debug --target Telegram
|
|
||||||
```
|
|
||||||
|
|
||||||
That's it. The `out/` directory is already configured. The executable will be at `out/Debug/Telegram.exe`.
|
|
||||||
|
|
||||||
**Important:** When running cmake from a shell that doesn't support `cd`, use quoted absolute paths:
|
|
||||||
```bash
|
|
||||||
cmake --build "l:\Telegram\tx64\out" --config Debug --target Telegram
|
|
||||||
```
|
|
||||||
|
|
||||||
**Never build Release** - it's extremely heavy and not needed for testing changes.
|
|
||||||
|
|
||||||
## Platform-Specific Requirements
|
|
||||||
|
|
||||||
### Windows
|
|
||||||
- Requires Visual Studio 2022
|
|
||||||
- Must run from appropriate Native Tools Command Prompt:
|
|
||||||
- "x64 Native Tools Command Prompt" for `win64`
|
|
||||||
- "x86 Native Tools Command Prompt" for `win`
|
|
||||||
- "ARM64 Native Tools Command Prompt" for `winarm`
|
|
||||||
- Dependencies: `../win64/Libraries` (64-bit) or `../Libraries` (32-bit)
|
|
||||||
|
|
||||||
### macOS
|
|
||||||
- Requires Xcode
|
|
||||||
- Dependencies: `../Libraries/local/Qt-*`
|
|
||||||
- Set `QT` environment variable: `export QT=6.8`
|
|
||||||
|
|
||||||
### Linux
|
|
||||||
- Build dependencies in `../Libraries`
|
|
||||||
- Set `QT` environment variable if needed
|
|
||||||
|
|
||||||
## Key Files
|
|
||||||
|
|
||||||
- **`Telegram/build/version`** - Version information
|
|
||||||
- **`out/`** - Build output directory
|
|
||||||
|
|
||||||
## Troubleshooting
|
|
||||||
|
|
||||||
### "Libraries not found"
|
|
||||||
Ensure the repository is in `L:\Telegram\tdesktop`. The build system requires `../win64/Libraries` to exist.
|
|
||||||
|
|
||||||
### Build fails with "wrong command prompt"
|
|
||||||
On Windows, use the correct Visual Studio Native Tools Command Prompt matching your target (x64/x86/ARM64).
|
|
||||||
|
|
||||||
### Build fails with PDB or EXE access errors
|
|
||||||
|
|
||||||
**âš ï¸ CRITICAL: DO NOT RETRY THE BUILD. STOP AND WAIT FOR USER.**
|
|
||||||
|
|
||||||
If the build fails with ANY of these errors:
|
|
||||||
- `fatal error C1041: cannot open program database`
|
|
||||||
- `cannot open output file 'Telegram.exe'`
|
|
||||||
- `LNK1104: cannot open file`
|
|
||||||
- Any "access denied" or "file in use" error
|
|
||||||
|
|
||||||
**STOP IMMEDIATELY.** These errors mean files are locked by a running process (Telegram.exe or debugger).
|
|
||||||
|
|
||||||
**What to do:**
|
|
||||||
1. Do NOT attempt another build - it will fail the same way
|
|
||||||
2. Do NOT try to delete files - they are locked
|
|
||||||
3. Do NOT try any workarounds or fixes
|
|
||||||
4. IMMEDIATELY inform the user:
|
|
||||||
|
|
||||||
> "Build failed - files are locked. Please close Telegram.exe (and any debugger) so I can rebuild."
|
|
||||||
|
|
||||||
**Then WAIT for user confirmation before attempting any build.**
|
|
||||||
|
|
||||||
Retrying builds wastes time and context. The ONLY fix is for the user to close the running process.
|
|
||||||
|
|
||||||
## Best Practices
|
|
||||||
|
|
||||||
1. **Always use Debug builds** - Release builds are extremely heavy
|
|
||||||
2. **Don't build Release configuration** - it's too heavy for testing
|
|
||||||
|
|
||||||
## Text File Format
|
|
||||||
|
|
||||||
- On Windows, keep project text files with CRLF line endings.
|
|
||||||
- Do not save source, header, build/config, style, or localization files as UTF-8 with BOM. Use UTF-8 without BOM.
|
|
||||||
- When rewriting project text files for normalization, preserve file content otherwise and do not introduce a BOM.
|
|
||||||
|
|
||||||
## Local Storage Serialization
|
|
||||||
|
|
||||||
Both app-level (`Core::Settings`) and session-level (`Main::SessionSettings`) use sequential binary serialization via `QDataStream`. Key rules:
|
|
||||||
|
|
||||||
- New fields must ALWAYS be appended at the **end** of the stream, never inserted in the middle
|
|
||||||
- Reading new fields must be guarded with `!stream.atEnd()` and provide a meaningful default/fallback
|
|
||||||
- Inserting in the middle breaks reading of data saved by older versions (the new read code consumes bytes that belong to subsequent fields)
|
|
||||||
- For simple flags and values, prefer using the generic KV prefs facility (`writePref<Type>` / `readPref<Type>`) instead of adding to the binary stream -- this avoids serialization ordering issues entirely
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
# Development Guidelines
|
# Development Guidelines
|
||||||
|
|
||||||
@@ -449,4 +342,3 @@ The `Error` template parameter defaults to `rpl::no_error`: `rpl::producer<Type,
|
|||||||
- Pass `rpl::lifetime` to `on_...` methods or store returned lifetime
|
- Pass `rpl::lifetime` to `on_...` methods or store returned lifetime
|
||||||
- Use `rpl::duplicate(producer)` to reuse a producer multiple times
|
- Use `rpl::duplicate(producer)` to reuse a producer multiple times
|
||||||
- Combined producers automatically unpack tuples in lambdas (works with `rpl::map`, `rpl::filter`, and `rpl::on_next`)
|
- Combined producers automatically unpack tuples in lambdas (works with `rpl::map`, `rpl::filter`, and `rpl::on_next`)
|
||||||
|
|
||||||
|
|||||||
@@ -2498,18 +2498,18 @@ if (LINUX AND DESKTOP_APP_USE_PACKAGED)
|
|||||||
generate_appstream_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.metainfo.xml")
|
generate_appstream_changelog(Telegram "${CMAKE_SOURCE_DIR}/changelog.txt" "${CMAKE_CURRENT_BINARY_DIR}/com.ayugram.desktop.metainfo.xml")
|
||||||
install(TARGETS Telegram RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" BUNDLE DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
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 "com.ayugram.desktop.png")
|
install(FILES "Resources/art/icon16.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon16@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16@2/apps" RENAME "org.telegram.desktop.png")
|
install(FILES "Resources/art/icon16@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/16x16@2/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "org.telegram.desktop.png")
|
install(FILES "Resources/art/icon32.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon32@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32@2/apps" RENAME "com.ayugram.desktop.png")
|
install(FILES "Resources/art/icon32@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/32x32@2/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "org.telegram.desktop.png")
|
install(FILES "Resources/art/icon48.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon48@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48@2/apps" RENAME "org.telegram.desktop.png")
|
install(FILES "Resources/art/icon48@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48@2/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "com.ayugram.desktop.png")
|
install(FILES "Resources/art/icon64.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon64@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64@2/apps" RENAME "com.ayugram.desktop.png")
|
install(FILES "Resources/art/icon64@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64@2/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "org.telegram.desktop.png")
|
install(FILES "Resources/art/icon128.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon128@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128@2/apps" RENAME "org.telegram.desktop.png")
|
install(FILES "Resources/art/icon128@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128@2/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "com.ayugram.desktop.png")
|
install(FILES "Resources/art/icon256.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon256@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256@2/apps" RENAME "com.ayugram.desktop.png")
|
install(FILES "Resources/art/icon256@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256@2/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "org.telegram.desktop.png")
|
install(FILES "Resources/art/icon512.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/art/icon512@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512@2/apps" RENAME "com.ayugram.desktop.png")
|
install(FILES "Resources/art/icon512@2x.png" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512@2/apps" RENAME "com.ayugram.desktop.png")
|
||||||
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "com.ayugram.desktop-symbolic.svg")
|
install(FILES "Resources/icons/tray_monochrome.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "com.ayugram.desktop-symbolic.svg")
|
||||||
install(FILES "Resources/icons/tray_monochrome_attention.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "com.ayugram.desktop-attention-symbolic.svg")
|
install(FILES "Resources/icons/tray_monochrome_attention.svg" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/symbolic/apps" RENAME "com.ayugram.desktop-attention-symbolic.svg")
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ rpl::producer<TextWithEntities> Text() {
|
|||||||
lt_gpl_link,
|
lt_gpl_link,
|
||||||
rpl::single(Ui::Text::Link(
|
rpl::single(Ui::Text::Link(
|
||||||
"GNU GPL",
|
"GNU GPL",
|
||||||
"https://github.com/AyuGram/AyuGramDesktop/blob/master/LICENSE")),
|
"https://github.com/AyuGram/AyuGramDesktop/blob/dev/LICENSE")),
|
||||||
lt_github_link,
|
lt_github_link,
|
||||||
rpl::single(Ui::Text::Link(
|
rpl::single(Ui::Text::Link(
|
||||||
"GitHub",
|
"GitHub",
|
||||||
|
|||||||
@@ -712,7 +712,6 @@ HistoryWidget::HistoryWidget(
|
|||||||
item->mainView()->itemDataChanged();
|
item->mainView()->itemDataChanged();
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
|
|
||||||
rpl::merge(
|
rpl::merge(
|
||||||
session().changes().peerUpdates(
|
session().changes().peerUpdates(
|
||||||
Data::PeerUpdate::Flag::IsBlocked
|
Data::PeerUpdate::Flag::IsBlocked
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
namespace HistoryView {
|
namespace HistoryView {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
constexpr auto kPlayStatusLimit = 2;
|
constexpr auto kPlayStatusLimit = 12;
|
||||||
constexpr auto kMaxWidth = (1 << 16) - 1;
|
constexpr auto kMaxWidth = (1 << 16) - 1;
|
||||||
constexpr auto kMaxNiceToReadLines = 6;
|
constexpr auto kMaxNiceToReadLines = 6;
|
||||||
const auto kPsaTooltipPrefix = "cloud_lng_tooltip_psa_";
|
const auto kPsaTooltipPrefix = "cloud_lng_tooltip_psa_";
|
||||||
|
|||||||
@@ -291,11 +291,11 @@ void Manager::buildAppleMenu(QMenu *main) {
|
|||||||
{
|
{
|
||||||
auto callback = [this] {
|
auto callback = [this] {
|
||||||
withActiveWindow([](not_null<Window::Controller*> window) {
|
withActiveWindow([](not_null<Window::Controller*> window) {
|
||||||
window->show(Box(AboutBox));
|
window->show(Box(AboutBox, window->sessionController()));
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const auto about = main->addAction(
|
const auto about = main->addAction(
|
||||||
u"About Telegram"_q,
|
u"About AyuGram"_q,
|
||||||
std::move(callback));
|
std::move(callback));
|
||||||
about->setMenuRole(QAction::AboutQtRole);
|
about->setMenuRole(QAction::AboutQtRole);
|
||||||
}
|
}
|
||||||
@@ -551,7 +551,7 @@ void Manager::buildWindowMenu(QMenu *window) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Manager::buildMenu() {
|
void Manager::buildMenu() {
|
||||||
buildAppleMenu(_menuBar->addMenu(u"Telegram"_q));
|
buildAppleMenu(_menuBar->addMenu(u"AyuGram"_q));
|
||||||
buildFileMenu(_menuBar->addMenu(u"File"_q));
|
buildFileMenu(_menuBar->addMenu(u"File"_q));
|
||||||
buildEditMenu(_menuBar->addMenu(u"Edit"_q));
|
buildEditMenu(_menuBar->addMenu(u"Edit"_q));
|
||||||
buildWindowMenu(_menuBar->addMenu(u"Window"_q));
|
buildWindowMenu(_menuBar->addMenu(u"Window"_q));
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
|||||||
#include "ayu/ui/utils/ayu_profile_values.h"
|
#include "ayu/ui/utils/ayu_profile_values.h"
|
||||||
#include "ayu/utils/telegram_helpers.h"
|
#include "ayu/utils/telegram_helpers.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Settings {
|
namespace Settings {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule Telegram/lib_ui updated: cf3632f5a7...51673cadc1
Reference in New Issue
Block a user