Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 07-Dec-2021 | - | ||||
tdweb/ | H | 03-May-2022 | - | 7,815 | 7,806 | |
.gitignore | H A D | 07-Dec-2021 | 88 | 6 | 5 | |
README.md | H A D | 07-Dec-2021 | 1.4 KiB | 30 | 24 | |
build-openssl.sh | H A D | 07-Dec-2021 | 1.2 KiB | 28 | 22 | |
build-tdlib.sh | H A D | 07-Dec-2021 | 1.5 KiB | 44 | 33 | |
build-tdweb.sh | H A D | 07-Dec-2021 | 92 | 7 | 4 | |
copy-tdlib.sh | H A D | 07-Dec-2021 | 205 | 7 | 4 |
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