Botspot / pi-apps

Raspberry Pi App Store for Open Source Projects
GNU General Public License v3.0
2.04k stars 207 forks source link

Telegram (app request) #156

Closed NickDiggers closed 3 years ago

NickDiggers commented 3 years ago

Yes, I know that you can install it using the command 'sudo install telegram-desktop', but the version you install will be too old, I would like to see a new version of this messenger. Thank you in advance :D

Itai-Nelken commented 3 years ago

@Aradionov366 you can install it from snap (https://snapcraft.io/telegram-desktop there are armhf and arm64 versions),
flatpak (https://flathub.org/apps/details/org.telegram.desktop not sure there are arm versions though)
if you want can compile it yourself (https://github.com/telegramdesktop/tdesktop/blob/dev/docs/building-cmake.md)
and as you said you can also install it with sudo apt install telegram-desktop (but its outdated).

I don't think that a app that's available on so many places for the pi can be on pi-apps

Botspot commented 3 years ago

I still haven't decided on this. Issue will remain open until I make a decision.

Botspot commented 3 years ago

It appears that you can install telegram via Flatpak:

sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.telegram.desktop

To run:

/var/lib/flatpak/exports/share/applications/org.telegram.desktop.desktop

@Aradionov366, could you please compare the Flatpak version to the APT version and convince me that the Flatpak version is indeed better/necessary?

Itai-Nelken commented 3 years ago

It appears that you can install telegram via Flatpak:

sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.telegram.desktop

To run:

/var/lib/flatpak/exports/share/applications/org.telegram.desktop.desktop

@Aradionov366, could you please compare the Flatpak version to the APT version and convince me that the Flatpak version is indeed better/necessary?

@Aradionov366 reboot after installing flatpak, and the menu button will appear. also if it doesn't, you can run using the command @Botspot sent, or this command:

flatpak run org.telegram.desktop
Botspot commented 3 years ago

Closing this issue, as @Aradionov366 has not replied explaining why the apt-get version of Telegram is sub-optimal.

fabianmendes commented 3 years ago

Please reopen this issue. Snap installation version has conflicts, also, Menu Icon is not set. 2021-01-20-113335_800x480_scrot

Otherwise, I can't set it less than 100% such an annoying thing. Also, I confirm that it is outdated, there are messages that say you should install Telegram desktop because the message is not compatible with this version. :) 2021-01-20-114516_800x480_scrot

Botspot commented 3 years ago

@Itai-Nelken Would an electron webapp be suitable for this?

Itai-Nelken commented 3 years ago

@Itai-Nelken Would an electron webapp be suitable for this?

why not? I'll make one.

Itai-Nelken commented 3 years ago

@Botspot I just tested telegram web (that the nativefier app will use) and it lacks some features.

Botspot commented 3 years ago

@Botspot I just tested telegram web (that the nativefier app will use) and it lacks some features.

Any course of action, or is this a dead-end?

Itai-Nelken commented 3 years ago

@Botspot I just tested telegram web (that the nativefier app will use) and it lacks some features.

Any course of action, or is this a dead-end?

its not really bad, just some things it can't display. Ill try to compile the official desktop app.

Itai-Nelken commented 3 years ago

@Botspot no luck, it needs some x86_64 software... so or use a nativefier webapp that is the same as using the website, or use the flatpak version, or don't add it (best option in my opinion as we don't want to add broken or half functioning apps).

Botspot commented 3 years ago

@Botspot no luck, it needs some x86_64 software... so or use a nativefier webapp that ios the same as using the website, or use the flatpak version, or don't add it (best option in my opinion as we don't want to add broken or half functioning apps).

Is the flatpak version somehow special? Or is it missing the same features as the electron app?

Itai-Nelken commented 3 years ago

@Botspot no luck, it needs some x86_64 software... so or use a nativefier webapp that ios the same as using the website, or use the flatpak version, or don't add it (best option in my opinion as we don't want to add broken or half functioning apps).

Is the flatpak version somehow special? Or is it missing the same features as the electron app?

Ill test it and see.

Itai-Nelken commented 3 years ago

