You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

29 lines
808 B

  1. #!/bin/bash
  2. # Set up emscripten
  3. source ~/emsdk/emsdk_env.sh
  4. if [[ -z "${EMSDK}" ]]; then
  5. echo "Installing emscripten..."
  6. echo ""
  7. if [[ ! -e ./emsdk/emsdk ]]; then
  8. git submodule init
  9. git submodule update
  10. fi
  11. cd emsdk && git pull
  12. ~/emsdk install latest && ./emsdk activate latest
  13. source ~/emsdk_env.sh
  14. cd ..
  15. fi
  16. # This applies a patch to fastcomp to make sure that the
  17. # environment is set correctly for react environments
  18. patch -N --verbose ~/emsdk/fastcomp/emscripten/src/shell.js.orig scripts/emscripten.patch
  19. mkdir -p jsbuild && cd jsbuild && rm -rf *
  20. emcmake cmake .. -DNO_AES=1 -DARCH=default -DBUILD_WASM=1 -DBUILD_JS=0
  21. make && cp fedoragold-crypto-wasm.js ../dist
  22. emcmake cmake .. -DNO_AES=1 -DARCH=default -DBUILD_WASM=0 -DBUILD_JS=1
  23. make && cp fedoragold-crypto.js ../dist