• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..07-Dec-2021-

tdweb/H03-May-2022-7,8157,806

.gitignoreH A D07-Dec-202188 65

README.mdH A D07-Dec-20211.4 KiB3024

build-openssl.shH A D07-Dec-20211.2 KiB2822

build-tdlib.shH A D07-Dec-20211.5 KiB4433

build-tdweb.shH A D07-Dec-202192 74

copy-tdlib.shH A D07-Dec-2021205 74

README.md

1# TDLib Web example
2
3This is an example of building `TDLib` for browsers using [Emscripten](https://github.com/kripken/emscripten).
4These scripts build `TDLib` and create an [NPM](https://www.npmjs.com/) package [tdweb](https://www.npmjs.com/package/tdweb).
5You need a Unix shell with `sed`, `tar` and `wget` utilities to run the provided scripts.
6
7## Building tdweb NPM package
8
9* Install the 2.0.6 [emsdk](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html), which is known to work. Do not use the system-provided `emscripten` package, because it contains a too old emsdk version.
10* Install all `TDLib` build dependencies described in [Building](https://github.com/tdlib/td#building).
11* Run `source ./emsdk_env.sh` from `emsdk` directory to set up the correct build environment.
12* On `macOS`, install the `coreutils` [Homebrew](https://brew.sh) package and replace `realpath` in scripts with `grealpath`:
13```
14brew install coreutils
15sed -i.bak 's/[(]realpath/(grealpath/g' build-tdlib.sh
16```
17* Run build scripts in the following order:
18```
19cd <path to TDLib sources>/example/web
20./build-openssl.sh
21./build-tdlib.sh
22./copy-tdlib.sh
23./build-tdweb.sh
24```
25* The built package is now located in the `tdweb` directory.
26
27## Using tdweb NPM package
28
29See [tdweb](https://www.npmjs.com/package/tdweb) or [README.md](https://github.com/tdlib/td/tree/master/example/web/tdweb/README.md) for package documentation.
30