@Botspot the flatpak app looks like the official app, and it feels pretty snappy and fast. image it even has a tray icon: image1 image2

Itai-Nelken commented 3 years ago

its way better than the website.

Itai-Nelken commented 3 years ago

just a note: you have to log out and back in or reboot for the desktop shortcuts to appear. another way to fix that might be running source ~/.bashrc but I didn't try it and I doubt it will work.

Botspot commented 3 years ago

its way better than the website.

Then let's use the Flatpak app.

Itai-Nelken commented 3 years ago

Then let's use the Flatpak app.

I'll make the scripts then. something else: to install the flatpak app, flatpak needs to be installed obviously, so when uninstalling I think the script shouldn't remove flatpak in case the user installed any other flatpak apps. what do you say?

Botspot commented 3 years ago

Then let's use the Flatpak app.

I'll make the scripts then. something else: to install the flatpak app, flatpak needs to be installed obviously, so when uninstalling I think the script shouldn't remove flatpak in case the user installed any other flatpak apps. what do you say?

flatpak is an apt package, right? If so, then I'd say pkg-install is the best way to go. (So that if flatpak is installed prior to installing Telegram, it will remain unchanged upon uninstalling Telegram)

Itai-Nelken commented 3 years ago

flatpak is an apt package, right?

what I mean is what will happen if the user installs flatpak apps after installing telegram from pi-apps. do you still think using pkg-install is the best way?

Botspot commented 3 years ago

flatpak is an apt package, right?

what I mean is what will happen if the user installs flatpak apps after installing telegram from pi-apps. do you still think using pkg-install is the best way?

Oh I see what you mean. Yes there is a small chance of that exact scenario happening, as flatpak is a commonly used package.

I guess it wouldn't do harm to leave it installed. Use apt I guess.

Itai-Nelken commented 3 years ago

bad news @Botspot, the app is really unstable, it crashed 3 times in a row when trying to read messages... here is the output when running from terminal if someone wants it:

pi@twisterpi-4-4gb:~ $ flatpak run org.telegram.desktop 
Gtk-Message: 21:13:17.324: Failed to load module "appmenu-gtk-module"
Qt: Session management error: Authentication Rejected, reason : None of the authentication protocols specified are supported and host-based authentication failed
error: : cannot open
error: : cannot open
error: : cannot open
[swscaler @ 0x9f795a00] No accelerated colorspace conversion found from yuv420p to bgra.
pi@twisterpi-4-4gb:~ $ 

the part with swscaler @ 0x9ef71510] is when it crashed.

Itai-Nelken commented 3 years ago

