BuildingΒΆ

The build stack uses the Rust development tools on your system. Install these on your system with rustup if they are not already available.

The following dependencies are also needed to build the project.

  • CMake: Needed by Cargo tool library dependency.
  • Libssl: Needed by Cargo tool library dependency.

Emscripten is needed to compile .wasm files. Install it using:

EMSCRIPTEN_VERSION=1.37.21
wget https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz
tar xzf emsdk-portable.tar.gz
cd emsdk-portable

emsdk update
emsdk install clang-e${EMSCRIPTEN_VERSION}-64bit
emsdk install emscripten-${EMSCRIPTEN_VERSION}

emsdk activate emscripten-${EMSCRIPTEN_VERSION}
emsdk activate clang-e${EMSCRIPTEN_VERSION}-64bit

Then add the location of the emsdk-portable directory, emsdk-portable/clang/e$EMSCRIPTEN_VERSION_64bit, and emsdk-portable/emscripten/$EMSCRIPTEN_VERSION to your PATH.

Finally install the Rust WebAssembly target architecture.

rustup target add wasm32-unknown-emscripten

The build stack also uses Node.js, the Yarn package manager, and the Webpack module bundler. Install these on your system if they are not already available.

It is also useful to have the Webpack development server installed.

A rkt container build script is included in the project repository and provides an installation which can be used to build the project also. See the description on building and running the container in the Development Tools Container section of this document for details.

For macOS, RktMachine provides a CoreOS VM which supports developing using the rkt container system.

For the Webpack build, first install Literacy and the other project dependencies using Yarn.

$ yarn

Then run the Webpack development server to build and serve a test site.

$ webpack-dev-server -d

Caution

Use the following if developing on the included rkt container in this repository. The extra options are needed for the development server to be reachable from the host machine.

$ webpack-dev-server -d --host 0.0.0.0 --public rktmachine.local:8080

The test site can be accessed via a browser on localhost:8080.

To test the Rust project, use:

cargo test