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-skia
repo- clone repo (if not present) to
_skia
dir - check out desired tag (if not currently checked out)
- copy required header files to
skia
dir
- clone repo (if not present) to
skia-binaries
repo- if desired release not present in
lib
dir- download releases for platforms
- extract the platform releases in to
lib
dir
- if desired release not present in
- generate Go bindings
- run tests to verify that the generated bindings result in a package that builds
./build.sh
To 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_TAG
references. For example ifSKIA_TAG
ism136-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
goimports
if not already installed - install
golangci-lint
if not already installed - install the
pre-commit
application if not already installed - install a git pre-commit hook in this repo's workspace
pre-commit install