blob: fcf9f6d61cd8c301c8336c6b4be185e6ee7275a4 [file] [log] [blame]
Joe Gregorioca8b0bd2018-05-28 09:19:44 -04001# Dockerfile for building Skia in release mode, using 3rd party libs from DEPS, with SwiftShader.
2FROM launcher.gcr.io/google/clang-debian9 AS build
3RUN apt-get update && apt-get upgrade -y && apt-get install -y \
4 git \
5 python \
6 curl \
7 build-essential \
8 libfontconfig-dev \
9 libgl1-mesa-dev \
10 libglu1-mesa-dev \
11 && groupadd -g 2000 skia \
12 && useradd -u 2000 -g 2000 skia
13
14USER skia
15
16ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libGLESv2.so /usr/local/lib/libGLESv2.so
17ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libEGL.so /usr/local/lib/libEGL.so
18RUN cd /tmp \
19 && git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' \
20 && export PATH="/tmp/depot_tools:${PATH}" \
21 && git clone https://swiftshader.googlesource.com/SwiftShader swiftshader \
22 && mkdir -p /tmp/skia \
23 && cd /tmp/skia \
24 && fetch skia
25
26RUN mkdir -p /tmp/skia/skia/out/Static
27RUN echo ' \n\
28cc = "clang" \n\
29cxx = "clang++" \n\
30skia_use_egl = true \n\
31is_debug = false \n\
32skia_use_system_freetype2 = false \n\
33extra_cflags = [ \n\
34 "-I/tmp/swiftshader/include", \n\
35 "-DGR_EGL_TRY_GLES3_THEN_GLES2", \n\
36 "-g0", \n\
37] \n\
38extra_ldflags = [ \n\
39 "-L/usr/local/lib", \n\
40 "-Wl,-rpath", \n\
41 "-Wl,/usr/local/lib" \n\
42] ' > /tmp/skia/skia/out/Static/args.gn
43
44RUN cd /tmp/skia/skia \
45 && export PATH="/tmp/depot_tools:${PATH}" \
46 && python tools/git-sync-deps \
47 && ./bin/fetch-gn \
48 && gn gen out/Static \
49 && ninja -C out/Static \
50 && cd out/Static \