(I won't create the scripts as it makes no sense because the app is so unstable)

Botspot commented 3 years ago

(I won't create the scripts as it makes no sense because the app is so unstable)

Understand. Before giving up though, could you try correcting the Failed to load module "appmenu-gtk-module" error?

Maybe fixing that will fix everything.

Itai-Nelken commented 3 years ago

Understand. Before giving up though, could you try correcting the Failed to load module "appmenu-gtk-module" error?

Maybe fixing that will fix everything.

might try tomorrow.

Itai-Nelken commented 3 years ago

this looks promising: https://forum.snapcraft.io/t/raspbery-pi-3b-chromium-error/18010/6 if we can get the snap version working we can use this, also maybe it will fix the flatpak version!

Painadath commented 3 years ago

@Itai-Nelken is it possible to compile every web application like this

Itai-Nelken commented 3 years ago

@Itai-Nelken is it possible to compile every web application like this

@Painadath I don't understand, do you mean if we can compile it? If yes than no, the telegram desktop app has some x86_64 only dependencies.

Itai-Nelken commented 3 years ago

@Botspot the errors the snap version gives can be fixed by commenting out this line in /etc/ld.so.preload:

/usr/lib/arm-linux-gnueabihf/libarmmem-${PLATFORM}.so

but its pretty outdated but I didn't have any problems with it so far. TBH I don't use telegram so much, so I have no idea if some things won't work.

I'll test later if this also fixes the flatpak version that is much newer.

Itai-Nelken commented 3 years ago

the flatpak version is now working as well even without the fix! but its older (v2.2) than snap version (v2.6), the newest is version 2.7. so I say we should go with the snap version. and the fix isn't needed, it works great so far without it.

Itai-Nelken commented 3 years ago

this should work to install tdesktop (inside a pi-apps install script only):

if [[ ! -f "${DIRECTORY}/data/status/Snap Store" ]] && [[ $(cat "${DIRECTORY}/data/status/Snap Store") != "installed" ]]; then
    if ! command -v snap >/dev/null ; then
        ${DIRECTORY}/manage install "Snap Store" || error "Failed to install snap store!"
    fi
else
    echo -e "\e[1mSnap is already installed...\e[0m"
fi
sudo snap install telegram-desktop || error "snap failed to install telegram-dekstop!"

the problem is that if the user uninstall the snap-store, telegram will stop working. what do you have any ideas @Botspot?

Botspot commented 3 years ago

Are you sure there's no way to electronify it?

How about reverse-engineering the snap?

Itai-Nelken commented 3 years ago

there isn't any way I can think of to reverse engineer a snap or electronify a app that its website is worse than the app (missing features) andthe desktop app written in c++ and not javascript (thats actually good, it means its less resource intensive!).

there is already a request for arm: https://github.com/telegramdesktop/tdesktop/issues/1924 there is also this if we don't end up in "dependency hell": https://packages.debian.org/sid/armhf/telegram-desktop/download

Botspot commented 3 years ago

there isn't any way I can think of to reverse engineer a snap

What I mean is: would it be possible to extract the snap so that can run dependently of Snap? (Hint: yes it is. I did it with Boxy SVG around a year ago, but have forgotten how to do it now.)

Itai-Nelken commented 3 years ago

I found a different way in the rpi support issue in the tdesktop repo: using the debian sid packages. I only have to update the versions as the comment with the instructions is from 2016 and then test it. Will do it tomorrow.

Itai-Nelken commented 3 years ago

I'm currently testing this. from https://github.com/telegramdesktop/tdesktop/issues/1924#issuecomment-520380465

# Install Dependencies
sudo apt install -y \
    'libasyncns0' \
    'libavcodec-dev' \
    'libavcodec-extra' \
    'libavcodec-extra58' \
    'libavcodec-extra58-dbgsym' \
    'libavformat-dev' \
    'libavformat58' \
    'libavformat58-dbgsym' \
    'libavutil-dev' \
    'libavutil56' \
    'libavutil56-dbgsym' \
    'libdouble-conversion1' \
    'libflac8' \
    'libgle3' \
    'libgle3-dev' \
    'libglee0d1' \
    'libglee0d1-dbg' \
    'libgles1' \
    'libgles2' \
    'libgles2-mesa' \
    'libgles2-mesa-dev' \
    'libglew-dev' \
    'libglew2.1' \
    'libglewmx1.13' \
    'libglu1-mesa' \
    'libjpeg8' \
    'libminizip1' \
    'libmng1' \
    'libopenal-data' \
    'libopenal1' \
    'libpcre16-3' \
    'libpulse0' \
    'libqt5core5a' \
    'libqt5dbus5' \
    'libqt5gui5' \
    'libqt5network5' \
    'libqt5svg5' \
    'libqt5widgets5' \
    'libsndfile1' \
    'libsndio-dev' \
    'libsndio7.0' \
    'libswscale-dev' \
    'libswscale5' \
    'libswscale5-dbgsym' \
    'libwebpdemux2' \
    'libxcb-icccm4' \
    'libxcb-keysyms1' \
    'libxcb-randr0' \
    'libxcb-render-util0' \
    'libxcb-xinerama0' \
    'libxcb-xkb1' \
    'libxkbcommon-x11-0' \
    'libxkbcommon0' \
    'libxxhash-dev' \
    'libxxhash0' \
    'mesa-utils' \
    'qt5-gtk-platformtheme' \
    'qt5-image-formats-plugins' \
    'qttranslations5-l10n'

# Download Telegram Components
wget \
    'http://ftp.us.debian.org/debian/pool/main/libt/libtgvoip/libtgvoip1.0_1.0~git20170704.445433f-4~bpo9+1_armhf.deb' \
    'http://ftp.us.debian.org/debian/pool/main/libt/libtgvoip/libtgvoip-dev_2.4.2-1_armhf.deb' \
    'http://ftp.it.debian.org/debian/pool/main/t/telegram-desktop/telegram-desktop_2.6.1+ds-1_armhf.deb'

# Install Telegram Components
sudo dpkg -i \
    'libtgvoip1.0_1.0~git20170704.445433f-4~bpo9+1_armhf.deb' \
    'libtgvoip-dev_2.4.2-1_armhf.deb' \
    'telegram-desktop_2.6.1+ds-1_armhf.deb'
Itai-Nelken commented 3 years ago

the snap edge version is the latest, so I'm currently downloading it and will extract it.

Itai-Nelken commented 3 years ago

this https://github.com/Botspot/pi-apps/issues/156#issuecomment-826831476 didn't work :( dependency problems...

Itai-Nelken commented 3 years ago
The following packages have unmet dependencies:
 telegram-desktop : Depends: libavcodec58 (>= 7:4.2)
                    Depends: libavformat58 (>= 7:4.2) but 7:4.1.6-1~deb10u1+rpt1 is to be installed
                    Depends: libc6 (>= 2.29) but 2.28-10+rpi1 is to be installed
                    Depends: libgcc-s1 (>= 3.5) but it is not installable
                    Depends: libgdk-pixbuf-2.0-0 (>= 2.22.0) but it is not installable
                    Depends: libqt5core5a (>= 5.15.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed
                    Depends: libqt5dbus5 (>= 5.14.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed
                    Depends: libqt5gui5 (>= 5.15.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed or
                             libqt5gui5-gles (>= 5.15.1) but it is not installable
                    Depends: libqt5network5 (>= 5.15.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed
                    Depends: libqt5widgets5 (>= 5.15.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed
                    Depends: librlottie0-1 (>= 0~git20200305.a717479+dfsg) but it is not going to be installed
                    Depends: qtbase-abi-5-15-2 but it is not installable
                    Depends: qtwayland-client-abi-5-15-2 but it is not installable
                    Recommends: fonts-open-sans but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
NoozAbooz commented 3 years ago
The following packages have unmet dependencies:
 telegram-desktop : Depends: libavcodec58 (>= 7:4.2)
                    Depends: libavformat58 (>= 7:4.2) but 7:4.1.6-1~deb10u1+rpt1 is to be installed
                    Depends: libc6 (>= 2.29) but 2.28-10+rpi1 is to be installed
                    Depends: libgcc-s1 (>= 3.5) but it is not installable
                    Depends: libgdk-pixbuf-2.0-0 (>= 2.22.0) but it is not installable
                    Depends: libqt5core5a (>= 5.15.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed
                    Depends: libqt5dbus5 (>= 5.14.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed
                    Depends: libqt5gui5 (>= 5.15.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed or
                             libqt5gui5-gles (>= 5.15.1) but it is not installable
                    Depends: libqt5network5 (>= 5.15.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed
                    Depends: libqt5widgets5 (>= 5.15.1) but 5.11.3+dfsg1-1+rpi1+deb10u4 is to be installed
                    Depends: librlottie0-1 (>= 0~git20200305.a717479+dfsg) but it is not going to be installed
                    Depends: qtbase-abi-5-15-2 but it is not installable
                    Depends: qtwayland-client-abi-5-15-2 but it is not installable
                    Recommends: fonts-open-sans but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

Welcome to dependency hell Itai 😆. packages.debian.com is your friend for this one.

Itai-Nelken commented 3 years ago

Welcome to dependency hell Itai 😆. packages.debian.com is your friend for this one.

didn't find the packages there... and I don't want to get into dependency hell again (already happened to me a few times...)

Itai-Nelken commented 3 years ago

@Botspot to download and extract a snap: Download it:

snap download snap-name

Extract it:

sudo mkdir /dev/snap/
sudo mount -t squashfs -o ro /path/to/app.snap /dev/snap

Unmount it:

sudo umount /dev/snap
sudo rmdir /dev/snap/
cycool29 commented 3 years ago

This should be closed since Telegram is in pi-apps now. @Botspot