From 6d0ceb9c1b698f35e526ea0beb04dc4a2e12d054 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 24 Dec 2018 05:02:53 +0300 Subject: [PATCH] Add web example README. GitOrigin-RevId: 16f423f0f09b5f144cdbb6975110bf7316fb9cdd --- example/web/README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 example/web/README.md diff --git a/example/web/README.md b/example/web/README.md new file mode 100644 index 000000000..c036bceb6 --- /dev/null +++ b/example/web/README.md @@ -0,0 +1,24 @@ +# TDLib Web example + +This is an example of building `TDLib` for browsers using [Emscripten](https://github.com/kripken/emscripten). +These scripts build `TDLib` and creates [NPM](https://www.npmjs.com/) package [tdweb](https://www.npmjs.com/package/@arseny30/tdweb); +You need Unix shell with `sed`, `tar` and `wget` utilities to run provided scripts. + +## Building TDLib + +* Install latest [emsdk](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html). Do not use system-provided `emscripten` package, because it contains too old version. +* Install all `TDLib` build dependencies as described in [Building](https://github.com/tdlib/td#building). +* Run `source ./emsdk_env.sh` from `emsdk` directory to set up correct build environment. +* On `macOS` install `coreutils` [Homebrew](https://brew.sh) package and replace `realpath` usages in scripts with `grealpath`: +``` +brew install coreutils +sed -i.bak 's/[(]realpath/(grealpath/g' build-tdlib.sh +``` +* Run build scripts in the following order: +``` +cd /example/web +./build-openssl.sh +./build-tdlib.sh +./copy-tdlib.sh +./build-tdweb.sh +```