Building telegram-desktop from sources

I will try to fix this issue https://source.puri.sm/Librem5/OS-issues/-/issues/295 (ignore that the issue starts with a stellarium problem, at the end it is one with telegram-desktop, just scroll down) and compile Telegram from the sources…

The journey starts with cloning from git and install tools:

git clone https://github.com/telegramdesktop/tdesktop.git
sudo apt install curl

get poetry:
curl -sSL https://install.python-poetry.org | python3 -

cd tdesktop/Telegram/build/docker/centos_env
poetry install
poetry run gen_dockerfile | docker buildx build -t tdesktop:centos_env -
-bash: docker: command not found

I tried to install docker with sudo apt install docker, but this isn’t docker. It’s only this

dpkg -L docker
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/docker
/usr/share/doc/docker/changelog.Debian.gz
/usr/share/doc/docker/copyright

So, how can I get the docker software?

1 Like
$ apt show docker
Package: docker
Version: 1.5-2
Priority: optional
Section: x11
Maintainer: Paul Tagliamonte <paultag@debian.org>
Installed-Size: 9,216 B
Depends: wmdocker
Download-Size: 2,556 B
APT-Sources: http://repo.pureos.net/pureos byzantium/main arm64 Packages
Description: transitional package
 This is a transitional package for system tray docking application.
 It can safely be removed.

The package you’re after is called docker.io.

1 Like

Thanks for the help. I installed it (and what was pulled in by it), but this docker tool does not fit the build instructions:

poetry run gen_dockerfile | docker buildx build -t tdesktop:centos_env -
unknown shorthand flag: 't' in -t
See 'docker --help'.

Usage:  docker [OPTIONS] COMMAND
...
Run 'docker COMMAND --help' for more information on a command.

To get more help with docker, check out our guides at https://docs.docker.com/go/guides/

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/purism/guru/tdesktop/Telegram/build/docker/centos_env/gen_dockerfile.py", line 4, in <module>
    from jinja2 import Environment, FileSystemLoader
ModuleNotFoundError: No module named 'jinja2'

Seems to be a known issue, see: https://github.com/telegramdesktop/tdesktop/issues/24927

@guru Why not using “Telegrand” a GTK client for Telegram instead for Telegram Desktop?

purism@pureos:~$ apt search “Telegrand”
Sorting... Done
Full Text Search... Done
1 Like

I could not get docker running correctly, filed an issue with telegram-desktop which was closed with the message:

“Install official Docker build from https://docs.docker.com/get-docker/, distributives provide a shrinked version”

So, I give up building it on the L5 itself. I have an older amd64 laptop collecting dust, what would be the best (read closest to L5) to install, perhaps a Debian, but which version? Or PureOS itself?

I’d go for building on an up-to-date (and fast) desktop. On e.g. Debian you have phosh/phoc/squeekboard packages so you can run telegram-desktop nested on your desktop in a minimalistic phosh session which will make developing way simpler than directly on the device.