-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (20 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Artistic Style (AStyle) + Emscripten build environment
# Copyright (C) 2020, 2021, Uri Shaked. Published under the MIT license.
FROM ubuntu:20.04
RUN apt-get update
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y wget python git cmake xz-utils lsb-release sudo
## Install EMScripten SDK
WORKDIR /opt
RUN git clone https://github.com/emscripten-core/emsdk.git
WORKDIR /opt/emsdk
RUN ./emsdk install 1.40.1
RUN ./emsdk activate 1.40.1
RUN echo "source $(pwd)/emsdk_env.sh" >> ~/.bashrc
# Build AStyle
RUN apt-get install -y subversion
RUN mkdir -p /build/astyle
WORKDIR /build/astyle
RUN svn checkout https://svn.code.sf.net/p/astyle/code/trunk/AStyle astyle-code
WORKDIR /build/astyle/astyle-code/build/gcc
RUN bash -c 'source /opt/emsdk/emsdk_env.sh && emmake make static'
RUN bash -c 'source /opt/emsdk/emsdk_env.sh && emcc -o bin/libastyle.js -s EXPORTED_FUNCTIONS=["_AStyleGetVersion","_AStyleMain","_AStyleMainUtf16"] -s EXTRA_EXPORTED_RUNTIME_METHODS=["ccall","cwrap","addFunction","UTF8ToString"] -s RESERVED_FUNCTION_POINTERS=20 bin/libastyle.a'