Skip to content

Instantly share code, notes, and snippets.

@unicomp21
Created June 10, 2021 11:13
Show Gist options
  • Save unicomp21/91a4a1cccd5d2c5837a2f0424c69d38f to your computer and use it in GitHub Desktop.
Save unicomp21/91a4a1cccd5d2c5837a2f0424c69d38f to your computer and use it in GitHub Desktop.
building google filament
###
FROM ubuntu:20.04 as filament
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update
RUN apt-get install -y cmake ninja-build python3-distutils autoconf automake libtool build-essential libssl-dev wget tar
RUN apt-get install -y clang-9 libglu1-mesa-dev libc++-9-dev libc++abi-9-dev
RUN apt-get install -y libxi-dev
RUN apt-get install -y emacs-nox git curl wget unzip
RUN apt-get -y install pkg-config
RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-9 100
RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-9 100
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/clang 100
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++ 100
WORKDIR /tmp
RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz
RUN tar -zxvf cmake-3.20.2.tar.gz
WORKDIR /tmp/cmake-3.20.2
RUN ./bootstrap
RUN make
RUN make install
### emsdk
WORKDIR /tmp
RUN git clone https://github.com/emscripten-core/emsdk.git
WORKDIR /tmp/emsdk
RUN /bin/bash -c "source ./emsdk_env.sh"
ENV PATH="/tmp/emsdk:/tmp/emsdk/upstream/emscripten:/tmp/emsdk/node/12.9.1_64bit/bin:${PATH}"
ENV EMSDK /tmp/emsdk
ENV EM_CONFIG /root/.emscripten
ENV EMSDK_NODE /tmp/emsdk/node/12.9.1_64bit/bin/node
RUN ./emsdk install latest
RUN ./emsdk activate latest
RUN apt-get install -y default-jre default-jdk
ENV JAVA_HOME=/usr/bin/java
### filament
WORKDIR /tmp
RUN git clone https://github.com/google/filament.git
WORKDIR /tmp/filament
RUN ln -s /usr/bin/python3 /usr/bin/python & ln -s /usr/bin/pip3 /usr/bin/pip
RUN ./build.sh -p webgl release
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment