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' \ |
Joe Gregorio | ca8b0bd | 2018-05-28 09:19:44 -0400 | [diff] [blame] | 20 | && git clone https://swiftshader.googlesource.com/SwiftShader swiftshader \ |
| 21 | && mkdir -p /tmp/skia \ |
| 22 | && cd /tmp/skia \ |
Joe Gregorio | 8e9810c | 2018-05-29 13:56:27 -0400 | [diff] [blame] | 23 | && /tmp/depot_tools/fetch skia \ |
| 24 | && cd skia |
Joe Gregorio | ca8b0bd | 2018-05-28 09:19:44 -0400 | [diff] [blame] | 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\ |
Mike Klein | d5555c8 | 2019-06-24 12:33:07 -0400 | [diff] [blame] | 42 | ] ' > /tmp/skia/skia/out/Static/args.gn |
Joe Gregorio | ca8b0bd | 2018-05-28 09:19:44 -0400 | [diff] [blame] | 43 | |
| 44 | RUN cd /tmp/skia/skia \ |
Joe Gregorio | ca8b0bd | 2018-05-28 09:19:44 -0400 | [diff] [blame] | 45 | && python tools/git-sync-deps \ |
| 46 | && ./bin/fetch-gn \ |
Joe Gregorio | 8e9810c | 2018-05-29 13:56:27 -0400 | [diff] [blame] | 47 | && ./bin/gn gen out/Static \ |
Joe Gregorio | fba19c3 | 2018-06-20 09:53:05 -0400 | [diff] [blame] | 48 | && git rev-parse HEAD > VERSION \ |
Joe Gregorio | 8e9810c | 2018-05-29 13:56:27 -0400 | [diff] [blame] | 49 | && /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 |