Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(TFMPrevious)-tizen$(TPVTizenPrevious);$(TFMCurrent)-tizen$(TPVTizenCurrent)</TargetFrameworks>
<TargetFrameworks>$(TFMPrevious)-tizen$(TPVTizenPrevious);$(TFMCurrent)-tizen$(TPVTizenCurrent);$(TFMMinimum)-tizen$(TPVTizenMinimum)</TargetFrameworks>
<PackagingGroup>HarfBuzzSharp</PackagingGroup>
<Title>$(PackagingGroup) - Native Assets for Tizen</Title>
</PropertyGroup>
<ItemGroup>
<PackageFile Include="..\..\output\native\tizen\armel\libHarfBuzzSharp.*" PackagePath="runtimes\tizen-armel\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\tizen\i586\libHarfBuzzSharp.*" PackagePath="runtimes\tizen-x86\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\tizen\i586\libHarfBuzzSharp.*" PackagePath="runtimes\linux-x86\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\tizen\x86_64\libHarfBuzzSharp.*" PackagePath="runtimes\tizen-x64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\tizen\aarch64\libHarfBuzzSharp.*" PackagePath="runtimes\tizen-arm64\native\%(Filename)%(Extension)" />
</ItemGroup>
<Target Name="IncludeAdditionalTfmSpecificPackageFiles">
<ItemGroup>
Expand Down
12 changes: 11 additions & 1 deletion binding/IncludeNativeAssets.HarfBuzzSharp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,24 @@
<ItemGroup Condition="$(TargetFramework.Contains('-tizen'))">
<TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\i586\libHarfBuzzSharp.so">
<Visible>false</Visible>
<TizenTpkSubDir>bin\runtimes\linux-x86\native\</TizenTpkSubDir>
<TizenTpkSubDir>bin\runtimes\tizen-x86\native\</TizenTpkSubDir>
<TizenTpkFileName>libHarfBuzzSharp.so</TizenTpkFileName>
</TizenTpkFiles>
<TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\armel\libHarfBuzzSharp.so">
<Visible>false</Visible>
<TizenTpkSubDir>bin\runtimes\tizen-armel\native\</TizenTpkSubDir>
<TizenTpkFileName>libHarfBuzzSharp.so</TizenTpkFileName>
</TizenTpkFiles>
<TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libHarfBuzzSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libHarfBuzzSharp.so')">
<Visible>false</Visible>
<TizenTpkSubDir>bin\runtimes\tizen-x64\native\</TizenTpkSubDir>
<TizenTpkFileName>libHarfBuzzSharp.so</TizenTpkFileName>
</TizenTpkFiles>
<TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libHarfBuzzSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libHarfBuzzSharp.so')">
<Visible>false</Visible>
<TizenTpkSubDir>bin\runtimes\tizen-arm64\native\</TizenTpkSubDir>
<TizenTpkFileName>libHarfBuzzSharp.so</TizenTpkFileName>
</TizenTpkFiles>

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new tizen-x64/tizen-arm64 entries are gated on Exists(...), so a Tizen app build can succeed while silently omitting the required native library for those architectures (leading to runtime load failures). Prefer conditioning these items on the active $(RuntimeIdentifier) (e.g., include x86_64 only for tizen-x64, aarch64 only for tizen-arm64) and/or failing the build if the expected file is missing, rather than skipping the item entirely.

