Skip to content

Commit

Permalink
Update Skia Bindings
Browse files Browse the repository at this point in the history
This allows reverting 18db321 and

Fixes #6615
  • Loading branch information
tronical committed Feb 23, 2025
1 parent f355536 commit ec88305
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 36 deletions.
23 changes: 23 additions & 0 deletions .github/actions/install-skia-dependencies/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright © SixtyFPS GmbH <info@slint.dev>
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

---
name: Install Skia dependencies
description: Set up dependencies needed to build Skia

runs:
using: composite
steps:
- name: Install Ninja
if: runner.os == 'macOS'
run: brew install ninja
shell: bash
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
shell: bash
# See https://github.com/ilammy/msvc-dev-cmd?tab=readme-ov-file#caveats
- name: Remove GNU link.exe from GH actions
if: runner.os == 'Windows'
run: rm /usr/bin/link
shell: bash
4 changes: 2 additions & 2 deletions .github/actions/setup-rust/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ runs:
run: |
git config --system core.longpaths true
shell: powershell
- name: Move cargo home to the same drive as the build, so that relative paths from build to cargo source are without drive letter
- name: Move cargo home close to the target/$profile directory, so that relative paths from build to cargo source are without drive letter
if: runner.os == 'Windows'
run: |
echo "CARGO_HOME=\cargo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CARGO_HOME=${{ runner.workspace }}\cargo" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
shell: powershell
- name: Install Rust ${{ inputs.toolchain }}
uses: dtolnay/rust-toolchain@stable
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
- uses: ./.github/actions/install-skia-dependencies
- uses: ilammy/msvc-dev-cmd@v1
- uses: actions/setup-python@v5
with:
python-version: '3.10'
Expand All @@ -69,9 +71,6 @@ jobs:
- name: Install gstreamer and libunwind (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install libunwind-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
- name: Setup headless display
uses: pyvista/setup-headless-display-action@v3
- uses: ./.github/actions/setup-rust
Expand Down Expand Up @@ -116,9 +115,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
- uses: ./.github/actions/install-skia-dependencies
- name: Setup headless display
uses: pyvista/setup-headless-display-action@v3
- uses: actions/setup-node@v4
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/cpp_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,6 @@ jobs:
- name: Prepare licenses
run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild
working-directory: api/cpp/
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: ilammy/msvc-dev-cmd@v1
- name: Select MSVC (windows)
run: |
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/nightly_snapshot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,6 @@ jobs:
target: x86_64-apple-darwin
- name: Install cargo-bundle
run: cargo install --version=0.6.0 cargo-bundle
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build Main LSP Bundle
working-directory: tools/lsp
run: cargo bundle --release --features ${{ env.SLINT_BINARY_FEATURES }}
Expand All @@ -151,10 +147,6 @@ jobs:
- uses: ./.github/actions/setup-rust
with:
target: aarch64-apple-darwin
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build AArch64 LSP
run: cargo build --target aarch64-apple-darwin --features ${{ env.SLINT_BINARY_FEATURES }} --release -p slint-lsp
- name: Create artifact directory
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/publish_npm_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,26 +69,26 @@ jobs:
- os: windows-2022
rust-target: x86_64-pc-windows-msvc
napi-rs-target: win32-x64-msvc
msvc-arch: x64
- os: windows-2022
rust-target: i686-pc-windows-msvc
napi-rs-target: win32-ia32-msvc
msvc-arch: x86
needs: determine_version
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/install-linux-dependencies
with:
old-ubuntu: true
- uses: ./.github/actions/install-skia-dependencies
- uses: ilammy/msvc-dev-cmd@v1
if: runner.os == 'Windows'
with:
arch: ${{ matrix.msvc-arch }}
- uses: ./.github/actions/setup-rust
with:
target: ${{ matrix.rust-target }}
- name: Upgrade LLVM for Skia build on Windows
if: runner.os == 'Windows'
run: choco upgrade llvm
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/slint_tool_binary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,6 @@ jobs:
- uses: ./.github/actions/setup-rust
with:
target: aarch64-apple-darwin
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.torizon-demos
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ENV CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc

# Install Slint build dependencies (libxcb, etc.)
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --allow-change-held-packages pkg-config libfontconfig1-dev:$TOOLCHAIN_ARCH libxcb1-dev:$TOOLCHAIN_ARCH libxcb-render0-dev:$TOOLCHAIN_ARCH libxcb-shape0-dev:$TOOLCHAIN_ARCH libxcb-xfixes0-dev:$TOOLCHAIN_ARCH libxkbcommon-dev:$TOOLCHAIN_ARCH libinput-dev:$TOOLCHAIN_ARCH libudev-dev:$TOOLCHAIN_ARCH libgbm-dev:$TOOLCHAIN_ARCH libdrm2:$TOOLCHAIN_ARCH libdrm2- libdrm-amdgpu1- python3 clang libstdc++-11-dev:$TOOLCHAIN_ARCH && \
DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --allow-change-held-packages pkg-config libfontconfig1-dev:$TOOLCHAIN_ARCH libxcb1-dev:$TOOLCHAIN_ARCH libxcb-render0-dev:$TOOLCHAIN_ARCH libxcb-shape0-dev:$TOOLCHAIN_ARCH libxcb-xfixes0-dev:$TOOLCHAIN_ARCH libxkbcommon-dev:$TOOLCHAIN_ARCH libinput-dev:$TOOLCHAIN_ARCH libudev-dev:$TOOLCHAIN_ARCH libgbm-dev:$TOOLCHAIN_ARCH libdrm2:$TOOLCHAIN_ARCH libdrm2- libdrm-amdgpu1- python3 clang libstdc++-11-dev:$TOOLCHAIN_ARCH ninja-build && \
rm -rf /var/lib/apt/lists/*

# Don't require font-config when the compiler runs
Expand Down
8 changes: 4 additions & 4 deletions internal/renderers/skia/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pin-weak = "1"
scoped-tls-hkt = "0.1"
raw-window-handle = { version = "0.6", features = ["std"] }

skia-safe = { version = "0.78.0", features = ["textlayout", "gl"] }
skia-safe = { version = "0.82.0", features = ["textlayout", "gl"] }
glow = { workspace = true }
unicode-segmentation = { workspace = true }

Expand All @@ -58,7 +58,7 @@ bytemuck = { workspace = true }

[target.'cfg(target_family = "windows")'.dependencies]
windows = { version = "0.58.0", features = ["Win32", "Win32_System_Com", "Win32_Graphics", "Win32_Graphics_Dxgi", "Win32_Graphics_Direct3D12", "Win32_Graphics_Direct3D", "Win32_Foundation", "Win32_Graphics_Dxgi_Common", "Win32_System_Threading", "Win32_Security"] }
skia-safe = { version = "0.78.0", features = ["d3d"] }
skia-safe = { version = "0.82.0", features = ["d3d"] }

[target.'cfg(target_vendor = "apple")'.dependencies]
objc2 = { version = "0.6.0" }
Expand Down Expand Up @@ -89,11 +89,11 @@ objc2-app-kit = { version = "0.3.0", default-features = false, features = [
objc2-core-foundation = { version = "0.3.0", default-features = false, features = [
"CFCGTypes"
] }
skia-safe = { version = "0.78.0", features = ["metal"] }
skia-safe = { version = "0.82.0", features = ["metal"] }
raw-window-metal = "1.0"

[target.'cfg(not(any(target_vendor = "apple", target_family = "windows")))'.dependencies]
skia-safe = { version = "0.78.0", features = ["gl"] }
skia-safe = { version = "0.82.0", features = ["gl"] }

[build-dependencies]
cfg_aliases = { workspace = true }

0 comments on commit ec88305

Please sign in to comment.