Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions .github/workflows/build-skia-pathops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# SPDX-FileCopyrightText: 2026 The RISE Project
# SPDX-License-Identifier: MIT
---
# This workflow is based on the `build_aarch64_wheels` job of:
# https://github.com/fonttools/skia-pathops/blob/v0.9.2/.github/workflows/ci.yml
# and the `build-linux` job of the skia-builder submodule it pins (which produces the
# prebuilt libskia that job downloads):
# https://github.com/fonttools/skia-builder/blob/501d7a3e80dd57900d0ab42ddb0f6c08f3665d26/.github/workflows/ci.yml
name: Build skia-pathops wheels (riscv64)

on:
workflow_dispatch:
inputs:
version:
description: 'Version glob to (re)build; empty builds every version of docs/packages/skia-pathops.yaml not released yet'
required: false
default: ''
pull_request:
branches: [main]
paths:
- '.github/workflows/build-skia-pathops.yml'
- 'docs/packages/skia-pathops.yaml'
- 'patches/skia-pathops/**'
push:
branches: [main]
paths:
- '.github/workflows/build-skia-pathops.yml'
- 'docs/packages/skia-pathops.yaml'
- 'patches/skia-pathops/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read # to fetch code (actions/checkout)

env:
GN_REVISION: b2afae122eeb6ce09c52d63f67dc53fc517dbdc8
MANYLINUX_RISCV64_IMAGE: quay.io/pypa/manylinux_2_39_riscv64

jobs:
setup:
uses: $/.github/workflows/_setup.yml
with:
package: skia-pathops
version: ${{ inputs.version }}

build_wheels:
needs: [setup]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
name: Build skia-pathops ${{ matrix.version }} cp310-abi3-manylinux_riscv64
runs-on: ubuntu-24.04-riscv
timeout-minutes: 360

env:
SKIA_PATHOPS_VERSION: ${{ matrix.version }}

steps:
- name: Checkout skia-pathops v${{ env.SKIA_PATHOPS_VERSION }}
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
repository: fonttools/skia-pathops
ref: v${{ env.SKIA_PATHOPS_VERSION }}
submodules: recursive
persist-credentials: false

- name: Checkout python-wheels
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
path: python-wheels
persist-credentials: false

- name: Patch skia-pathops source
run: git apply python-wheels/patches/skia-pathops/${{ env.SKIA_PATHOPS_VERSION }}/*.patch

- name: Build and Test Wheels
uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0
with:
output-dir: wheelhouse/
env:
CIBW_ARCHS: riscv64
CIBW_BUILD: cp310-manylinux_riscv64 cp311-manylinux_riscv64 cp312-manylinux_riscv64 cp313-manylinux_riscv64 cp314-manylinux_riscv64
CIBW_MANYLINUX_RISCV64_IMAGE: ${{ env.MANYLINUX_RISCV64_IMAGE }}
CIBW_ENVIRONMENT: >-
BUILD_SKIA_FROM_SOURCE=0 SKIA_LIBRARY_DIR=build/download
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_SKIA_PATHOPS=${{ env.SKIA_PATHOPS_VERSION }}
# skia-builder publishes no riscv64 libskia and Skia's bin/fetch-gn has no
# riscv64 CIPD gn, so build gn from source at fetch-gn's pinned revision
# and run skia-builder's build_skia.py in-container to fill build/download.
CIBW_BEFORE_ALL_LINUX: |
set -e
dnf -y install libstdc++-static
python3 -m pip install ninja
git clone https://gn.googlesource.com/gn /tmp/gn
git -C /tmp/gn checkout ${{ env.GN_REVISION }}
(cd /tmp/gn && CXX=g++ python3 build/gen.py --allow-warnings && ninja -C out gn)
install -m 0755 /tmp/gn/out/gn src/cpp/skia-builder/skia/bin/gn
python3 src/cpp/skia-builder/build_skia.py --no-sync-deps --no-fetch-gn build/download
CIBW_TEST_EXTRAS: testing
CIBW_TEST_COMMAND: pytest {project}/tests
CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel}

- name: Check the wheel ships both licences
run: |
python3 - wheelhouse/*.whl <<'EOF'
import sys, zipfile
for whl in sys.argv[1:]:
names = zipfile.ZipFile(whl).namelist()
licences = {n.split(".dist-info/licenses/", 1)[1]
for n in names if ".dist-info/licenses/" in n} - {""}
assert licences == {"LICENSE", "src/cpp/skia-builder/skia/LICENSE"}, (whl, licences)
print(whl, "ok")
EOF

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: skia-pathops-${{ env.SKIA_PATHOPS_VERSION }}-cp310-abi3-manylinux_riscv64
path: wheelhouse/*.whl
if-no-files-found: error

publish:
name: Publish skia-pathops ${{ matrix.version }}
needs: [setup, build_wheels]
if: needs.setup.outputs.versions != '[]'
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup.outputs.versions) }}
permissions:
contents: write
pull-requests: write
uses: $/.github/workflows/_publish-wheel.yml
secrets:
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
with:
artifact-pattern: skia-pathops-${{ matrix.version }}-cp310-abi3-manylinux_riscv64
6 changes: 6 additions & 0 deletions docs/packages/skia-pathops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package-name: skia-pathops
source-code: https://github.com/fonttools/skia-pathops
license: BSD-3-Clause
versions:
- version: 0.9.2
patched: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From bb26588477f71396768d1ae674d63fb180c709d3 Mon Sep 17 00:00:00 2001
From: Ludovic Henry <git@ludovic.dev>
Date: Sat, 26 Sep 2026 11:44:51 +0000
Subject: [PATCH] package the licence of the statically linked Skia

Upstream-Status: To upstream [not yet submitted; every skia-pathops wheel on PyPI has the same gap, so it needs a maintainer discussion rather than a drive-by PR]

pathops._pathops links libskia.a (built from the skia-builder submodule)
statically, so every wheel carries Skia's BSD-3-Clause code, whose
licence requires the copyright notice to travel with binary
redistributions. setup.cfg's `license_file = LICENSE` replaces
setuptools' default licence glob, so the wheel ships skia-pathops' own
LICENSE alone.

Name both files in license_files; setuptools keeps the path, so Skia's
lands as dist-info/licenses/src/cpp/skia-builder/skia/LICENSE.

Signed-off-by: Ludovic Henry <git@ludovic.dev>
---
setup.cfg | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/setup.cfg b/setup.cfg
index a2d8121..d0657b3 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -2,4 +2,6 @@
formats = zip

[metadata]
-license_file = LICENSE
+license_files =
+ LICENSE
+ src/cpp/skia-builder/skia/LICENSE
--
2.43.0

Loading