Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TdLib Universal Installer

License: MIT Platform Support Build Status

πŸš€ A comprehensive and reliable installation script for TdLib (Telegram Database Library) across all major platforms

This script automatically downloads, compiles, and installs TdLib with zero configuration required. Designed to work seamlessly on Linux, macOS, and Windows platforms with intelligent platform detection and automatic dependency management.

✨ Features

  • πŸ” Automatic Platform Detection: Supports Ubuntu/Debian, CentOS/RHEL, Arch Linux, macOS, and Windows
  • πŸ“¦ Dependency Management: Automatically installs all required build tools and libraries
  • πŸ”§ Platform-Specific Fixes: Resolves known issues like macOS atomic operations automatically
  • βœ… Installation Verification: Validates successful compilation and library creation
  • 🎨 Rich Output: Colored logging with clear progress indicators
  • ⚑ Parallel Compilation: Utilizes all available CPU cores for faster builds
  • πŸ›‘οΈ Error Handling: Comprehensive error detection and recovery mechanisms

πŸš€ Quick Start

One-Command Installation

curl -fsSL https://raw.githubusercontent.com/DeepPythonist/TDLIB-installer/main/install.sh | bash

Manual Installation

git clone https://github.com/DeepPythonist/TDLIB-installer.git
cd TDLIB-installer
chmod +x install.sh
./install.sh

πŸ“‹ Usage Options

# Standard installation
./install.sh

# Force clean reinstallation
./install.sh --force

# Skip dependency installation (if already installed)
./install.sh --skip-deps

# Verify existing installation only
./install.sh --verify-only

# Show help
./install.sh --help

πŸ”§ Platform Requirements

Linux (Ubuntu/Debian)

  • build-essential, cmake, git, libssl-dev, zlib1g-dev
  • Automatically installed by the script

Linux (CentOS/RHEL)

  • Development Tools, cmake, git, openssl-devel, zlib-devel
  • Automatically installed by the script

macOS

  • Xcode Command Line Tools (automatically installed)
  • Homebrew (automatically installed if needed)

Windows

  • Visual Studio 2019+ with C++ support
  • CMake and Git
  • Recommended: Use WSL (Windows Subsystem for Linux)

🐍 Python Integration

After successful installation, integrate TdLib into your Python projects:

import os
import ctypes
import json

# Load TdLib
tdjson_path = os.path.abspath('td/build/libtdjson.dylib')  # macOS
# tdjson_path = os.path.abspath('td/build/libtdjson.so')   # Linux

tdjson = ctypes.CDLL(tdjson_path)

# Configure function signatures
tdjson.td_json_client_create.restype = ctypes.c_void_p
tdjson.td_json_client_send.argtypes = [ctypes.c_void_p, ctypes.c_char_p]
tdjson.td_json_client_receive.argtypes = [ctypes.c_void_p, ctypes.c_double]
tdjson.td_json_client_receive.restype = ctypes.c_char_p

# Create client and start using TdLib
client = tdjson.td_json_client_create()

πŸ—οΈ Build Output

After successful installation, you'll find:

td/
β”œβ”€β”€ build/
β”‚   β”œβ”€β”€ libtdjson.dylib    # macOS dynamic library
β”‚   β”œβ”€β”€ libtdjson.so       # Linux dynamic library
β”‚   └── libtdjson.a        # Static library (all platforms)
└── ...

πŸ” Troubleshooting

macOS Issues

The script automatically handles common macOS compilation issues:

  • Atomic Operations: Automatically patched for Apple Clang compatibility
  • Command Line Tools: Auto-installation and updates
  • SDK Path: Automatic detection and configuration

Linux Issues

  • Missing Dependencies: Automatically detected and installed
  • Compiler Compatibility: Supports GCC and Clang
  • Architecture Support: x86_64, ARM64, and ARM32

General Issues

# Verify installation
./install.sh --verify-only

# Clean reinstall
./install.sh --force

# Check logs for detailed error information

🌍 Platform Support Matrix

Platform Status Notes
Ubuntu 18.04+ βœ… Fully supported
Debian 10+ βœ… Fully supported
CentOS 7+ βœ… Fully supported
RHEL 7+ βœ… Fully supported
Arch Linux βœ… Fully supported
macOS 10.15+ βœ… With automatic fixes
Windows 10+ ⚠️ Recommended: WSL

πŸ“š Documentation & Resources

🀝 Contributing

We welcome contributions! Please feel free to submit issues, feature requests, or pull requests.

Development Setup

git clone https://github.com/DeepPythonist/TDLIB-installer.git
cd TDLIB-installer
# Make your changes
./install.sh --verify-only  # Test your changes

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • TdLib Team for creating the excellent Telegram Database Library
  • Community contributors for testing and feedback across different platforms

Made with ❀️ for the developer community

For support, please open an issue on GitHub or check our troubleshooting guide above.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages