Skip to content

Instantly share code, notes, and snippets.

Last active May 16, 2022 14:53
What would you like to do?

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 --depth=1
cd gn
git checkout d62642c920e6a0d1756316d225a90fd6faa9e21e
  1. Run this script present in their source files
python build/ --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
cd skia-builder
  1. Run the main script passing the path where you built gn previously (replace <gn_path> with it).
python --no-fetch-gn --gn-path="<gn_path>" --archive-file ""

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