Copilot uses AI. Check for mistakes.
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-tvos')) and '$(RuntimeIdentifier)' != ''">
Expand Down
12 changes: 11 additions & 1 deletion binding/IncludeNativeAssets.SkiaSharp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,24 @@
<ItemGroup Condition="$(TargetFramework.Contains('-tizen'))">
<TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\i586\libSkiaSharp.so">
<Visible>false</Visible>
<TizenTpkSubDir>bin\runtimes\linux-x86\native\</TizenTpkSubDir>
<TizenTpkSubDir>bin\runtimes\tizen-x86\native\</TizenTpkSubDir>
<TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName>
</TizenTpkFiles>
<TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\armel\libSkiaSharp.so">
<Visible>false</Visible>
<TizenTpkSubDir>bin\runtimes\tizen-armel\native\</TizenTpkSubDir>
<TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName>
</TizenTpkFiles>
<TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libSkiaSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\x86_64\libSkiaSharp.so')">
<Visible>false</Visible>
<TizenTpkSubDir>bin\runtimes\tizen-x64\native\</TizenTpkSubDir>
<TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName>
</TizenTpkFiles>
<TizenTpkFiles Include="$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libSkiaSharp.so" Condition="Exists('$(MSBuildThisFileDirectory)..\output\native\tizen\aarch64\libSkiaSharp.so')">
<Visible>false</Visible>
<TizenTpkSubDir>bin\runtimes\tizen-arm64\native\</TizenTpkSubDir>
<TizenTpkFileName>libSkiaSharp.so</TizenTpkFileName>
</TizenTpkFiles>

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new tizen-x64/tizen-arm64 entries are gated on Exists(...), so a Tizen app build can succeed while silently omitting the required native library for those architectures (leading to runtime load failures). Prefer conditioning these items on the active $(RuntimeIdentifier) (e.g., include x86_64 only for tizen-x64, aarch64 only for tizen-arm64) and/or failing the build if the expected file is missing, rather than skipping the item entirely.

Copilot uses AI. Check for mistakes.
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-tvos')) and '$(RuntimeIdentifier)' != ''">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(TFMPrevious)-tizen$(TPVTizenPrevious);$(TFMCurrent)-tizen$(TPVTizenCurrent)</TargetFrameworks>
<TargetFrameworks>$(TFMPrevious)-tizen$(TPVTizenPrevious);$(TFMCurrent)-tizen$(TPVTizenCurrent);$(TFMMinimum)-tizen$(TPVTizenMinimum)</TargetFrameworks>
<PackagingGroup>SkiaSharp</PackagingGroup>
<Title>$(PackagingGroup) - Native Assets for Tizen</Title>
</PropertyGroup>
<ItemGroup>
<PackageFile Include="..\..\output\native\tizen\armel\libSkiaSharp.*" PackagePath="runtimes\tizen-armel\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\tizen\i586\libSkiaSharp.*" PackagePath="runtimes\tizen-x86\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\tizen\i586\libSkiaSharp.*" PackagePath="runtimes\linux-x86\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\tizen\x86_64\libSkiaSharp.*" PackagePath="runtimes\tizen-x64\native\%(Filename)%(Extension)" />
<PackageFile Include="..\..\output\native\tizen\aarch64\libSkiaSharp.*" PackagePath="runtimes\tizen-arm64\native\%(Filename)%(Extension)" />
</ItemGroup>
<Target Name="IncludeAdditionalTfmSpecificPackageFiles">
<ItemGroup>
Expand Down
14 changes: 14 additions & 0 deletions binding/SkiaSharp/GRGlInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ private partial class EvasGlLoader
private readonly IntPtr glEvas;
private readonly EvasGlApi api;

#if NET7_0_OR_GREATER
[LibraryImport (libevas)]
internal static partial IntPtr evas_gl_api_get (IntPtr evas_gl);

Expand All @@ -221,6 +222,19 @@ private partial class EvasGlLoader

[LibraryImport(libevas)]
internal static partial IntPtr evas_gl_proc_address_get (IntPtr evas_gl, [MarshalAs (UnmanagedType.LPStr)] string name);
#else
[DllImport (libevas)]
internal static extern IntPtr evas_gl_api_get (IntPtr evas_gl);

[DllImport (libevas)]
internal static extern IntPtr evas_gl_context_api_get (IntPtr evas_gl, IntPtr ctx);

[DllImport (libevas)]
internal static extern IntPtr evas_gl_current_context_get (IntPtr evas_gl);

