Author SHA1 Message Date
greepar cc78c8775d Make win-x86 Skia patch idempotent 2026-07-23 16:21:12 +08:00
greepar c453e1686f Fix cached native build reuse 2026-07-23 05:11:45 +08:00
greepar b8ccd4acc0 Fix SkiaSharp 4 win-x86 static linking 2026-07-23 04:48:02 +08:00
greepar afff9f9833 Upgrade static graphics to SkiaSharp 4.150.1 2026-07-22 03:46:36 +08:00
11 changed files with 34 additions and 14 deletions

No files matched your search

@@ -6,7 +6,7 @@ on:
source_version:
description: Existing package version containing the static libraries
required: true
default: 3.119.4-7922.1
default: 4.150.1-7922.1
type: string
publish_to_nuget:
description: Publish package to nuget.org
+1 -1
View File
@@ -13,7 +13,7 @@ on:
inputs:
skiasharp_version:
required: true
default: "3.119.4"
default: "4.150.1"
type: string
angle_branch:
required: true
+1 -1
View File
@@ -13,7 +13,7 @@ on:
inputs:
skiasharp_version:
required: true
default: "3.119.4"
default: "4.150.1"
type: string
angle_branch:
required: true
+2 -1
View File
@@ -16,7 +16,7 @@ on:
inputs:
skiasharp_version:
required: true
default: "3.119.4"
default: "4.150.1"
type: string
angle_branch:
required: true
@@ -70,6 +70,7 @@ jobs:
sh -lc '
set -e
apk add --no-cache bash ca-certificates git python3 py3-httplib2 py3-pysocks py3-six clang compiler-rt lld llvm g++ ninja pkgconf fontconfig-dev glib-dev mesa-dev libx11-dev libxcb-dev libxext-dev pciutils-dev linux-headers perl curl tar xz patch gcompat libc6-compat
git config --global --add safe.directory "*"
python3 - <<'"'"'PY'"'"'
import pathlib
import httplib2
@@ -13,7 +13,7 @@ on:
inputs:
skiasharp_version:
required: true
default: "3.119.4"
default: "4.150.1"
type: string
angle_branch:
required: true
+1 -1
View File
@@ -11,7 +11,7 @@ dotnet add package StaticLink.Avalonia
Or add it manually:
```xml
<PackageReference Include="StaticLink.Avalonia" Version="3.119.4-7922.1" />
<PackageReference Include="StaticLink.Avalonia" Version="4.150.1-7922.1" />
```
For macOS, also reference `StaticLink.Avalonia.Native`. This package is macOS-only and must match your Avalonia version because it contains `libAvaloniaNative.a`.
@@ -6,7 +6,7 @@
<IncludeBuildOutput>false</IncludeBuildOutput>
<SuppressDependenciesWhenPacking>false</SuppressDependenciesWhenPacking>
<PackageId>StaticLink.Avalonia</PackageId>
<Version>3.119.4-7922.1</Version>
<Version>4.150.1-7922.1</Version>
<Authors>greepar</Authors>
<Company>greepar</Company>
<Description>Static SkiaSharp, HarfBuzzSharp, and ANGLE libraries for Avalonia NativeAOT single-file publishing.</Description>
@@ -19,7 +19,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="3.119.4" />
<PackageReference Include="SkiaSharp" Version="4.150.1" />
</ItemGroup>
<ItemGroup>
+2 -2
View File
@@ -11,10 +11,10 @@ dotnet add package StaticLink.Avalonia
Or add it manually:
```xml
<PackageReference Include="StaticLink.Avalonia" Version="3.119.4-7922.1" />
<PackageReference Include="StaticLink.Avalonia" Version="4.150.1-7922.1" />
```
`3.119.4-7922.1` supports Avalonia 11. If you need the SkiaSharp 2 line for an Avalonia 11 project, use this optional package variant:
`4.150.1-7922.1` uses the latest stable SkiaSharp 4 release. If you need the SkiaSharp 2 line for an Avalonia 11 project, use this optional package variant:
```xml
<PackageReference Include="StaticLink.Avalonia" Version="2.88.9-7151.10" />
+2 -2
View File
@@ -6,7 +6,7 @@ WORK_DIR="${WORK_DIR:-$ROOT_DIR/External/NativeStatic/.work}"
TARGET_CPU="${TARGET_CPU:-x64}"
RID="${RID:-linux-$TARGET_CPU}"
OUTPUT_DIR="${OUTPUT_DIR:-$ROOT_DIR/External/NativeStatic/$RID}"
SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.4}"
SKIASHARP_VERSION="${SKIASHARP_VERSION:-4.150.1}"
ANGLE_BRANCH="${ANGLE_BRANCH:-7922}"
BUILD_JOBS="${BUILD_JOBS:-$(nproc)}"
ANGLE_PATCH_DIR="${ANGLE_PATCH_DIR:-$ROOT_DIR/External/NativeStatic/patches}"
@@ -20,7 +20,7 @@ Usage: scripts/build-linux-static-graphics.sh [skia|angle|all]
Environment:
WORK_DIR Source/build cache directory. Default: External/NativeStatic/.work
OUTPUT_DIR Final static library directory. Default: External/NativeStatic/linux-$TARGET_CPU
SKIASHARP_VERSION SkiaSharp release branch version. Default: 3.119.4
SKIASHARP_VERSION SkiaSharp release branch version. Default: 4.150.1
ANGLE_BRANCH ANGLE chromium branch. Default: 7922
TARGET_CPU GN target_cpu. Default: x64. Supported: x64, arm64
RID Output RID. Default: linux-$TARGET_CPU
+1 -1
View File
@@ -6,7 +6,7 @@ WORK_DIR="${WORK_DIR:-$ROOT_DIR/External/NativeStatic/.work}"
TARGET_CPU="${TARGET_CPU:-arm64}"
RID="${RID:-osx-$TARGET_CPU}"
OUTPUT_DIR="${OUTPUT_DIR:-$ROOT_DIR/External/NativeStatic/$RID}"
SKIASHARP_VERSION="${SKIASHARP_VERSION:-3.119.4}"
SKIASHARP_VERSION="${SKIASHARP_VERSION:-4.150.1}"
ANGLE_BRANCH="${ANGLE_BRANCH:-7922}"
BUILD_JOBS="${BUILD_JOBS:-$(sysctl -n hw.ncpu)}"
ANGLE_PATCH_DIR="${ANGLE_PATCH_DIR:-$ROOT_DIR/External/NativeStatic/patches}"
+20 -1
View File
@@ -7,7 +7,7 @@ $ErrorActionPreference = "Stop"
$RootDir = Split-Path -Parent $PSScriptRoot
$WorkDir = if ($env:WORK_DIR) { $env:WORK_DIR } else { Join-Path $RootDir "External\NativeStatic\.work" }
$SkiaSharpVersion = if ($env:SKIASHARP_VERSION) { $env:SKIASHARP_VERSION } else { "3.119.4" }
$SkiaSharpVersion = if ($env:SKIASHARP_VERSION) { $env:SKIASHARP_VERSION } else { "4.150.1" }
$AngleBranch = if ($env:ANGLE_BRANCH) { $env:ANGLE_BRANCH } else { "7922" }
$TargetCpu = if ($env:TARGET_CPU) { $env:TARGET_CPU } else { "x64" }
$Rid = if ($env:RID) { $env:RID } else { "win-$TargetCpu" }
@@ -353,6 +353,24 @@ function Sync-SkiaSharp {
return $src
}
function Patch-WinX86SkiaLinker($SkiaDir) {
if ($TargetCpu -ne "x86") {
return
}
$linkerPath = Join-Path $SkiaDir "src\c\sk_linker.cpp"
$text = Get-Content -Path $linkerPath -Raw
$pattern = '(?m)^ skjson::ObjectValue\* a = nullptr;\r?\n auto r = \(\*a\)\["tmp"\]\.getType\(\);\r?$'
$patched = [regex]::Replace($text, $pattern, ' int r = 0;')
if ($patched -eq $text) {
if ($text -match '(?m)^ int r = 0;\r?$') {
return
}
throw "Unable to patch win-x86 sk_linker JSON keep-alive references."
}
Set-Content -Path $linkerPath -Value $patched -NoNewline -Encoding UTF8
}
function Prepare-SkiaGitSyncDeps($SkiaDir) {
$syncDeps = Join-Path $SkiaDir "tools\git-sync-deps"
$text = Get-Content -Path $syncDeps -Raw
@@ -390,6 +408,7 @@ function Build-Skia {
Ensure-DepotTools
$src = Sync-SkiaSharp
$skiaDir = Join-Path $src "externals\skia"
Patch-WinX86SkiaLinker $skiaDir
if (-not (Test-Path (Join-Path $skiaDir "bin\gn.exe"))) {
Invoke-SkiaGitSyncDeps $skiaDir
}