From 34b874c38d5c551fdb4c34d1f8562401e5a4558e Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Tue, 1 Sep 2020 14:16:43 +0200 Subject: [PATCH] Fixed current build errors --- setup_old.md | 127 ------------------- shared/js/connection/DummyVoiceConnection.ts | 14 +- web/.gitignore | 2 +- web/app/audio-lib/worker/async_require.js | 13 ++ 4 files changed, 27 insertions(+), 129 deletions(-) delete mode 100644 setup_old.md create mode 100644 web/app/audio-lib/worker/async_require.js diff --git a/setup_old.md b/setup_old.md deleted file mode 100644 index d2975740..00000000 --- a/setup_old.md +++ /dev/null @@ -1,127 +0,0 @@ -# Attention this guid is currently outdated! -Anyway most of this stuff is still relevant for the web client, just the last few steps may differ - - -# Build TeaWeb -## General start -Before you start, please ensure that you've successfully set up your environment. -If you don't want to install all this, you could also use the official web build docker. - - -## 1. Clone and initialize project -```bash -git clone https://github.com/TeaSpeak/TeaWeb -git submodule update --init --recursive --remote --checkout -``` - -## (2.) Build native libraries -As already mentioned, if you're just want to develop or style the web client this isnt required! -If you want to speak or use TeamSpeak 3 Identities you have to complete this! -### Opus -#### Native loader -```bash -cd asm -./make_opus.sh -``` -#### Javascript loader -```bash -npm run build-worker -``` - - -### Tommath -```bash -cd libraries/tommath -mkdir build; cd build -emcmake cmake .. -emmake make -j 4 -``` - -### Tomcrypt -ATTENTION: Do not use the `create_build.sh` script! -```bash -cd libraries/tomcrypt -emmake make -f makefile CFLAGS="-DUSE_LTM -DLTM_DESC -I../tommath/" EXTRALIBS="$(pwd)/../tommath/build/libtommathStatic.a" test -``` - -### Make js files -```bash -cd asm -mkdir build; cd build -emcmake cmake .. -emmake make -j 4 -``` - -## 3. Compiling the typescript and as well the style sheets -```bash -npm install --only=dev # Install the dependencies -./scripts/web_build.sh dev # Use "rel" insteadof "dev" to create a release build -``` -You should now find an ready to use environment within `web/environment/development`. -Please notice that all files are just *relative* links to the files. - -## 4. Create a final package -```bash -./scripts/web_package.sh dev # Use "rel" insteadof "dev" to create a release package -``` - -# Environment setup -## Basic system requirements -You need a linux based (ubuntu or debian is recommanded) system. -As well you need the following packaged installed: -```bash -apt-get install git wget gcc make python2.7 xz-utils php5 autoconf libtool zip -``` -ATTENTION: Its important to have python2.7 as default `python` command. - -### Install emscripten -`emscripten` is required for compiling c++ into webassably or even javascript. -This currently affects the TeamSpeak 3 Identity part and the codec part. -Just for developing or styling the web client, this isn't required. -So if you want to save some time you could scrip this. - -#### Install java (Required for emscripten) -```bash -apt-get install software-properties-common -add-apt-repository ppa:webupd8team/java -apt-get update -apt-get install oracle-java8-installer -``` - -#### Install cmake (For webassembly and emscripten) -```bash -wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz -tar xvf cmake-*.tar.gz -cd cmake-* -./configure -make -j 4 -make install -``` - -#### Install nodjs (Later for emscripten too) -```bash -wget https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz -tar xvf node-*.tar.xz -cd node-* -cp -R * /usr/local/ -``` - -#### Install emscripten with fastcomp and llvm + clang -##### Fastcomp and CLang compiler -```bash -git clone https://github.com/kripken/emscripten-fastcomp -cd emscripten-fastcomp -git clone https://github.com/kripken/emscripten-fastcomp-clang tools/clang -mkdir build; cd build -cmake .. -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="host;JSBackend" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF -DCLANG_INCLUDE_TESTS=OFF -make -j 4 -make install -``` -##### Emscripten -```bash -git clone https://github.com/kripken/emscripten.git -cd emscripten -python emscripten.py -python emscripten.py #Execute it twice to detekt error -echo "PATH=\"$PATH:`pwd`\"" >> ~/.bashrc -``` \ No newline at end of file diff --git a/shared/js/connection/DummyVoiceConnection.ts b/shared/js/connection/DummyVoiceConnection.ts index b2b573ee..caab207b 100644 --- a/shared/js/connection/DummyVoiceConnection.ts +++ b/shared/js/connection/DummyVoiceConnection.ts @@ -2,10 +2,11 @@ import { AbstractVoiceConnection, LatencySettings, PlayerState, VoiceClient, - VoiceConnectionStatus + VoiceConnectionStatus, WhisperSessionInitializer } from "tc-shared/connection/VoiceConnection"; import {RecorderProfile} from "tc-shared/voice/RecorderProfile"; import {AbstractServerConnection} from "tc-shared/connection/ConnectionBase"; +import {WhisperSession} from "tc-shared/voice/Whisper"; class DummyVoiceClient implements VoiceClient { client_id: number; @@ -124,4 +125,15 @@ export class DummyVoiceConnection extends AbstractVoiceConnection { return this.recorder; } + dropWhisperSession(session: WhisperSession) { } + + getWhisperSessionInitializer(): WhisperSessionInitializer | undefined { + return undefined; + } + + getWhisperSessions(): WhisperSession[] { + return []; + } + + setWhisperSessionInitializer(initializer: WhisperSessionInitializer | undefined) { } } \ No newline at end of file diff --git a/web/.gitignore b/web/.gitignore index f986e825..b126382e 100644 --- a/web/.gitignore +++ b/web/.gitignore @@ -8,4 +8,4 @@ app/**/*.css.map app/**/*.js app/**/*.js.map -!app/audio-lib/async_require.js \ No newline at end of file +!app/audio-lib/worker/async_require.js \ No newline at end of file diff --git a/web/app/audio-lib/worker/async_require.js b/web/app/audio-lib/worker/async_require.js new file mode 100644 index 00000000..a6c8d2b6 --- /dev/null +++ b/web/app/audio-lib/worker/async_require.js @@ -0,0 +1,13 @@ +/* + * This is more a hack than any thing else. + * TypeScript can't keep the async import statements, but we require it to initialize the wasm object... + */ +module.exports = { + getAudioLibraryInstance() { + return import("../../../audio-lib/pkg/index_bg.wasm").then(wasm => { + return import("../../../audio-lib/pkg/index").then(pkg => { + return Object.assign(pkg, { memory: wasm.memory }); + }); + }); + } +}; \ No newline at end of file