[Docs] Basic documentation and CI

This commit is contained in:
Eric Kotato 2022-08-08 03:37:23 +03:00 committed by Eric Kotato
parent fd3ce905c0
commit 8b3b62ee3f
17 changed files with 864 additions and 168 deletions

View file

@ -1,10 +1,11 @@
# Contributing # Contributing
This document describes how you can contribute to Telegram Desktop. Please read it carefully. This document describes how you can contribute to Kotatogram Desktop. Please read it carefully.
**Table of Contents** **Table of Contents**
* [What contributions are accepted](#what-contributions-are-accepted) * [What contributions are accepted](#what-contributions-are-accepted)
* [Contributing translations](#contributing-translations)
* [Build instructions](#build-instructions) * [Build instructions](#build-instructions)
* [Pull upstream changes into your fork regularly](#pull-upstream-changes-into-your-fork-regularly) * [Pull upstream changes into your fork regularly](#pull-upstream-changes-into-your-fork-regularly)
* [How to get your pull request accepted](#how-to-get-your-pull-request-accepted) * [How to get your pull request accepted](#how-to-get-your-pull-request-accepted)
@ -17,29 +18,46 @@ This document describes how you can contribute to Telegram Desktop. Please read
## What contributions are accepted ## 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]. Before contribute to Kotatogram Desktop, you could try to contribute to Telegram Desktop in following cases:
Wait for us. We try to review your pull requests as fast as possible. * Bug fixes of original Telegram Desktop features
If we find issues with your pull request, we may suggest some changes and improvements. * Optimization of Telegram Desktop's source code and documentation
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 your PR is merged into the official app, it will help both apps (as well as many other Telegram Desktop forks). Be sure to read its [CONTRIBUTING.md][tdesktop_contributing] before trying.
If you have a translations-related contribution, check out [Translations platform][translate]. If your feature couldn't be added to official Telegram Desktop (e.g. new feature), you can try to [submit a pull request here][pr].
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. Following contributions are accepted to Kotatogram Desktop:
* Bug fixes and improvements
* New features
If you are submitting a new feature, please note that:
* It **must** be tested: we need these features to work, and work correctly.
* It **must not** confilct with exsiting features. If it's an alternative way of making this feature (e.g. showing text in other place), you should improve existing feature, and give user a choice unless there is no logical reasons for making a choice.
* It **must** look as good and refined as possible. I can accept some "dirty" solutions, but in that case they should be optional, and disabled by default. Still, too "dirty" solution won't be accepted.
* It **must not** violate [Telegram API Terms of Service][api_tos], e.g. features like Ghost Mode won't be implemented.
## Contributing translations
Translation contributions are currently accepted on [Crowdin](https://crowdin.com/project/kotatogram-desktop). Even though you can open an issue about translation here (e.g. requesting a new language) or submit a PR, Crowdin is the prefered way.
Please note: if you submit a PR with translation, it won't be merged. Instead it will be updated on Crowdin.
## Build instructions ## Build instructions
See the [README.md][build_instructions] for details on the various build Build instructions of Kotatogram Desktop are practically same, as Telegram Desktop's. See the [README.md][build_instructions] for details on the various build environments.
environments.
Of course, you should clone `https://github.com/kotatogram/kotatogram-desktop.git` instead of `https://github.com/telegramdesktop/tdesktop.git`.
## Pull upstream changes into your fork regularly ## Pull upstream changes into your fork regularly
Telegram Desktop is advancing quickly. It is therefore critical that you pull upstream changes into your fork on a regular basis. Nothing is worse than putting in a days of hard work into a pull request only to have it rejected because it has diverged too far from upstream. Kotatogram Desktop is advancing quickly. It is therefore critical that you pull upstream changes into your fork on a regular basis. Nothing is worse than putting in a days of hard work into a pull request only to have it rejected because it has diverged too far from upstream.
To pull in upstream changes: To pull in upstream changes:
git remote add upstream https://github.com/telegramdesktop/tdesktop.git git remote add upstream https://github.com/kotatogram/kotatogram-desktop.git
git fetch upstream master git fetch upstream master
Check the log to be sure that you actually want the changes, before merging: Check the log to be sure that you actually want the changes, before merging:
@ -58,7 +76,7 @@ For more info, see [GitHub Help][help_fork_repo].
## How to get your pull request accepted ## 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 Kotatogram 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 ### Keep your pull requests limited to a single issue
@ -97,7 +115,7 @@ Furthermore, the pixel shortage is over. We want to see:
### Test your changes! ### Test your changes!
Before you submit a pull request, please test your changes. Verify that Telegram Desktop still works and your changes don't cause other issue or crashes. Before you submit a pull request, please test your changes. Verify that Kotatogram Desktop still works and your changes don't cause other issue or crashes.
### Write a good commit message ### Write a good commit message
@ -112,7 +130,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_fork_repo]: https://help.github.com/articles/fork-a-repo/
[help_change_commit_message]: https://help.github.com/articles/changing-a-commit-message/ [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 [commit_message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
[pr]: https://github.com/telegramdesktop/tdesktop/compare [pr]: https://github.com/kotatogram/kotatogram-desktop/compare
[build_instructions]: https://github.com/telegramdesktop/tdesktop/blob/master/README.md#build-instructions [build_instructions]: https://github.com/telegramdesktop/tdesktop/blob/master/README.md#build-instructions
[tdesktop_contributing]: https://github.com/telegramdesktop/tdesktop/blob/master/.github/CONTRIBUTING.md
[closing-issues-via-commit-messages]: https://help.github.com/articles/closing-issues-via-commit-messages/ [closing-issues-via-commit-messages]: https://help.github.com/articles/closing-issues-via-commit-messages/
[translate]: https://translations.telegram.org [api_tos]: https://core.telegram.org/api/terms

View file

@ -5,7 +5,7 @@ body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
Thanks for reporting issues of Telegram Desktop! Thanks for reporting issues of Kotatogram Desktop!
To make it easier for us to help you please enter detailed information below. To make it easier for us to help you please enter detailed information below.
- type: textarea - type: textarea
@ -39,7 +39,7 @@ body:
required: true required: true
- type: input - type: input
attributes: attributes:
label: Version of Telegram Desktop label: Version of Kotatogram Desktop
description: > description: >
Please note we don't support versions from Linux distro repositories. Please note we don't support versions from Linux distro repositories.
If you need support for these versions, **please contact your distro maintainer** If you need support for these versions, **please contact your distro maintainer**

30
.github/workflows/language-test.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Language test.
on:
push:
paths:
- 'Telegram/Resources/langs/rewrites/*.json'
- '.github/workflows/language-test.yml'
pull_request:
paths:
- 'Telegram/Resources/langs/rewrites/*.json'
- '.github/workflows/language-test.yml'
jobs:
test:
name: Test languages
runs-on: ubuntu-latest
steps:
- name: Clone
uses: actions/checkout@v2
- name: Trim comments
shell: bash
run: sed -i -e 's/^\s*\/\/.*$//' Telegram/Resources/langs/rewrites/*.json
- name: Test JSON for validity
shell: bash
run: |
for f in Telegram/Resources/langs/rewrites/*.json; do
echo "::group::Testing $f"
cat "$f" | jq -e '.'
echo "::endgroup::"
done

534
.github/workflows/linux-kotato.yml vendored Normal file
View file

@ -0,0 +1,534 @@
name: Linux Kotato.
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
- '!docs/building-cmake.md'
- 'kotatogram_changes.txt'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/linux-kotato.yml'
- 'snap/**'
- 'Telegram/build/**'
- 'Telegram/Patches/**'
- 'Telegram/Resources/uwp/**'
- 'Telegram/Resources/winrc/**'
- 'Telegram/SourceFiles/platform/win/**'
- 'Telegram/SourceFiles/platform/mac/**'
- 'Telegram/Telegram/**'
- 'Telegram/configure.bat'
- 'Telegram/Telegram.plist'
pull_request:
paths-ignore:
- 'docs/**'
- '**.md'
- '!docs/building-cmake.md'
- 'kotatogram_changes.txt'
- 'changelog.txt'
- 'LEGAL'
- 'LICENSE'
- '.github/**'
- '!.github/workflows/linux-kotato.yml'
- 'snap/**'
- 'Telegram/build/**'
- 'Telegram/Patches/**'
- 'Telegram/Resources/uwp/**'
- 'Telegram/Resources/winrc/**'
- 'Telegram/SourceFiles/platform/win/**'
- 'Telegram/SourceFiles/platform/mac/**'
- 'Telegram/Telegram/**'
- 'Telegram/configure.bat'
- 'Telegram/Telegram.plist'
jobs:
linux:
name: Ubuntu 18.04
if: >
!(github.event_name == 'push'
&& contains(github.event.head_commit.message, '[skip ci]'))
&& !(github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)
runs-on: ubuntu-latest
container:
image: ubuntu:bionic
options: --privileged --device /dev/fuse
strategy:
matrix:
defines:
- ""
- "DESKTOP_APP_DISABLE_DBUS_INTEGRATION"
- "DESKTOP_APP_DISABLE_X11_INTEGRATION"
- "DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION"
env:
GIT: "https://github.com"
QT: "6_2_3"
CMAKE_VER: "3.21.3"
UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false"
MANUAL_CACHING: "1"
AUTO_CACHING: "1"
CXX: "g++ -static-libstdc++"
steps:
- name: Get repository name.
run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Disable man for further package installs.
run: |
cfgFile="/etc/dpkg/dpkg.cfg.d/no_man"
touch $cfgFile
p() {
echo "path-exclude=/usr/share/$1/*" >> $cfgFile
}
p man
p locale
p doc
- name: Apt install.
run: |
apt-get update
apt-get install software-properties-common -y && \
add-apt-repository ppa:git-core/ppa -y && \
apt-get update && \
apt-get install clang libglibmm-2.4-dev libicu-dev libssl-dev liblzma-dev zlib1g-dev \
git wget autoconf automake build-essential libtool pkg-config bison yasm unzip python3-pip \
libasound2-dev libpulse-dev libfuse2 libgtk-3-dev libgtk2.0-dev libatspi2.0-dev \
libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev libxkbcommon-dev libxkbcommon-x11-dev \
libxcb1-dev libxcb-glx0-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev \
libxcb-randr0-dev libxcb-record0-dev libxcb-render0-dev libxcb-render-util0-dev \
libxcb-res0-dev libxcb-screensaver0-dev libxcb-shape0-dev libxcb-shm0-dev \
libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-xkb-dev \
libxcb-util0-dev libx11-dev libx11-xcb-dev libxext-dev libxtst-dev libxfixes-dev \
libxrandr-dev libxrender-dev libxdamage-dev libxcomposite-dev libwayland-dev \
xutils-dev meson ninja-build subversion -y --force-yes && \
add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
apt-get update && \
apt-get install gcc-10 g++-10 -y && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 60 && \
update-alternatives --config gcc && \
add-apt-repository --remove ppa:ubuntu-toolchain-r/test -y
- name: Clone.
uses: actions/checkout@v2
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
- name: First set up.
run: |
wget -c -nv "$GIT/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt-continuous-x86_64.AppImage
./linuxdeployqt-continuous-x86_64.AppImage -version
gcc --version
gcc --version > CACHE_KEY.txt
echo $MANUAL_CACHING >> CACHE_KEY.txt
if [ "$AUTO_CACHING" = "1" ]; then
thisFile=$REPO_NAME/.github/workflows/linux-kotato.yml
echo `md5sum $thisFile | cut -c -32` >> CACHE_KEY.txt
fi
md5cache=$(md5sum CACHE_KEY.txt | cut -c -32)
echo "CACHE_KEY=$md5cache" >> $GITHUB_ENV
mkdir -p Libraries
cd Libraries
echo "LibrariesPath=`pwd`" >> $GITHUB_ENV
wget -O tg_owt-version.json https://api.github.com/repos/desktop-app/tg_owt/git/refs/heads/master
- name: Patches.
run: |
cd $LibrariesPath
git clone --depth=1 $GIT/desktop-app/patches.git
- name: Rnnoise.
run: |
cd $LibrariesPath
git clone --depth=1 https://gitlab.xiph.org/xiph/rnnoise.git
cd rnnoise
./autogen.sh
./configure --disable-examples --disable-doc
make -j$(nproc)
make install
- name: CMake.
run: |
cd $LibrariesPath
file=cmake-$CMAKE_VER-Linux-x86_64.sh
wget $GIT/Kitware/CMake/releases/download/v$CMAKE_VER/$file
mkdir /opt/cmake
sh $file --prefix=/opt/cmake --skip-license
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
rm $file
cmake --version
- name: Meson.
run: |
python3 -m pip install meson==0.54.0
meson --version
- name: Ninja.
run: |
cd $LibrariesPath
wget $GIT/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip
unzip ninja-linux.zip
chmod +x ninja
mv ninja /usr/local/bin
ninja --version
- name: MozJPEG.
run: |
cd $LibrariesPath
git clone -b v4.0.3 --depth=1 $GIT/mozilla/mozjpeg.git
cd mozjpeg
cmake -B build -GNinja . \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DWITH_JPEG8=ON \
-DPNG_SUPPORTED=OFF
cmake --build build --parallel
cmake --install build
cd ..
rm -rf mozjpeg
- name: Opus cache.
id: cache-opus
uses: actions/cache@v2
with:
path: ${{ env.LibrariesPath }}/opus
key: ${{ runner.OS }}-opus-${{ env.CACHE_KEY }}
- name: Opus.
if: steps.cache-opus.outputs.cache-hit != 'true'
run: |
cd $LibrariesPath
git clone -b v1.3.1 --depth=1 $GIT/xiph/opus
cd opus
./autogen.sh
./configure
make -j$(nproc)
- name: Opus install.
run: |
cd $LibrariesPath/opus
make install
- name: VPX cache.
id: cache-vpx
uses: actions/cache@v2
with:
path: ${{ env.LibrariesPath }}/vpx-cache
key: ${{ runner.OS }}-vpx-${{ env.CACHE_KEY }}
- name: VPX build.
if: steps.cache-vpx.outputs.cache-hit != 'true'
run: |
cd $LibrariesPath
git clone -b v1.11.0 --depth=1 $GIT/webmproject/libvpx.git
cd libvpx
./configure \
--prefix=/usr \
--disable-examples \
--disable-unit-tests \
--disable-tools \
--disable-docs \
--enable-shared \
--disable-static \
--enable-vp8 \
--enable-vp9 \
--enable-webm-io
make -j$(nproc)
make DESTDIR="$LibrariesPath/vpx-cache" install
cd ..
rm -rf libvpx
- name: VPX install.
run: |
cd $LibrariesPath
cp -R vpx-cache/. /
ldconfig
- name: FFmpeg cache.
id: cache-ffmpeg
uses: actions/cache@v2
with:
path: ${{ env.LibrariesPath }}/ffmpeg-cache
key: ${{ runner.OS }}-ffmpeg-${{ env.CACHE_KEY }}
- name: FFmpeg build.
if: steps.cache-ffmpeg.outputs.cache-hit != 'true'
run: |
cd $LibrariesPath
git clone --branch release/4.4 --depth=1 $GIT/FFmpeg/FFmpeg ffmpeg
cd ffmpeg
./configure \
--disable-static \
--disable-debug \
--disable-programs \
--disable-doc \
--disable-network \
--disable-autodetect \
--disable-encoders \
--disable-muxers \
--disable-bsfs \
--disable-protocols \
--disable-devices \
--disable-filters \
--enable-shared \
--enable-libopus \
--enable-libvpx \
--enable-protocol=file \
--enable-encoder=libopus \
--enable-muxer=ogg \
--enable-muxer=opus
make -j$(nproc)
make DESTDIR="$LibrariesPath/ffmpeg-cache" install
cd ..
rm -rf ffmpeg
- name: FFmpeg install.
run: |
cd $LibrariesPath
cp -R ffmpeg-cache/. /
ldconfig
- name: OpenAL Soft.
run: |
cd $LibrariesPath
git clone -b fix_pulse_default --depth=1 $GIT/telegramdesktop/openal-soft.git
cd openal-soft
cmake -B build -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DALSOFT_EXAMPLES=OFF \
-DALSOFT_TESTS=OFF \
-DALSOFT_UTILS=OFF \
-DALSOFT_CONFIG=OFF
cmake --build build --parallel
cmake --install build
ldconfig
cd -
rm -rf openal-soft
- name: Libepoxy.
run: |
cd $LibrariesPath
git clone -b 1.5.9 --depth=1 $GIT/anholt/libepoxy.git
cd libepoxy
git apply ../patches/libepoxy.patch
meson build \
--buildtype=release \
--default-library=static \
-Dtests=false
meson compile -C build
meson install -C build
cd ..
rm -rf libepoxy
- name: Qt 6.2.3 cache.
id: cache-qt
uses: actions/cache@v2
with:
path: ${{ env.LibrariesPath }}/qt-cache
key: ${{ runner.OS }}-qt-${{ env.CACHE_KEY }}-${{ hashFiles('**/qtbase_6_2_3/*') }}-${{ hashFiles('**/qtwayland_6_2_3/*') }}-${{ hashFiles('**/qt5compat_6_2_3/*') }}
- name: Qt 6.2.3 build.
if: steps.cache-qt.outputs.cache-hit != 'true'
run: |
cd $LibrariesPath
git clone -b v6.2.3 --depth=1 git://code.qt.io/qt/qt5.git qt_${QT}
cd qt_${QT}
perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat,qttools
cd qtbase
find ../../patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qtwayland
find ../../patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qt5compat
find ../../patches/qt5compat_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ..
./configure -prefix /usr/local \
-release \
-opensource \
-confirm-license \
-qt-libpng \
-qt-harfbuzz \
-qt-pcre \
-no-feature-xcb-sm \
-no-feature-highdpiscaling \
-openssl-linked \
-nomake examples \
-nomake tests
cmake --build . --parallel
DESTDIR="$LibrariesPath/qt-cache" cmake --install .
cd ..
rm -rf qt_${QT}
- name: Qt 6.2.3 install.
run: |
cd $LibrariesPath
cp -R qt-cache/. /
ldconfig
- name: Qt6Gtk2.
run: |
cd $LibrariesPath
git clone -b 0.1 --depth=1 $GIT/trialuser02/qt6gtk2.git
cd qt6gtk2
wget https://github.com/trialuser02/qt6gtk2/commit/3d2cf8cbade92a175b2c878090f5f44a1b8a395c.patch
git apply 3d2cf8cbade92a175b2c878090f5f44a1b8a395c.patch
qmake
make -j$(nproc)
make install
cd ..
rm -rf qt6gtk2
- name: Qt6Ct.
run: |
cd $LibrariesPath
git clone -b 0.5 --depth=1 $GIT/trialuser02/qt6ct.git
cd qt6ct
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
cmake --install build
cd ..
rm -rf qt6ct
- name: Kvantum.
run: |
cd $LibrariesPath
git clone -b V1.0.0 --depth=1 $GIT/tsujan/Kvantum.git
cd Kvantum/Kvantum
cmake -B build -GNinja -DCMAKE_BUILD_TYPE=Release -DENABLE_QT5=OFF
cmake --build build --parallel
cmake --install build
cd ../..
rm -rf Kvantum
- name: WebRTC cache.
id: cache-webrtc
uses: actions/cache@v2
with:
path: ${{ env.LibrariesPath }}/tg_owt
key: ${{ runner.OS }}-webrtc-${{ env.CACHE_KEY }}-${{ hashFiles('**/tg_owt-version.json') }}
- name: WebRTC.
if: steps.cache-webrtc.outputs.cache-hit != 'true'
run: |
cd $LibrariesPath
mkdir tg_owt
cd tg_owt
git init
git remote add origin $GIT/desktop-app/tg_owt.git
git fetch --depth=1 origin 4cba1acdd718b700bb33945c0258283689d4eac7
git reset --hard FETCH_HEAD
git submodule init
git submodule update
cd src/third_party/pipewire
meson build -Dspa-plugins=disabled
cd ../../..
cmake -B build -GNinja . \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DTG_OWT_DLOPEN_PIPEWIRE=ON
cmake --build build --parallel
- name: Kotatogram Desktop build.
if: env.ONLY_CACHE == 'false'
env:
tg_owt_DIR: ${{ env.LibrariesPath }}/tg_owt/build
run: |
cd $REPO_NAME/Telegram
DEFINE=""
if [ -n "${{ matrix.defines }}" ]; then
DEFINE="-D ${{ matrix.defines }}=ON"
echo Define from matrix: $DEFINE
echo "ARTIFACT_NAME=Kotatogram_${{ matrix.defines }}" >> $GITHUB_ENV
else
echo "ARTIFACT_NAME=Kotatogram" >> $GITHUB_ENV
fi
./configure.sh \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_C_FLAGS="-Werror" \
-DCMAKE_CXX_FLAGS="-Werror" \
-DCMAKE_EXE_LINKER_FLAGS="-s" \
-DTDESKTOP_API_TEST=ON \
-DDESKTOP_APP_USE_PACKAGED_LAZY=ON \
$DEFINE
cmake --build ../out --config Debug --parallel
DESTDIR=../AppDir cmake --install ../out --config Debug
- name: AppImage build.
if: env.ONLY_CACHE == 'false'
run: |
# Let appimagetool determine the repository
cd $REPO_NAME
../linuxdeployqt-continuous-x86_64.AppImage \
AppDir/usr/share/applications/*.desktop \
-appimage \
-exclude-libs=libatk-1.0.so.0,libatk-bridge-2.0.so.0,libatspi.so.0,libcairo-gobject.so.2,libcairo.so.2,libgdk-3.so.0,libgdk_pixbuf-2.0.so.0,libgdk-x11-2.0.so.0,libgmodule-2.0.so.0,libgtk-3.so.0,libgtk-x11-2.0.so.0,libpixman-1.so.0,libpng12.so.0 \
-extra-plugins=iconengines,imageformats,platforminputcontexts,platforms/libqwayland-egl.so,platforms/libqwayland-generic.so,platforms/libqxcb.so,platformthemes/libqgtk3.so,platformthemes/libqxdgdesktopportal.so,platformthemes/libqt6ct.so,platformthemes/libqt6gtk2.so,styles/libqt6ct-style.so,styles/libqt6gtk2-style.so,styles/libkvantum.so,tls,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration,xcbglintegrations
appimage_name=$(echo Kotatogram_Desktop*.AppImage)
echo "APPIMAGE_NAME=$appimage_name" >> $GITHUB_ENV
# We don't need AppImageLauncher's desktop integration due to bad UX
dd if=/dev/zero of=$appimage_name bs=1 count=3 seek=8 conv=notrunc
- name: Check.
if: env.ONLY_CACHE == 'false'
run: |
filePath="$REPO_NAME/$APPIMAGE_NAME"
if test -f "$filePath"; then
echo "Build successfully done! :)"
size=$(stat -c %s "$filePath")
echo "File size of ${filePath}: ${size} Bytes."
else
echo "Build error, output file does not exist."
exit 1
fi
- name: Move artifact.
if: env.UPLOAD_ARTIFACT == 'true'
run: |
cd $REPO_NAME
mkdir artifact
mv $APPIMAGE_NAME artifact/
- uses: actions/upload-artifact@master
if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact.
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.REPO_NAME }}/artifact/

View file

@ -5,6 +5,7 @@ on:
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'
- 'kotatogram_changes.txt'
- 'changelog.txt' - 'changelog.txt'
- 'LEGAL' - 'LEGAL'
- 'LICENSE' - 'LICENSE'
@ -23,6 +24,7 @@ on:
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'
- 'kotatogram_changes.txt'
- 'changelog.txt' - 'changelog.txt'
- 'LEGAL' - 'LEGAL'
- 'LICENSE' - 'LICENSE'
@ -42,14 +44,19 @@ jobs:
linux: linux:
name: Rocky Linux 8 name: Rocky Linux 8
if: >
!(github.event_name == 'push'
&& contains(github.event.head_commit.message, '[skip ci]'))
&& !(github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
defines: defines:
- "" - ""
- "DESKTOP_APP_DISABLE_X11_INTEGRATION" #- "DESKTOP_APP_DISABLE_X11_INTEGRATION"
- "DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION" #- "DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION"
env: env:
UPLOAD_ARTIFACT: "false" UPLOAD_ARTIFACT: "false"
@ -70,7 +77,7 @@ jobs:
docker pull ghcr.io/$GITHUB_REPOSITORY/centos_env docker pull ghcr.io/$GITHUB_REPOSITORY/centos_env
docker tag ghcr.io/$GITHUB_REPOSITORY/centos_env tdesktop:centos_env docker tag ghcr.io/$GITHUB_REPOSITORY/centos_env tdesktop:centos_env
- name: Telegram Desktop build. - name: Kotatogram Desktop build.
run: | run: |
cd $REPO_NAME cd $REPO_NAME
@ -78,9 +85,9 @@ jobs:
if [ -n "${{ matrix.defines }}" ]; then if [ -n "${{ matrix.defines }}" ]; then
DEFINE="-D ${{ matrix.defines }}=ON" DEFINE="-D ${{ matrix.defines }}=ON"
echo Define from matrix: $DEFINE echo Define from matrix: $DEFINE
echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV echo "ARTIFACT_NAME=Kotatogram_${{ matrix.defines }}" >> $GITHUB_ENV
else else
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV echo "ARTIFACT_NAME=Kotatogram" >> $GITHUB_ENV
fi fi
docker run --rm \ docker run --rm \
@ -100,7 +107,7 @@ jobs:
- name: Check. - name: Check.
run: | run: |
filePath="$REPO_NAME/out/Debug/Telegram" filePath="$REPO_NAME/out/Debug/Kotatogram"
if test -f "$filePath"; then if test -f "$filePath"; then
echo "Build successfully done! :)" echo "Build successfully done! :)"
@ -116,7 +123,7 @@ jobs:
run: | run: |
cd $REPO_NAME/out/Debug cd $REPO_NAME/out/Debug
mkdir artifact mkdir artifact
mv {Telegram,Updater} artifact/ mv {Kotatogram,Updater} artifact/
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@master
if: env.UPLOAD_ARTIFACT == 'true' if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact. name: Upload artifact.

View file

@ -5,6 +5,7 @@ on:
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'
- 'kotatogram_changes.txt'
- 'changelog.txt' - 'changelog.txt'
- 'LEGAL' - 'LEGAL'
- 'LICENSE' - 'LICENSE'
@ -22,6 +23,7 @@ on:
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'
- 'kotatogram_changes.txt'
- 'changelog.txt' - 'changelog.txt'
- 'LEGAL' - 'LEGAL'
- 'LICENSE' - 'LICENSE'
@ -40,6 +42,11 @@ jobs:
macos: macos:
name: MacOS name: MacOS
if: >
!(github.event_name == 'push'
&& contains(github.event.head_commit.message, '[skip ci]'))
&& !(github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)
runs-on: macos-12 runs-on: macos-12
strategy: strategy:
@ -96,7 +103,7 @@ jobs:
cd Libraries cd Libraries
find . -iname "*.dir" -exec rm -rf {} || true \; find . -iname "*.dir" -exec rm -rf {} || true \;
- name: Telegram Desktop build. - name: Kotatogram Desktop build.
if: env.ONLY_CACHE == 'false' if: env.ONLY_CACHE == 'false'
run: | run: |
cd $REPO_NAME/Telegram cd $REPO_NAME/Telegram
@ -105,9 +112,9 @@ jobs:
if [ -n "${{ matrix.defines }}" ]; then if [ -n "${{ matrix.defines }}" ]; then
DEFINE="-D ${{ matrix.defines }}=ON" DEFINE="-D ${{ matrix.defines }}=ON"
echo Define from matrix: $DEFINE echo Define from matrix: $DEFINE
echo "ARTIFACT_NAME=Telegram_${{ matrix.defines }}" >> $GITHUB_ENV echo "ARTIFACT_NAME=Kotatogram_${{ matrix.defines }}" >> $GITHUB_ENV
else else
echo "ARTIFACT_NAME=Telegram" >> $GITHUB_ENV echo "ARTIFACT_NAME=Kotatogram" >> $GITHUB_ENV
fi fi
./configure.sh \ ./configure.sh \
@ -129,7 +136,7 @@ jobs:
run: | run: |
cd $REPO_NAME/out/Debug cd $REPO_NAME/out/Debug
mkdir artifact mkdir artifact
mv Telegram.app artifact/ mv Kotatogram.app artifact/
mv Updater artifact/ mv Updater artifact/
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@master
if: env.UPLOAD_ARTIFACT == 'true' if: env.UPLOAD_ARTIFACT == 'true'

View file

@ -140,19 +140,19 @@ jobs:
cmake --build build --parallel cmake --build build --parallel
cd build cd build
macdeployqt Telegram.app macdeployqt Kotatogram.app
codesign --remove-signature Telegram.app codesign --remove-signature Kotatogram.app
mkdir dmgsrc mkdir dmgsrc
mv Telegram.app dmgsrc mv Kotatogram.app dmgsrc
hdiutil create -volname Telegram -srcfolder dmgsrc -ov -format UDZO Telegram.dmg hdiutil create -volname Kotatogram -srcfolder dmgsrc -ov -format UDZO Kotatogram.dmg
- name: Move artifact. - name: Move artifact.
if: env.UPLOAD_ARTIFACT == 'true' if: env.UPLOAD_ARTIFACT == 'true'
run: | run: |
cd $REPO_NAME/build cd $REPO_NAME/build
mkdir artifact mkdir artifact
mv Telegram.dmg artifact/ mv Kotatogram.dmg artifact/
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@master
if: env.UPLOAD_ARTIFACT == 'true' if: env.UPLOAD_ARTIFACT == 'true'
name: Upload artifact. name: Upload artifact.

43
.github/workflows/tarball-release.yml vendored Normal file
View file

@ -0,0 +1,43 @@
name: Release Tarball
on:
release:
types: [published]
jobs:
linux:
name: Ubuntu
runs-on: ubuntu-latest
steps:
- name: Get repository name
run: |
tag_name=${GITHUB_REF##*/}
version=${tag_name#k}
echo "REPO_NAME=${GITHUB_REPOSITORY##*/}-$version-full" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
path: ${{ env.REPO_NAME }}
- name: Create tarball
run: |
artifact_name="$REPO_NAME.tar.gz"
echo "ARTIFACT_NAME=$artifact_name" >> $GITHUB_ENV
rm -rf $REPO_NAME/.git
tar -caf $artifact_name $REPO_NAME
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ env.ARTIFACT_NAME }}
asset_name: ${{ env.ARTIFACT_NAME }}
asset_content_type: application/octet-stream

View file

@ -1,18 +0,0 @@
name: User-agent updater.
on:
repository_dispatch:
types: ["Restart user_agent_updater workflow."]
schedule:
# At 00:00 on day-of-month 1.
- cron: "0 0 1 * *"
pull_request_target:
types: [closed]
jobs:
User-agent:
runs-on: ubuntu-latest
steps:
- uses: desktop-app/action_code_updater@master
with:
type: "user-agent"

View file

@ -5,6 +5,7 @@ on:
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'
- 'kotatogram_changes.txt'
- 'changelog.txt' - 'changelog.txt'
- 'LEGAL' - 'LEGAL'
- 'LICENSE' - 'LICENSE'
@ -23,6 +24,7 @@ on:
paths-ignore: paths-ignore:
- 'docs/**' - 'docs/**'
- '**.md' - '**.md'
- 'kotatogram_changes.txt'
- 'changelog.txt' - 'changelog.txt'
- 'LEGAL' - 'LEGAL'
- 'LICENSE' - 'LICENSE'
@ -42,6 +44,11 @@ jobs:
windows: windows:
name: Windows name: Windows
if: >
!(github.event_name == 'push'
&& contains(github.event.head_commit.message, '[skip ci]'))
&& !(github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)
runs-on: windows-2022 runs-on: windows-2022
strategy: strategy:
@ -50,7 +57,7 @@ jobs:
generator: ["", "Ninja Multi-Config"] generator: ["", "Ninja Multi-Config"]
env: env:
UPLOAD_ARTIFACT: "false" UPLOAD_ARTIFACT: "true"
ONLY_CACHE: "false" ONLY_CACHE: "false"
PREPARE_PATH: "Telegram/build/prepare/prepare.py" PREPARE_PATH: "Telegram/build/prepare/prepare.py"
@ -113,7 +120,7 @@ jobs:
- name: Read configuration matrix. - name: Read configuration matrix.
shell: bash shell: bash
run: | run: |
ARTIFACT_NAME="Telegram" ARTIFACT_NAME="Kotatogram"
ARCH="" ARCH=""
if [ -n "${{ matrix.arch }}" ]; then if [ -n "${{ matrix.arch }}" ]; then
@ -160,7 +167,7 @@ jobs:
del /S Libraries\*.pch del /S Libraries\*.pch
del /S Libraries\*.obj del /S Libraries\*.obj
- name: Telegram Desktop build. - name: Kotatogram Desktop build.
if: env.ONLY_CACHE == 'false' if: env.ONLY_CACHE == 'false'
run: | run: |
cd %TBUILD%\%REPO_NAME%\Telegram cd %TBUILD%\%REPO_NAME%\Telegram
@ -174,14 +181,23 @@ jobs:
-D DESKTOP_APP_NO_PDB=ON ^ -D DESKTOP_APP_NO_PDB=ON ^
%TDESKTOP_BUILD_DEFINE% %TDESKTOP_BUILD_DEFINE%
cmake --build ..\out --config Debug --parallel if "${{ matrix.arch }}" == "x64" (
cd ..\out64
) else (
cd ..\out
)
cmake --build . --config Debug --parallel
- name: Move artifact. - name: Move artifact.
if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly') if: (env.UPLOAD_ARTIFACT == 'true') || (github.ref == 'refs/heads/nightly')
run: | run: |
set OUT=%TBUILD%\%REPO_NAME%\out\Debug if "${{ matrix.arch }}" == "x64" (
set OUT=%TBUILD%\%REPO_NAME%\out64\Debug
) else (
set OUT=%TBUILD%\%REPO_NAME%\out\Debug
)
mkdir artifact mkdir artifact
move %OUT%\Telegram.exe artifact/ move %OUT%\Kotatogram.exe artifact/
move %OUT%\Updater.exe artifact/ move %OUT%\Updater.exe artifact/
- uses: actions/upload-artifact@master - uses: actions/upload-artifact@master
name: Upload artifact. name: Upload artifact.

123
README.md
View file

@ -1,86 +1,67 @@
# [Telegram Desktop][telegram_desktop] Official Messenger # Kotatogram experimental [Telegram Desktop][telegram_desktop] fork.
This is the complete source code and the build instructions for the official [Telegram][telegram] messenger desktop client, based on the [Telegram API][telegram_api] and the [MTProto][telegram_proto] secure protocol. [![GitHub release (latest by date including pre-releases)](https://badgen.net/github/release/kotatogram/kotatogram-desktop?label=Latest%20release)][releases]
[![GitHub Workflow Status: Windows](https://github.com/kotatogram/kotatogram-desktop/workflows/Windows./badge.svg?event=push)][actions]
[![GitHub Workflow Status: Linux](https://github.com/kotatogram/kotatogram-desktop/workflows/Linux%20Kotato./badge.svg?event=push)][actions]
[![GitHub Workflow Status: macOS](https://github.com/kotatogram/kotatogram-desktop/workflows/MacOS./badge.svg?event=push)][actions]
[![Crowdin](https://badges.crowdin.net/kotatogram-desktop/localized.svg)](https://crowdin.com/project/kotatogram-desktop)
[![Version](https://badge.fury.io/gh/telegramdesktop%2Ftdesktop.svg)](https://github.com/telegramdesktop/tdesktop/releases) [![Preview of Kotatogram Desktop][preview_image]][preview_image_url]
[![Build Status](https://github.com/telegramdesktop/tdesktop/workflows/Windows./badge.svg)](https://github.com/telegramdesktop/tdesktop/actions)
[![Build Status](https://github.com/telegramdesktop/tdesktop/workflows/MacOS./badge.svg)](https://github.com/telegramdesktop/tdesktop/actions)
[![Build Status](https://github.com/telegramdesktop/tdesktop/workflows/Linux./badge.svg)](https://github.com/telegramdesktop/tdesktop/actions)
[![Preview of Telegram Desktop][preview_image]][preview_image_url] Build instructions can be found [in `docs` folder][build]. Please note: only [32-bit Windows][building-msvc], [64-bit Windows][building-msvc-x64] and [Linux][building-cmake] build instructions are updated.
The source code is published under GPLv3 with OpenSSL exception, the license is available [here][license]. Original README with licenses could be found in [Telegram Desktop repository][telegram_desktop_readme].
## Supported systems ## Download
Binaries can be downloaded from releases: https://github.com/kotatogram/kotatogram-desktop/releases
The latest version is available for Latest stable version can be found here: https://github.com/kotatogram/kotatogram-desktop/releases/latest
* [Windows 7 and above (64 bit)](https://telegram.org/dl/desktop/win64) ([portable](https://telegram.org/dl/desktop/win64_portable)) ## Builds
* [Windows 7 and above (32 bit)](https://telegram.org/dl/desktop/win) ([portable](https://telegram.org/dl/desktop/win_portable)) * Windows (installer and portable)
* [macOS 10.13 and above](https://telegram.org/dl/desktop/mac) * Linux (64-bit)
* [Linux static build for 64 bit](https://telegram.org/dl/desktop/linux) * [Flathub][flatpak]
* [Snap](https://snapcraft.io/telegram-desktop) * Other repositories:<br>[![Packaging status](https://repology.org/badge/vertical-allrepos/kotatogram-desktop.svg)][repology]
* [Flatpak](https://flathub.org/apps/details/org.telegram.desktop) * macOS
## Old system versions ## Features
* Local folders
* Forward to multiple chats and forward without author
* Custom font
* Compact chat list
* Custom text replaces
* Change sticker size
* Adaptive chat bubbles
* and other smaller features.
Version **4.9.9** was the last that supports older systems Full list of features will rewritten later. Control branches were used to list features, but they are now deprecated and archived in [separate repo][archive].
* [macOS 10.12](https://updates.tdesktop.com/tmac/tsetup.4.9.9.dmg) ## Contributing
* [Linux with glibc < 2.28 static build](https://updates.tdesktop.com/tlinux/tsetup.4.9.9.tar.xz) Read [CONTRIBUTING.md][contributing].
Version **2.4.4** was the last that supports older systems ## Other links
* Website: https://kotatogram.github.io
* English Telegram channel: https://t.me/kotatogram
* Russian Telegram channel: https://t.me/kotatogram_ru
* Trello (on Russian, abandoned): https://trello.com/b/G6zetXOH/kotatogram-desktop
* [OS X 10.10 and 10.11](https://updates.tdesktop.com/tosx/tsetup-osx.2.4.4.dmg) ## Attribution
* [Linux static build for 32 bit](https://updates.tdesktop.com/tlinux32/tsetup32.2.4.4.tar.xz) * Ghost icon (for deleted accounts) is taken from [official Android app](https://github.com/DrKLO/Telegram).
* Icons for local folders mostly are [Material Design Icons](https://materialdesignicons.com/).
Version **1.8.15** was the last that supports older systems
* [Windows XP and Vista](https://updates.tdesktop.com/tsetup/tsetup.1.8.15.exe) ([portable](https://updates.tdesktop.com/tsetup/tportable.1.8.15.zip))
* [OS X 10.8 and 10.9](https://updates.tdesktop.com/tmac/tsetup.1.8.15.dmg)
* [OS X 10.6 and 10.7](https://updates.tdesktop.com/tmac32/tsetup32.1.8.15.dmg)
## Third-party
* Qt 6 ([LGPL](http://doc.qt.io/qt-6/lgpl.html)) and Qt 5.15 ([LGPL](http://doc.qt.io/qt-5/lgpl.html)) slightly patched
* OpenSSL 1.1.1 and 1.0.1 ([OpenSSL License](https://www.openssl.org/source/license.html))
* WebRTC ([New BSD License](https://github.com/desktop-app/tg_owt/blob/master/LICENSE))
* zlib 1.2.11 ([zlib License](http://www.zlib.net/zlib_license.html))
* LZMA SDK 9.20 ([public domain](http://www.7-zip.org/sdk.html))
* liblzma ([public domain](http://tukaani.org/xz/))
* Google Breakpad ([License](https://chromium.googlesource.com/breakpad/breakpad/+/master/LICENSE))
* Google Crashpad ([Apache License 2.0](https://chromium.googlesource.com/crashpad/crashpad/+/master/LICENSE))
* GYP ([BSD License](https://github.com/bnoordhuis/gyp/blob/master/LICENSE))
* Ninja ([Apache License 2.0](https://github.com/ninja-build/ninja/blob/master/COPYING))
* OpenAL Soft ([LGPL](https://github.com/kcat/openal-soft/blob/master/COPYING))
* Opus codec ([BSD License](http://www.opus-codec.org/license/))
* FFmpeg ([LGPL](https://www.ffmpeg.org/legal.html))
* Guideline Support Library ([MIT License](https://github.com/Microsoft/GSL/blob/master/LICENSE))
* Range-v3 ([Boost License](https://github.com/ericniebler/range-v3/blob/master/LICENSE.txt))
* Open Sans font ([Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.html))
* Vazir font ([SIL Open Font License 1.1](https://github.com/rastikerdar/vazir-font/blob/master/OFL.txt))
* Emoji alpha codes ([MIT License](https://github.com/emojione/emojione/blob/master/extras/alpha-codes/LICENSE.md))
* Catch test framework ([Boost License](https://github.com/philsquared/Catch/blob/master/LICENSE.txt))
* xxHash ([BSD License](https://github.com/Cyan4973/xxHash/blob/dev/LICENSE))
* QR Code generator ([MIT License](https://github.com/nayuki/QR-Code-generator#license))
* CMake ([New BSD License](https://github.com/Kitware/CMake/blob/master/Copyright.txt))
* Hunspell ([LGPL](https://github.com/hunspell/hunspell/blob/master/COPYING.LESSER))
## Build instructions
* Windows [(32-bit)][win32] [(64-bit)][win64]
* [macOS][mac]
* [GNU/Linux using Docker][linux]
[//]: # (LINKS) [//]: # (LINKS)
[telegram]: https://telegram.org
[telegram_desktop]: https://desktop.telegram.org [telegram_desktop]: https://desktop.telegram.org
[telegram_api]: https://core.telegram.org [releases]: https://github.com/kotatogram/kotatogram-desktop/releases
[telegram_proto]: https://core.telegram.org/mtproto [actions]: https://github.com/kotatogram/kotatogram-desktop/actions
[license]: LICENSE [telegram_desktop_readme]: https://github.com/telegramdesktop/tdesktop/blob/dev/README.md
[win32]: docs/building-win.md [repology]: https://repology.org/project/kotatogram-desktop/versions
[win64]: docs/building-win-x64.md [flatpak]: https://flathub.org/apps/details/io.github.kotatogram
[mac]: docs/building-mac.md [changelog]: https://github.com/kotatogram/kotatogram-desktop/blob/dev/kotatogram_changes.txt
[linux]: docs/building-linux.md [preview_image]: https://github.com/kotatogram/kotatogram-desktop/blob/dev/docs/assets/ktg_preview.png "Preview of Kotatogram Desktop"
[preview_image]: https://github.com/telegramdesktop/tdesktop/blob/dev/docs/assets/preview.png "Preview of Telegram Desktop" [preview_image_url]: https://github.com/kotatogram/kotatogram-desktop/blob/dev/docs/assets/ktg_preview.png
[preview_image_url]: https://raw.githubusercontent.com/telegramdesktop/tdesktop/dev/docs/assets/preview.png [contributing]: https://github.com/kotatogram/kotatogram-desktop/blob/dev/.github/CONTRIBUTING.md
[archive]: https://github.com/kotatogram/kotatogram-archived
[build]: https://github.com/kotatogram/kotatogram-desktop/blob/dev/docs
[win32]: https://github.com/kotatogram/kotatogram-desktop/blob/dev/docs/building-win.md
[win64]: https://github.com/kotatogram/kotatogram-desktop/blob/dev/docs/building-win-x64.md
[linux]: https://github.com/kotatogram/kotatogram-desktop/blob/dev/docs/building-linux.md

View file

@ -0,0 +1,66 @@
import subprocess
import os
import sys
from shutil import copyfile
executable = sys.argv[1]
app_folder = os.path.join(*executable.split('/')[:-3])
content_folder = os.path.join(app_folder, "Contents")
framework_path = os.path.join(content_folder, "Frameworks")
print(executable)
print("Working in {} ".format(app_folder))
def file_in_folder(file, folder):
return os.path.exists(os.path.join(folder, file))
def otool(s):
o = subprocess.Popen(['/usr/bin/otool', '-L', s], stdout=subprocess.PIPE)
for l in o.stdout:
l = l.decode()
if l[0] == '\t':
path = l.split(' ', 1)[0][1:]
if "@executable_path" in path:
path = path.replace("@executable_path", "")
path = os.path.join(content_folder, path[4:])
if "@loader_path" in path:
path = path.replace("@loader_path", framework_path)
if "@rpath" in path:
path = path.replace("@rpath", framework_path)
dependency_dylib_name = os.path.split(path)[-1]
if "usr/local" in path:
if app_folder in s:
print("Warning: {} depends on {}".format(s, path))
if file_in_folder(dependency_dylib_name, framework_path):
print("Dependent library {} is already in framework folder".format(dependency_dylib_name))
print("Running install name tool to fix {}.".format(s))
if dependency_dylib_name == os.path.split(s)[-1]:
_ = subprocess.Popen(['install_name_tool', '-id', os.path.join("@loader_path", dependency_dylib_name), s], stdout=subprocess.PIPE)
_ = subprocess.Popen(['install_name_tool', '-change', path, os.path.join("@loader_path", dependency_dylib_name), s], stdout=subprocess.PIPE)
else:
pass
yield path
need = set([executable])
done = set()
while need:
needed = set(need)
need = set()
for f in needed:
need.update(otool(f))
done.update(needed)
need.difference_update(done)

BIN
docs/assets/ktg_preview.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 KiB

View file

@ -12,29 +12,33 @@ You will require **api_id** and **api_hash** to access the Telegram API servers.
Install [poetry](https://python-poetry.org), go to ***BuildPath*** and run Install [poetry](https://python-poetry.org), go to ***BuildPath*** and run
git clone --recursive https://github.com/telegramdesktop/tdesktop.git git clone --recursive https://github.com/kotatogram/kotatogram-desktop.git
./tdesktop/Telegram/build/prepare/linux.sh ./tdesktop/Telegram/build/prepare/linux.sh
### Building the project ### Building the project
Go to ***BuildPath*/tdesktop** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials)) Go to ***BuildPath*/kotatogram-desktop** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
docker run --rm -it \ docker run --rm -it \
-v $PWD:/usr/src/tdesktop \ -v $PWD:/usr/src/tdesktop \
tdesktop:centos_env \ kotatogram-desktop:centos_env \
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \ /usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
-D TDESKTOP_API_ID=YOUR_API_ID \ -D TDESKTOP_API_ID=YOUR_API_ID \
-D TDESKTOP_API_HASH=YOUR_API_HASH -D TDESKTOP_API_HASH=YOUR_API_HASH \
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=ON
Or, to create a debug build, run (also using [your **api_id** and **api_hash**](#obtain-your-api-credentials)) Or, to create a debug build, run (also using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
docker run --rm -it \ docker run --rm -it \
-v $PWD:/usr/src/tdesktop \ -v $PWD:/usr/src/tdesktop \
-e CONFIG=Debug \ -e CONFIG=Debug \
tdesktop:centos_env \ kotatogram-desktop:centos_env \
/usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \ /usr/src/tdesktop/Telegram/build/docker/centos_env/build.sh \
-D TDESKTOP_API_ID=YOUR_API_ID \ -D TDESKTOP_API_ID=YOUR_API_ID \
-D TDESKTOP_API_HASH=YOUR_API_HASH -D TDESKTOP_API_HASH=YOUR_API_HASH \
-D DESKTOP_APP_DISABLE_CRASH_REPORTS=ON
If you want to build with crash reporter, use `-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF` instead of `-D DESKTOP_APP_DISABLE_CRASH_REPORTS=ON`.
If you need a backward compatible binary (running on older OS like the official one), you should build the binary with LTO. 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. To do this, add `-D CMAKE_INTERPROCEDURAL_OPTIMIZATION=ON` option.

View file

@ -24,22 +24,30 @@ You will require **api_id** and **api_hash** to access the Telegram API servers.
* Download **CMake 3.21 or later** installer from [https://cmake.org/download/](https://cmake.org/download/) and install it. * Download **CMake 3.21 or later** installer from [https://cmake.org/download/](https://cmake.org/download/) and install it.
* Download **Git** installer from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it. * Download **Git** installer from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it.
Open **x64 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run
python -m pip install pywin32
## Clone source code and prepare libraries ## Clone source code and prepare libraries
Open **x64 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run Open **x64 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run
git clone --recursive https://github.com/telegramdesktop/tdesktop.git SET PATH=%cd%\ThirdParty\NuGet;%cd%\ThirdParty\Python39;%PATH%
tdesktop\Telegram\build\prepare\win.bat
git clone --recursive https://github.com/kotatogram/kotatogram-desktop.git
kotatogram-desktop\Telegram\build\prepare\win.bat
## Build the project ## Build the project
Go to ***BuildPath*\\tdesktop\\Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials)) Go to ***BuildPath*\\kotatogram-desktop\\Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH configure.bat x64 -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH -D DESKTOP_APP_DISABLE_CRASH_REPORTS=ON
* Open ***BuildPath*\\tdesktop\\out\\Telegram.sln** in Visual Studio 2022 If you want to build with crash reporter, use `-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF` instead of `-D DESKTOP_APP_DISABLE_CRASH_REPORTS=ON`.
* Open ***BuildPath*\\kotatogram-desktop\\out64\\Telegram.sln** in Visual Studio 2022
* Select Telegram project and press Build > Build Telegram (Debug and Release configurations) * Select Telegram project and press Build > Build Telegram (Debug and Release configurations)
* The result Telegram.exe will be located in **D:\TBuild\tdesktop\out\Debug** (and **Release**) * The result Kotatogram.exe will be located in **D:\TBuild\kotatogram-desktop\out64\Debug** (and **Release**)
### Qt Visual Studio Tools ### Qt Visual Studio Tools

View file

@ -24,22 +24,30 @@ You will require **api_id** and **api_hash** to access the Telegram API servers.
* Download **CMake 3.21 or later** installer from [https://cmake.org/download/](https://cmake.org/download/) and install it. * Download **CMake 3.21 or later** installer from [https://cmake.org/download/](https://cmake.org/download/) and install it.
* Download **Git** installer from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it. * Download **Git** installer from [https://git-scm.com/download/win](https://git-scm.com/download/win) and install it.
Open **x86 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run
python -m pip install pywin32
## Clone source code and prepare libraries ## Clone source code and prepare libraries
Open **x86 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run Open **x86 Native Tools Command Prompt for VS 2022.bat**, go to ***BuildPath*** and run
git clone --recursive https://github.com/telegramdesktop/tdesktop.git SET PATH=%cd%\ThirdParty\NuGet;%cd%\ThirdParty\Python39;%PATH%
tdesktop\Telegram\build\prepare\win.bat
git clone --recursive https://github.com/kotatogram/kotatogram-desktop.git
kotatogram-desktop\Telegram\build\prepare\win.bat
## Build the project ## Build the project
Go to ***BuildPath*\\tdesktop\\Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials)) Go to ***BuildPath*\\kotatogram-desktop\\Telegram** and run (using [your **api_id** and **api_hash**](#obtain-your-api-credentials))
configure.bat -D TDESKTOP_API_ID=YOUR_API_ID -D TDESKTOP_API_HASH=YOUR_API_HASH configure.bat -D TDESKTOP_API_ID=YOUR_API_ID -D DESKTOP_APP_DISABLE_CRASH_REPORTS=ON
* Open ***BuildPath*\\tdesktop\\out\\Telegram.sln** in Visual Studio 2022 If you want to build with crash reporter, use `-D DESKTOP_APP_DISABLE_CRASH_REPORTS=OFF` instead of `-D DESKTOP_APP_DISABLE_CRASH_REPORTS=ON`.
* Open ***BuildPath*\\kotatogram-desktop\\out\\Telegram.sln** in Visual Studio 2022
* Select Telegram project and press Build > Build Telegram (Debug and Release configurations) * Select Telegram project and press Build > Build Telegram (Debug and Release configurations)
* The result Telegram.exe will be located in **D:\TBuild\tdesktop\out\Debug** (and **Release**) * The result Kotatogram.exe will be located in **D:\TBuild\kotatogram-desktop\out\Debug** (and **Release**)
### Qt Visual Studio Tools ### Qt Visual Studio Tools

View file

@ -1,5 +1,5 @@
name: telegram-desktop name: kotatogram-desktop
adopt-info: telegram adopt-info: kotatogram
icon: Telegram/Resources/art/icon512@2x.png icon: Telegram/Resources/art/icon512@2x.png
base: core22 base: core22
@ -8,13 +8,13 @@ confinement: strict
compression: lzo compression: lzo
apps: apps:
telegram-desktop: kotatogram-desktop:
command: usr/bin/telegram-desktop command: usr/bin/kotatogram-desktop
command-chain: command-chain:
- bin/desktop-launch - bin/desktop-launch
common-id: org.telegram.desktop common-id: io.github.kotatogram
desktop: usr/share/applications/org.telegram.desktop.desktop desktop: usr/share/applications/io.github.kotatogram.desktop
autostart: telegram-desktop_telegram-desktop.desktop autostart: kotatogram-desktop_kotatogram-desktop.desktop
plugs: plugs:
- alsa - alsa
- audio-playback - audio-playback
@ -82,11 +82,11 @@ package-repositories:
ppa: kisak/kisak-mesa ppa: kisak/kisak-mesa
parts: parts:
telegram: kotatogram:
plugin: cmake plugin: cmake
source: . source: .
source-type: git source-type: git
parse-info: [usr/share/metainfo/org.telegram.desktop.metainfo.xml] parse-info: [usr/share/metainfo/io.github.kotatogram.metainfo.xml]
build-environment: build-environment:
- LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} - LD_LIBRARY_PATH: $CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
- LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s - LDFLAGS: ${LDFLAGS:+$LDFLAGS} -s
@ -136,19 +136,10 @@ parts:
override-pull: | override-pull: |
craftctl default craftctl default
version_file=Telegram/build/version version="$(git describe --tags | sed -r 's,^k([0-9]\.[0-9]),\1,')"
version=$(sed -n "s/AppVersionStr[ ]\+\(.*\)\+/\1/p" $version_file) snapcraftctl set version "$version"
beta=$(sed -n "s/BetaChannel[ ]\+\(.*\)\+/\1/p" $version_file)
if [ "$beta" != "0" ]; then sed -i 's|^Icon=kotatogram$|Icon=${SNAP}/meta/gui/icon.png|g' lib/xdg/io.github.kotatogram.desktop
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: | override-build: |
craftctl default craftctl default
rm -rf "$CRAFT_PART_INSTALL/usr/share/icons" rm -rf "$CRAFT_PART_INSTALL/usr/share/icons"
@ -222,7 +213,7 @@ parts:
stage: stage:
- -./usr/lib/$CRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2 - -./usr/lib/$CRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
after: after:
- telegram - kotatogram
ffmpeg: ffmpeg:
plugin: nil plugin: nil