blob: dd09d808c5659144cba6e65c23c56550104c913c [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' \
Joe Gregorioca8b0bd2018-05-28 09:19:44 -040020 && git clone https://swiftshader.googlesource.com/SwiftShader swiftshader \
21 && mkdir -p /tmp/skia \
22 && cd /tmp/skia \
Joe Gregorio8e9810c2018-05-29 13:56:27 -040023 && /tmp/depot_tools/fetch skia \
24 && cd skia
Joe Gregorioca8b0bd2018-05-28 09:19:44 -040025
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\
Mike Kleind5555c82019-06-24 12:33:07 -040042] ' > /tmp/skia/skia/out/Static/args.gn
Joe Gregorioca8b0bd2018-05-28 09:19:44 -040043
44RUN cd /tmp/skia/skia \
Joe Gregorioca8b0bd2018-05-28 09:19:44 -040045 && python tools/git-sync-deps \
46 && ./bin/fetch-gn \
Joe Gregorio8e9810c2018-05-29 13:56:27 -040047 && ./bin/gn gen out/Static \
Joe Gregoriofba19c32018-06-20 09:53:05 -040048 && git rev-parse HEAD > VERSION \
Joe Gregorio8e9810c2018-05-29 13:56:27 -040049 && /tmp/depot_tools/ninja -C out/Static
50
51# Uncomment the lines below and update the ref to patch in a CL.
52#
53#RUN cd /tmp/skia/skia \
54# && git fetch https://skia.googlesource.com/skia refs/changes/25/130325/15 \
55# && git checkout FETCH_HEAD \
56# && /tmp/depot_tools/ninja -C out/Static