tdl icon indicating copy to clipboard operation
tdl copied to clipboard

Providing precompiled TDLIB

Open feelfreelinux opened this issue 6 years ago • 9 comments

Hi! I'm working on small project that needs to connect to telegram client api in order to create conversation. I tried mtproto lib, however its really buggy and looks unusable. This library works really well, but I don't want my users to be forced to manually compile tdlib. Can I somehow ship prebuilt TDLib and nodejs binaries in one executable file?

Thanks for awesome lib

feelfreelinux avatar Jun 16 '18 09:06 feelfreelinux

You can try something like pkg

Bannerets avatar Jun 16 '18 16:06 Bannerets

Agreed, compiling the library is real pain. It's super slow and requires a lot of RAM. It also crashes on Linux if the version of OpenSSL used Node differs from one used in TDLib.

ip avatar Aug 08 '18 00:08 ip

@feelfreelinux @ip

@Bannerets Could you please attach to git the binary file?

Can't build it :(

e.g.: https://github.com/x2bool/egram.tel/blob/master/Egram/libtdjson.dylib

davydof avatar Aug 29 '18 01:08 davydof

@ip Thanks, but the problem is with Linux system on remote server, so I should use .so file.

davydof avatar Sep 06 '18 03:09 davydof

Then you should build it yourself, because it will link to the specific versions of OpenSSL and other libs.

ip avatar Sep 11 '18 05:09 ip

@ip I change the version on Heroku :) thanks!

davydof avatar Sep 11 '18 16:09 davydof

For your convenience, I created a project with prebuilt library for Ubuntu 16. It can be used as npm dependency.

https://github.com/Jollor/tdl-binary

As noted here, full compatibility is not guaranteed unless you build by yourself. However, it works perfectly on all my Ubuntu 16 machines and it could work on other distros as well.

david-benes avatar Nov 07 '18 12:11 david-benes

https://github.com/ForNeVeR/tdlib.native/releases

TheServat avatar Dec 18 '18 15:12 TheServat

For what it's worth, tdlib provides step by step build instructions for all platforms: https://tdlib.github.io/td/build.html

In particular, that's how I build tdlib in a Dockerfile:

#!/bin/bash -e
git clone -b v1.5.0 --depth 1 https://github.com/tdlib/td.git
cd td
rm -rf build
mkdir build
cd build
CXXFLAGS="-stdlib=libc++" CC=/usr/bin/clang-6.0 CXX=/usr/bin/clang++-6.0 cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib -DCMAKE_AR=/usr/bin/llvm-ar-6.0 -DCMAKE_NM=/usr/bin/llvm-nm-6.0 -DCMAKE_OBJDUMP=/usr/bin/llvm-objdump-6.0 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-6.0 ..
cmake --build . --target install
cd ..
cd ..
mv td/tdlib /usr/local
rm -rf td

Building on a Mac was also a breeze.

IlyaSemenov avatar Dec 27 '19 06:12 IlyaSemenov

Closing this old issue.

There has been prebuilt-tdlib for a while. Using tdl with prebuilt-tdlib on supported systems doesn't require any external native dependencies except libc.

Bannerets avatar Jun 22 '23 21:06 Bannerets