tdl
tdl copied to clipboard
Providing precompiled TDLIB
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
You can try something like pkg
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.
@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
@ip
Thanks, but the problem is with Linux system on remote server, so I should use .so
file.
Then you should build it yourself, because it will link to the specific versions of OpenSSL and other libs.
@ip I change the version on Heroku :) thanks!
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.
https://github.com/ForNeVeR/tdlib.native/releases
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.
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.