git: 881761df62fe - 2023Q3 - x11-toolkits/gtk-sharp*: Unbreak ports for lang/mono6.8

From: Robert Clausecker <fuz_at_FreeBSD.org>
Date: Sun, 06 Aug 2023 12:55:42 UTC
The branch 2023Q3 has been updated by fuz:

URL: https://cgit.FreeBSD.org/ports/commit/?id=881761df62fe2463ca1060ff39db492eb81dc20a

commit 881761df62fe2463ca1060ff39db492eb81dc20a
Author:     Marcin CieĊ›lak <saper@saper.info>
AuthorDate: 2023-08-04 22:59:04 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2023-08-06 12:55:03 +0000

    x11-toolkits/gtk-sharp*: Unbreak ports for lang/mono6.8
    
    See also:       https://svnweb.freebsd.org/changeset/ports/558398
    PR:             272950
    Approved by:    portmgr (build fix blanket)
    MFH:            2023Q3
    
    (cherry picked from commit 90301b32a60b21fa3b832f079c53177ef3418284)
---
 x11-toolkits/gtk-sharp20/Makefile                  |  8 +------
 .../files/patch-sample_test_TestRange.cs           | 28 ++++++++++++++++++++++
 x11-toolkits/gtk-sharp30/Makefile                  |  8 +------
 .../files/patch-sample_test_TestRange.cs           | 11 +++++++++
 4 files changed, 41 insertions(+), 14 deletions(-)

diff --git a/x11-toolkits/gtk-sharp20/Makefile b/x11-toolkits/gtk-sharp20/Makefile
index 6c182e304a4e..fe273d23b0a5 100644
--- a/x11-toolkits/gtk-sharp20/Makefile
+++ b/x11-toolkits/gtk-sharp20/Makefile
@@ -25,14 +25,8 @@ SHEBANG_FILES=	parser/*.pl
 GNU_CONFIGURE=	yes
 MAKE_ENV=	INSTALL_STRIP_FLAG=${STRIP}
 
-.include <bsd.port.pre.mk>
-
-.if defined(MONO_DEFAULT) && ${MONO_DEFAULT} > 6
-BROKEN=		fails to build with Mono version ${MONO_DEFAULT}: 'Range' is an ambiguous reference between 'System.Range' and 'Gtk.Range'
-.endif
-
 post-patch:
 	@${REINPLACE_CMD} -e 's|glib/.*\.h>|glib.h>|g' \
 		${WRKSRC}/glib/glue/*.c
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/x11-toolkits/gtk-sharp20/files/patch-sample_test_TestRange.cs b/x11-toolkits/gtk-sharp20/files/patch-sample_test_TestRange.cs
new file mode 100644
index 000000000000..ac009e65f700
--- /dev/null
+++ b/x11-toolkits/gtk-sharp20/files/patch-sample_test_TestRange.cs
@@ -0,0 +1,28 @@
+--- sample/test/TestRange.cs.orig	2016-09-21 11:49:20 UTC
++++ sample/test/TestRange.cs
+@@ -32,14 +32,14 @@ namespace WidgetViewer {
+ 
+ 			HScale hscale = new HScale (adjustment);
+ 			hscale.SetSizeRequest (150, -1);
+-			((Range) hscale).UpdatePolicy = UpdateType.Delayed;
++			((Gtk.Range) hscale).UpdatePolicy = UpdateType.Delayed;
+ 
+ 			hscale.Digits = 1;
+ 			hscale.DrawValue = true;
+ 			box2.PackStart (hscale, true, true, 0);
+ 
+ 			HScrollbar hscrollbar = new HScrollbar (adjustment);
+-			((Range) hscrollbar).UpdatePolicy = UpdateType.Continuous;
++			((Gtk.Range) hscrollbar).UpdatePolicy = UpdateType.Continuous;
+ 			box2.PackStart (hscrollbar, true, true, 0);
+ 
+ 			hscale = new HScale (adjustment);
+@@ -59,7 +59,7 @@ namespace WidgetViewer {
+ 			vscale.SetSizeRequest (-1, 200);
+ 			vscale.Digits = 2;
+ 			vscale.DrawValue = true;
+-			((Range) vscale).Inverted = true;
++			((Gtk.Range) vscale).Inverted = true;
+ 			hbox.PackStart (vscale, true, true, 0);
+ 
+ 			vscale = new VScale (adjustment);
diff --git a/x11-toolkits/gtk-sharp30/Makefile b/x11-toolkits/gtk-sharp30/Makefile
index 87f04bbe7fad..7c7a2d72342d 100644
--- a/x11-toolkits/gtk-sharp30/Makefile
+++ b/x11-toolkits/gtk-sharp30/Makefile
@@ -24,14 +24,8 @@ SHEBANG_FILES=	parser/*.pl
 USE_PERL5=	run
 MAKE_ENV=	INSTALL_STRIP_FLAG=${STRIP}
 
-.include <bsd.port.pre.mk>
-
-.if defined(MONO_DEFAULT) && ${MONO_DEFAULT} > 6
-BROKEN=		fails to build with Mono version ${MONO_DEFAULT}: 'Range' is an ambiguous reference between 'System.Range' and 'Gtk.Range'
-.endif
-
 post-patch:
 	@${REINPLACE_CMD} -e 's|gmcs|mcs|g' \
 		${WRKSRC}/configure
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/x11-toolkits/gtk-sharp30/files/patch-sample_test_TestRange.cs b/x11-toolkits/gtk-sharp30/files/patch-sample_test_TestRange.cs
new file mode 100644
index 000000000000..ef5a1e2aff1a
--- /dev/null
+++ b/x11-toolkits/gtk-sharp30/files/patch-sample_test_TestRange.cs
@@ -0,0 +1,11 @@
+--- sample/test/TestRange.cs.orig	2013-08-18 15:32:57 UTC
++++ sample/test/TestRange.cs
+@@ -57,7 +57,7 @@ namespace WidgetViewer {
+ 			vscale.SetSizeRequest (-1, 200);
+ 			vscale.Digits = 2;
+ 			vscale.DrawValue = true;
+-			((Range) vscale).Inverted = true;
++			((Gtk.Range) vscale).Inverted = true;
+ 			hbox.PackStart (vscale, true, true, 0);
+ 
+ 			vscale = new VScale (adjustment);