[DllImport (libevas)]
internal static extern IntPtr evas_gl_proc_address_get (IntPtr evas_gl, [MarshalAs (UnmanagedType.LPStr)] string name);
#endif

static EvasGlLoader ()
{
Expand Down
2 changes: 1 addition & 1 deletion externals/skia
55 changes: 40 additions & 15 deletions native/tizen/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,31 @@ DirectoryPath TIZEN_STUDIO_HOME = EnvironmentVariable("TIZEN_STUDIO_HOME") ?? PR

var bat = IsRunningOnWindows() ? ".bat" : "";
var tizen = TIZEN_STUDIO_HOME.CombineWithFilePath($"tools/ide/bin/tizen{bat}").FullPath;
var tizenVersion = "6.0";

void SetProjectProfile(string projectDir, string profile)
{
var propFile = MakeAbsolute((FilePath)$"{projectDir}/project_def.prop").FullPath;
var propContent = System.IO.File.ReadAllText(propFile);
propContent = System.Text.RegularExpressions.Regex.Replace(
propContent, @"^profile = .+$", $"profile = {profile}",
System.Text.RegularExpressions.RegexOptions.Multiline);
System.IO.File.WriteAllText(propFile, propContent);

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SetProjectProfile rewrites project_def.prop in-place but doesn’t verify that the profile = ... line was actually found/replaced. If the file format ever changes (or the line is missing), the build will silently keep the old profile and produce the wrong binaries. Consider checking for a successful match (and failing fast if not), and restoring the original file content after each build (try/finally) to avoid leaving the working tree dirty when running the Cake script locally.

Copilot uses AI. Check for mistakes.
}

Task("libSkiaSharp")
.IsDependentOn("git-sync-deps")
.Does(() =>
{
Build("armel", "arm", $"mobile-{tizenVersion}-device.core");
Build("i586", "x86", $"mobile-{tizenVersion}-emulator.core");
Build("armel", "arm", "arm", "mobile-6.0-device.core", "mobile-6.0", "6.0");
Build("i586", "x86", "x86", "mobile-6.0-emulator.core", "mobile-6.0", "6.0");
Build("x86_64","x64", "x86_64", "tizen-8.0-emulator64.core", "tizen-8.0", "8.0");
Build("aarch64","arm64","aarch64", "tizen-8.0-device64.core", "tizen-8.0", "8.0");

void Build(string arch, string skiaArch, string rootstrap)
void Build(string outputDir, string skiaArch, string tizenArch, string rootstrap, string profile, string ncliVersion)
{
if (Skip(arch)) return;
if (Skip(outputDir)) return;

GnNinja($"tizen/{arch}", "skia modules/skottie",
GnNinja($"tizen/{outputDir}", "skia modules/skottie",
$"target_os='tizen' " +
$"target_cpu='{skiaArch}' " +
$"skia_enable_ganesh=true " +
Expand All @@ -39,14 +50,20 @@ Task("libSkiaSharp")
$"skia_enable_skottie=true " +
$"extra_cflags=[ '-DSKIA_C_DLL', '-DXML_DEV_URANDOM' ] " +
$"ncli='{TIZEN_STUDIO_HOME}' " +
$"ncli_version='{tizenVersion}'");
$"ncli_version='{ncliVersion}'");

SetProjectProfile("libSkiaSharp", profile);

var buildDir = MakeAbsolute((DirectoryPath)$"libSkiaSharp/{CONFIGURATION}");
if (DirectoryExists(buildDir))
DeleteDirectory(buildDir, new DeleteDirectorySettings { Recursive = true, Force = true });

RunProcess(tizen, new ProcessSettings {
Arguments = $"build-native -a {skiaArch} -c llvm -C {CONFIGURATION} -r {rootstrap}" ,
Arguments = $"build-native -a {tizenArch} -c llvm -C {CONFIGURATION} -r {rootstrap}",
WorkingDirectory = MakeAbsolute((DirectoryPath)"libSkiaSharp").FullPath,
});

var outDir = OUTPUT_PATH.Combine(arch);
var outDir = OUTPUT_PATH.Combine(outputDir);
EnsureDirectoryExists(outDir);
CopyFile($"libSkiaSharp/{CONFIGURATION}/libskiasharp.so", outDir.CombineWithFilePath("libSkiaSharp.so"));
}
Expand All @@ -55,19 +72,27 @@ Task("libSkiaSharp")
Task("libHarfBuzzSharp")
.Does(() =>
{
Build("armel", "arm", $"mobile-{tizenVersion}-device.core");
Build("i586", "x86", $"mobile-{tizenVersion}-emulator.core");
Build("armel", "arm", "mobile-6.0-device.core", "mobile-6.0");
Build("i586", "x86", "mobile-6.0-emulator.core", "mobile-6.0");
Build("x86_64","x86_64", "tizen-8.0-emulator64.core", "tizen-8.0");
Build("aarch64","aarch64","tizen-8.0-device64.core", "tizen-8.0");

void Build(string arch, string cliArch, string rootstrap)
void Build(string outputDir, string tizenArch, string rootstrap, string profile)
{
if (Skip(arch)) return;
if (Skip(outputDir)) return;

SetProjectProfile("libHarfBuzzSharp", profile);

var buildDir = MakeAbsolute((DirectoryPath)$"libHarfBuzzSharp/{CONFIGURATION}");
if (DirectoryExists(buildDir))
DeleteDirectory(buildDir, new DeleteDirectorySettings { Recursive = true, Force = true });

RunProcess(tizen, new ProcessSettings {
Arguments = $"build-native -a {cliArch} -c llvm -C {CONFIGURATION} -r {rootstrap}" ,
Arguments = $"build-native -a {tizenArch} -c llvm -C {CONFIGURATION} -r {rootstrap}",
WorkingDirectory = MakeAbsolute((DirectoryPath)"libHarfBuzzSharp").FullPath,
});

var outDir = OUTPUT_PATH.Combine(arch);
var outDir = OUTPUT_PATH.Combine(outputDir);
EnsureDirectoryExists(outDir);
CopyFile($"libHarfBuzzSharp/{CONFIGURATION}/libharfbuzzsharp.so", outDir.CombineWithFilePath("libHarfBuzzSharp.so"));
}
Expand Down
10 changes: 8 additions & 2 deletions scripts/install-tizen.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# - https://developercommunity.visualstudio.com/content/problem/661596/the-updated-path-doesnt-kick-in.html

Param(
[string] $Version = "5.6",
[string] $Version = "6.1",
[string] $InstallDestination = $null,
[boolean] $UpgradeLLVM = $true
)
Expand Down Expand Up @@ -33,7 +33,7 @@ Write-Host "Install destination is '$ts'..."

$tsTemp = Join-Path "$HOME_DIR" "tizen-temp"
$install = Join-Path "$tsTemp" "tizen-install.$ext"
$packages = "MOBILE-6.0-NativeAppDevelopment"
$packages = "MOBILE-6.0-NativeAppDevelopment,TIZEN-8.0-NativeAppDevelopment"

# download
Write-Host "Downloading SDK to '$install'..."
Expand All @@ -46,6 +46,12 @@ Write-Host "JAVA_HOME is: $env:JAVA_HOME"
Write-Host "PATH contains JAVA_HOME: $($env:PATH.Contains("$env:JAVA_HOME"))"
& "java" -version

# clean up any previous install (the 6.1 installer fails if the directory already exists)
if (Test-Path "$ts") {
Write-Host "Removing previous installation at '$ts'..."
Remove-Item -Path "$ts" -Recurse -Force
}

Copilot AI Mar 29, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The script unconditionally deletes the existing $ts directory. If -InstallDestination is set incorrectly (or points somewhere shared), this can delete arbitrary paths recursively. Add a safety guard (e.g., only auto-delete when using the default $HOME_DIR\tizen-studio, or require an explicit -ForceReinstall flag / path sanity check) before calling Remove-Item -Recurse -Force.

Copilot uses AI. Check for mistakes.

# install
Write-Host "Installing SDK to '$ts'..."
if ($IsMacOS -or $IsLinux) {
Expand Down
1 change: 1 addition & 0 deletions source/SkiaSharp.Build.Override.in.props
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
dotnet workload install tizen (for Tizen support - Samsung)
-->
<!-- <IsNetTizenSupported>true</IsNetTizenSupported> -->
<!-- <TFMMinimum>net6.0</TFMMinimum> --> <!-- Override the minimum .NET version for platforms like Tizen -->
<!-- <IsNetTVOSSupported>true</IsNetTVOSSupported> -->
<!-- <IsNetMacOSSupported>true</IsNetMacOSSupported> -->

Expand Down
12 changes: 10 additions & 2 deletions source/SkiaSharp.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
<TFMPrevious>net9.0</TFMPrevious>
<!-- The current version of .NET that we are shipping for (all the TFMs) -->
<TFMCurrent>net10.0</TFMCurrent>
<!-- The minimum version of .NET for platforms where device runtime lags behind SDK (e.g. Tizen ships .NET 6 on device) -->
<TFMMinimum>net6.0</TFMMinimum>
</PropertyGroup>

<!-- Target Platform Versions -->
Expand All @@ -84,6 +86,8 @@
<TPVmacOSCurrent>26.2</TPVmacOSCurrent>
<TPVTizenCurrent>10.0</TPVTizenCurrent>
<TPVWindowsCurrent>10.0.19041.0</TPVWindowsCurrent>
<!-- Minimum (net6.0) — for platforms where device runtime lags behind SDK -->
<TPVTizenMinimum>8.0</TPVTizenMinimum>
</PropertyGroup>

<!-- MAUI Package Versions (must match installed workload versions per TFM) -->
Expand Down Expand Up @@ -115,9 +119,13 @@
<PropertyGroup Condition="'$(TFMBase)' != ''">
<BasicTargetFrameworksBase>$(TFMBase)</BasicTargetFrameworksBase>
</PropertyGroup>
<PropertyGroup Condition="'$(TFMMinimum)' != '' and '$(TFMMinimum)' != '$(TFMPrevious)' and '$(TFMMinimum)' != '$(TFMCurrent)'">
<BasicTargetFrameworksMinimum Condition="'$(TFMMinimum)' != '$(TFMBase)'">$(TFMMinimum)</BasicTargetFrameworksMinimum>
<PlatformTargetFrameworksMinimum Condition="!$(IsLinux) and $(IsNetTizenSupported)">$(TFMMinimum)-tizen$(TPVTizenMinimum)</PlatformTargetFrameworksMinimum>
</PropertyGroup>
<PropertyGroup>
<BasicTargetFrameworks>$(BasicTargetFrameworksCurrent);$(BasicTargetFrameworksPrevious);$(BasicTargetFrameworksBase)</BasicTargetFrameworks>
<PlatformTargetFrameworks>$(PlatformTargetFrameworksCurrent);$(PlatformTargetFrameworksPrevious)</PlatformTargetFrameworks>
<BasicTargetFrameworks>$(BasicTargetFrameworksCurrent);$(BasicTargetFrameworksPrevious);$(BasicTargetFrameworksBase);$(BasicTargetFrameworksMinimum)</BasicTargetFrameworks>
<PlatformTargetFrameworks>$(PlatformTargetFrameworksCurrent);$(PlatformTargetFrameworksPrevious);$(PlatformTargetFrameworksMinimum)</PlatformTargetFrameworks>
<AllTargetFrameworks>$(BasicTargetFrameworks);$(PlatformTargetFrameworks)</AllTargetFrameworks>
</PropertyGroup>

Expand Down
Loading