FedericoBruzzone / tdlib-rs

Rust wrapper around the Telegram Database Library 🦀
https://crates.io/crates/tdlib-rs
Apache License 2.0
19 stars 4 forks source link

support linux arm? #6

Open huangzulin opened 1 week ago

huangzulin commented 1 week ago

it support linux arm and arm64?

FedericoBruzzone commented 1 week ago

Yes, we support all versions if a TDLib for a specific target (including Linux ARM and ARM64) is already compiled in the system. Additionally, we are considering building the TDLib using GitHub Actions for these targets.

If I understand correctly it should be something like:

  1. Install Git, arm compiler, libc++, make, CMake >= 3.0.2, OpenSSL-dev, zlib-dev, gperf, PHP using your package manager
  2. Run these commands in Bash to build TDLib and to install it to td/tdlib
    
    # The path to the bin folder of ARM compiler
    export CROSS=/home/<name>/dev/arm/gcc-linaro-7.2.1/bin/arm-linux-gnueabihf
    export CC=${CROSS}-gcc
    export CXX=${CROSS}-g++

git clone https://github.com/tdlib/td.git cd td git checkout a3406de8d171bb422bb6ddf3bbd800e2

mkdir build_native cd build_native cmake .. cmake --build . --target prepare_cross_compiling cd ..

rm -rf build mkdir build cd build cmake .. CXXFLAGS="cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=../tdlib .. -DCMAKE_CROSSCOMPILING=True cmake --build . --target install



More info:
1. https://tdlib.github.io/td/build.html?language=Rust
2. https://github.com/tdlib/td/issues/49