| 1 |
FROM gcr.io/skia-public/fiddler-base@sha256:9a6c484a3353b5b2ffbfa5742fc427d83a957fa543343de7e418276fae893d7b |
| 2 |
|
| 3 |
# https://stackoverflow.com/a/44766666 |
| 4 |
# Copy the skia files that Louhi has cloned into the image. Louhi hasn't synced third party |
| 5 |
# deps, so we will need to do that before compiling (see next steps). |
| 6 |
COPY --chown=skia:skia . /tmp/skia |
| 7 |
|
| 8 |
# We need to call gclient config so gclient sync works later to get our third party deps |
| 9 |
# We want --unmanaged to make gclient not sync Skia and instead use the files we copied |
| 10 |
# into the container. |
| 11 |
RUN cd /tmp && gclient config --unmanaged --name=skia https://skia.googlesource.com/skia.git |
| 12 |
|
| 13 |
WORKDIR /tmp/skia/ |
| 14 |
|
| 15 |
# Fetch things we need but delete large third-party folders that we don't need for fiddler |
| 16 |
RUN ./bin/fetch-gn \ |
| 17 |
&& ./bin/fetch-ninja \ |
| 18 |
&& gclient sync \ |
| 19 |
&& rm -rf third_party/externals/dawn \ |
| 20 |
third_party/externals/emsdk \ |
| 21 |
third_party/externals/icu4x \ |
| 22 |
third_party/externals/opengl-registry \ |
| 23 |
third_party/externals/perfetto \ |
| 24 |
third_party/externals/swiftshader \ |
| 25 |
third_party/externals/unicodetools |
| 26 |
|
| 27 |
RUN mkdir -p ./out/Static |
| 28 |
RUN echo ' \n\ |
| 29 |
cc = "clang" \n\ |
| 30 |
cxx = "clang++" \n\ |
| 31 |
skia_use_egl = true \n\ |
| 32 |
is_debug = false \n\ |
| 33 |
skia_enable_fontmgr_fontconfig = true \n\ |
| 34 |
skia_use_perfetto = false \n\ |
| 35 |
skia_use_libgrapheme = false \n\ |
| 36 |
skia_use_icu4x = false \n\ |
| 37 |
skia_use_system_freetype2 = false \n\ |
| 38 |
link_pool_depth=2 \n\ |
| 39 |
extra_cflags = [ \n\ |
| 40 |
"-I/tmp/swiftshader/include", \n\ |
| 41 |
"-DGR_EGL_TRY_GLES3_THEN_GLES2", \n\ |
| 42 |
"-g0", \n\ |
| 43 |
] \n\ |
| 44 |
extra_ldflags = [ \n\ |
| 45 |
"-L/usr/local/lib", \n\ |
| 46 |
"-Wl,-rpath", \n\ |
| 47 |
"-Wl,/usr/local/lib" \n\ |
| 48 |
] ' > ./out/Static/args.gn |
| 49 |
|
| 50 |
# Build Skia once so that incremental builds are much faster |
| 51 |
RUN ./bin/gn gen out/Static |
| 52 |
RUN git rev-parse HEAD > VERSION |
| 53 |
RUN ./third_party/ninja/ninja -C out/Static fiddle |
| 54 |
|
| 55 |
# Cleanup .git directories because they are not needed and take up space. |
| 56 |
# (can't do this sooner because we need to create VERSION) |
| 57 |
RUN find . -name .git -print0 | xargs -0 rm -rf |