github.com/pekim/go-skia is a package that provides generated Go bindings
for some of skia's C++ api.
To add it to a Go module, go get github.com/pekim/go-skia.
go-skia is licensed under the terms of the MIT license.
go-skia has been developed on linux amd64. Libraries for darwin amd64 and arm64 are included and it may work on macOS, but it's untested.
- version 1.23.0 or later of
Go - version 15 or later of
clang
The build script does the following
rust-skiarepo- clone repo (if not present) to
_skiadir - check out desired tag (if not currently checked out)
- copy required header files to
skiadir
- clone repo (if not present) to
skia-binariesrepo- if desired release not present in
libdir- download releases for platforms
- extract the platform releases in to
libdir
- if desired release not present in
- generate Go bindings
- run tests to verify that the generated bindings result in a package that builds
./build.shTo upgrade skia, update some variables in build.sh.
- https://github.com/rust-skia/skia/tags
SKIA_TAG- set to a tag, such asm136-0.84.2
- https://github.com/rust-skia/skia-binaries/releases
- Expand the assets for the latest available minor release that
SKIA_TAGreferences. For example ifSKIA_TAGism136-0.84.2, the release to use will be0.84.0. Do not try to mix minor releases, as it's unlikely to work. SKIA_BINARIES_COMMITHASH- set to the hash used in all of the release's downloadable assetsSKIA_BINARIES_TAG- the release's tag, such as0.84.0
- Expand the assets for the latest available minor release that
The leading underscore in the dir name is to prevent the directory appearing in godoc output in the "Subdirectories" section.
There are configuration files for linting and other checks. To use a git pre-commit hook for the checks
- install
goimportsif not already installed - install
golangci-lintif not already installed - install the
pre-commitapplication if not already installed - install a git pre-commit hook in this repo's workspace
pre-commit install