Skip to content

Instantly share code, notes, and snippets.

@naveen521kk
Last active May 16, 2022 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naveen521kk/8cce2ba129312cf38f4451d6d10d61ad to your computer and use it in GitHub Desktop.
Save naveen521kk/8cce2ba129312cf38f4451d6d10d61ad to your computer and use it in GitHub Desktop.

Skia-pathops on Raspberry Pi

Manim needs it and it isn't buildable directly, so here is a theoritical steps on to get them working.

I'll follow the version of skia which is fairly recent and tested on other platforms so that it works.

First there are necessary stuff that I assume is already installed.

  • Python 3.7+
  • Ninja (can be installed with pip, pip install ninja)
  • Git
  • GCC or any other C/CPP compilers

Building GN

This is the buildsystem that skia uses, so building first is necessary. We'll the version from d62642c920e6a0d1756316d225a90fd6faa9e21e.

  1. Clone GN repository and checkout to d62642c920e6a0d1756316d225a90fd6faa9e21e
git clone https://gn.googlesource.com/gn.git --depth=1
cd gn
git checkout d62642c920e6a0d1756316d225a90fd6faa9e21e
  1. Run this script present in their source files
python build/gen.py --out-path=out/
  1. Run ninja in out directory
ninja -C out/
  1. Add $pwd/out to PATH variable, so that gn command is available in terminal. Or copy it to a different location, you'll need it in the future.

Most likely this should go without any errors.

Building Skia

  1. Get the builder
git clone --recurse-submodules https://github.com/fonttools/skia-builder.git
cd skia-builder
  1. Run the main script passing the path where you built gn previously (replace <gn_path> with it).
python build_skia.py --no-fetch-gn --gn-path="<gn_path>" --archive-file "libskia-rpi.zip"

The zip can then be used to built the bindings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment