[packages/dotnet-gtk-sharp2] Rel 4
arekm
arekm at pld-linux.org
Mon Aug 17 00:22:09 CEST 2026
commit dd4941b5f592a7dff1f46110926f62b0c8848eac
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Mon Aug 17 00:21:48 2026 +0200
Rel 4
dotnet-gtk-sharp2-codegen-byref-return.patch | 22 ++++++++++++++++++++++
dotnet-gtk-sharp2-sample-range.patch | 17 +++++++++++++++++
dotnet-gtk-sharp2.spec | 6 +++++-
3 files changed, 44 insertions(+), 1 deletion(-)
---
diff --git a/dotnet-gtk-sharp2.spec b/dotnet-gtk-sharp2.spec
index 5bb5c1a..699c057 100644
--- a/dotnet-gtk-sharp2.spec
+++ b/dotnet-gtk-sharp2.spec
@@ -2,7 +2,7 @@ Summary: .NET language bindings for GTK+
Summary(pl.UTF-8): Wiązania GTK+ dla .NET
Name: dotnet-gtk-sharp2
Version: 2.12.45
-Release: 3
+Release: 4
License: LGPL v2
Group: Libraries
# latest downloads summary at http://download.mono-project.com/sources-stable/
@@ -11,6 +11,8 @@ Source0: http://download.mono-project.com/sources/gtk-sharp212/gtk-sharp-%{versi
Patch0: %{name}-destdir.patch
Patch1: %{name}-mint.patch
Patch2: %{name}-int-conversion.patch
+Patch3: %{name}-codegen-byref-return.patch
+Patch4: %{name}-sample-range.patch
URL: http://www.mono-project.com/GtkSharp
BuildRequires: atk-devel
BuildRequires: autoconf
@@ -75,6 +77,8 @@ Biblioteki statyczne Gtk# 2.
%patch -P0 -p1
%patch -P1 -p1
%patch -P2 -p1
+%patch -P3 -p1
+%patch -P4 -p1
%build
%{__libtoolize}
diff --git a/dotnet-gtk-sharp2-codegen-byref-return.patch b/dotnet-gtk-sharp2-codegen-byref-return.patch
new file mode 100644
index 0000000..94f9cc8
--- /dev/null
+++ b/dotnet-gtk-sharp2-codegen-byref-return.patch
@@ -0,0 +1,22 @@
+Fix the code generator emitting invalid C# for by-ref return values.
+
+MarshalType yields "ref T" for GValue* (and struct*) returns, but the emitted
+initialiser was "ref T raw_ret = call();". A ref local has to be initialised
+with "= ref call();", so any binding with such a method failed to compile with
+CS8172. Upstream gtk-sharp has no such method itself, so only out-of-tree
+bindings (galago-sharp) ever hit it.
+
+--- gtk-sharp-2.12.45/generator/Method.cs.orig
++++ gtk-sharp-2.12.45/generator/Method.cs
+@@ -329,7 +329,10 @@
+ if (retval.IsVoid)
+ sw.WriteLine(CName + call + ";");
+ else if (!cacheValue) {
+- sw.WriteLine(retval.MarshalType + " raw_ret = " + CName + call + ";");
++ // a byref return needs "= ref call()"; MarshalType alone yields
++ // "ref T raw_ret = call()", which is not valid C#
++ string ret_ref = retval.MarshalType.StartsWith ("ref ") ? "ref " : String.Empty;
++ sw.WriteLine(retval.MarshalType + " raw_ret = " + ret_ref + CName + call + ";");
+ sw.WriteLine(indent + "\t\t\t" + retval.CSType + " ret = " + retval.FromNative ("raw_ret") + ";");
+ var postRef = retval.PostFromNative ("raw_ret");
+ if (postRef != string.Empty)
diff --git a/dotnet-gtk-sharp2-sample-range.patch b/dotnet-gtk-sharp2-sample-range.patch
new file mode 100644
index 0000000..ba52f2e
--- /dev/null
+++ b/dotnet-gtk-sharp2-sample-range.patch
@@ -0,0 +1,17 @@
+Disambiguate Gtk.Range from System.Range in the sample.
+
+C# 8 (mono 6.x) introduced System.Range, so "using System; using Gtk;" makes
+the unqualified Range casts ambiguous and WidgetViewer.exe fails to build with
+CS0104.
+
+--- gtk-sharp-2.12.45/sample/test/TestRange.cs.orig
++++ gtk-sharp-2.12.45/sample/test/TestRange.cs
+@@ -9,6 +9,8 @@
+ using System;
+
+ using Gtk;
++// C# 8 added System.Range, which collides with Gtk.Range here
++using Range = Gtk.Range;
+
+ namespace WidgetViewer {
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/dotnet-gtk-sharp2.git/commitdiff/dd4941b5f592a7dff1f46110926f62b0c8848eac
More information about the pld-cvs-commit
mailing list