#telegram #tdlib #client #build #tdjson #source

sys tdlib-sys

Sys crate for Telegram's TDLib client library

2 unstable releases

0.2.0 Apr 21, 2020
0.1.0 Apr 21, 2020

#13 in #tdlib


Used in tdlib-bindgen

ISC license

14MB
322K SLoC

C 170K SLoC // 0.1% comments C++ 147K SLoC // 0.0% comments JavaScript 1.5K SLoC // 0.1% comments PHP 1K SLoC // 0.2% comments Java 717 SLoC // 0.2% comments C# 465 SLoC // 0.1% comments Shell 167 SLoC // 0.1% comments Swift 151 SLoC // 0.1% comments PowerShell 133 SLoC Python 87 SLoC // 0.2% comments Visual Studio Solution 71 SLoC Rust 66 SLoC // 0.1% comments

tdlib-sys

build macOS windows bindgen crates.io

Rust sys crate for Telegram's TDLib client library.

Requires the gperf tool to be installed to build, and the following development libraries:

  • libssl
  • zlib

Standard build tools are required, and additionally:

  • cmake

All build instructions below for OSX and Windows are currently only tested on Github workflows, if you find something more accurate for a normal system, please feel free to send a PR!

Dynamically linked builds

Get source

git clone https://github.com/nuxeh/tdlib-sys.git
cd tdlib-sys

Linux

sudo apt install gperf perl build-essential cmake libssl-dev libz3-dev
cargo build

It should be possible to dynamically link on other platforms, but this is currently untested.

Statically linked builds

The crate feature bundled_deps can be used on any platform to use zlib and openssl built statically by their respective sys crates.

This does not require the installation of either of the dependencies on the host system, so is an easy solution for building on Windows and OSX.

This still requires standard build tools, and additionally the following to be installed:

  • perl

Get source

git clone https://github.com/nuxeh/tdlib-sys.git
cd tdlib-sys

Linux

sudo apt install gperf perl build-essential cmake
cargo build --features bundled_deps

OSX

brew install gperf perl
cargo build --features bundled_deps

Windows

vcpkg.exe install gperf:x86-windows
cargo build --features bundled_deps

Dependencies

~1.1–2.6MB
~45K SLoC