Joe Gregorio | ca8b0bd | 2018-05-28 09:19:44 -0400 | [diff] [blame^] | 1 | # Dockerfile for building Skia in release mode, using 3rd party libs from DEPS, with SwiftShader. |
| 2 | FROM launcher.gcr.io/google/clang-debian9 AS build |
| 3 | RUN 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 | |
| 14 | USER skia |
| 15 | |
| 16 | ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libGLESv2.so /usr/local/lib/libGLESv2.so |
| 17 | ADD --chown=skia:skia https://storage.googleapis.com/swiftshader-binaries/OpenGL_ES/Latest/Linux/libEGL.so /usr/local/lib/libEGL.so |
| 18 | RUN 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 | |
| 26 | RUN mkdir -p /tmp/skia/skia/out/Static |
| 27 | RUN echo ' \n\ |
| 28 | cc = "clang" \n\ |
| 29 | cxx = "clang++" \n\ |
| 30 | skia_use_egl = true \n\ |
| 31 | is_debug = false \n\ |
| 32 | skia_use_system_freetype2 = false \n\ |
| 33 | extra_cflags = [ \n\ |
| 34 | "-I/tmp/swiftshader/include", \n\ |
| 35 | "-DGR_EGL_TRY_GLES3_THEN_GLES2", \n\ |
| 36 | "-g0", \n\ |
| 37 | ] \n\ |
| 38 | extra_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 | |
| 44 | RUN 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 \ |