Skip to content

Instantly share code, notes, and snippets.

@B0yma
Last active October 20, 2024 16:26
Show Gist options
  • Select an option

  • Save B0yma/bf2e05faf718f1e5b70e8f3c71a6bd50 to your computer and use it in GitHub Desktop.

Select an option

Save B0yma/bf2e05faf718f1e5b70e8f3c71a6bd50 to your computer and use it in GitHub Desktop.
wsl --install //if error - https://learn.microsoft.com/en-us/answers/questions/1356541/wsl-ubuntu-doesnt-run-can-not-find-a-file
sudo apt-get update
sudo apt install gperf
apt-get install make git zlib1g-dev libssl-dev gperf php-cli cmake clang-14 libc++-dev libc++abi-dev sed tar wget python3 python-is-python3
///
git clone https://github.com/emscripten-core/emsdk.git
git checkout tags/3.1.51 or git checkout tags/3.1.1
cd emsdk
git pull
./emsdk install latest
./emsdk activate latest
echo 'source "/home/magz/emsdk/emsdk_env.sh"' >> $HOME/.bash_profile
source "/home/magz/emsdk/emsdk_env.sh"
source ./emsdk_env.sh
///
cd /mnt/c/Users/Magz/Desktop/tdlib/example/web
export CXX="clang++-14" && export CC="clang-14"
///
./build-openssl.sh
./build-tdlib.sh
./copy-tdlib.sh
// if errors part
1. copy all text in tdweb.js
1. go to https://babeljs.io/repl and paste
1. copy transpilated text from site
1. replace all text in tdweb.js
1. find file - 1.<YOUR HASH>.worker.js
1. find string - createTdwebModule.ready.FS = Module.FS;
1. replace by string - Module.ready.FS = Module.FS;
///
./build-tdweb.sh
///
1. find file - tdweb.js
1. find code
```
if ('onUpdate' in options) {
this.onUpdate = options.onUpdate;
delete options.onUpdate;
}
```
1. replace by code
```
if ('onUpdate' in options) {
this.onUpdate = function(data) {
options.onUpdate(JSON.stringify(data));
return options.onUpdate;
};
delete options.onUpdate;
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment