[packages/mono] Don't ship prebuilt Roslyn binaries; rel 2
arekm
arekm at pld-linux.org
Sun Aug 16 18:06:49 CEST 2026
commit c72b8ad8a7fb860b3e45ed194c82fb001b35b8f5
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Sun Aug 16 17:44:59 2026 +0200
Don't ship prebuilt Roslyn binaries; rel 2
Fixes from various distros etc
consistent-rpm-prov-req.patch | 20 ++-
mono-mdoc-declare-iface.patch | 41 ++++++
mono-mdoc-old-csharp.patch | 301 ++++++++++++++++++++++++++++++++++++++++++
mono-mdoc-reenable.patch | 86 ++++++++++++
mono-roslyn-binaries.patch | 16 +++
mono-use-mcs.patch | 11 ++
mono-zlib-alloc.patch | 35 +++++
mono.spec | 78 ++++++-----
8 files changed, 551 insertions(+), 37 deletions(-)
---
diff --git a/mono.spec b/mono.spec
index 8b4ff57..278a9a0 100644
--- a/mono.spec
+++ b/mono.spec
@@ -14,7 +14,7 @@ Summary: Common Language Infrastructure implementation
Summary(pl.UTF-8): Implementacja Common Language Infrastructure
Name: mono
Version: 6.14.1
-Release: 1
+Release: 2
License: LGPL v2 (VM), MIT/GPL v2 (C# compilers), MIT/MSPL/Apache v2.0 (classes), MIT/GPL v2 (tools)
Group: Development/Languages
Source0: https://dl.winehq.org/mono/sources/mono/%{name}-%{version}.tar.xz
@@ -30,6 +30,15 @@ Patch14: %{name}-tests-assert-side-effects.patch
# https://gitlab.winehq.org/mono/mono/-/commit/2224c6915a98f870cc9a3a9f9e3698e7b20e3d27
Patch15: %{name}-arm64-sigcontext.patch
Patch16: %{name}-CVE-2018-1002208.patch
+# ship no prebuilt Roslyn/NuGet payload; its assembly refs resolve via
+# bindingRedirect at runtime, which the rpm dep generator cannot model
+Patch17: %{name}-roslyn-binaries.patch
+Patch18: %{name}-use-mcs.patch
+# mcs cannot compile mdoc as-is, so downgrade the C# it uses
+Patch19: %{name}-mdoc-declare-iface.patch
+Patch20: %{name}-mdoc-old-csharp.patch
+Patch21: %{name}-mdoc-reenable.patch
+Patch22: %{name}-zlib-alloc.patch
URL: https://gitlab.winehq.org/mono/mono
%if %(test -r /dev/random; echo $?)
BuildRequires: ACCESSIBLE_/dev/random
@@ -41,7 +50,7 @@ BuildRequires: gettext-tools
%{!?with_bootstrap:BuildRequires: mono-devel >= 1.1.8.3-2}
%{?with_llvm:BuildRequires: mono-llvm >= 3.4}
BuildRequires: pkgconfig
-BuildRequires: rpmbuild(macros) >= 1.213
+BuildRequires: rpmbuild(macros) >= 1.737
BuildRequires: rpmbuild(monoautodeps)
BuildRequires: zlib-devel >= 1.2.3
BuildConflicts: mono-csharp < 2.4
@@ -62,6 +71,10 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define skip_post_check_so '.+(libmonosgen|libmono-profiler|libmono-native).*\.so.+'
+# *-api reference assemblies are compile-time stubs referencing a Mono.Cecil
+# revision mono no longer ships; they are never loaded, so it is not a dep
+%define _noautoreq_mono Mono.Cecil
+
%if %{with bootstrap}
%define __mono_provides /bin/true
%define __mono_requires /bin/true
@@ -225,6 +238,12 @@ oraz dotGNU.
%patch -P14 -p1
%patch -P15 -p1
%patch -P16 -p1
+%patch -P17 -p1
+%patch -P18 -p1
+%patch -P19 -p1
+%patch -P20 -p1
+%patch -P21 -p1
+%patch -P22 -p1
# for jay
cat >> mcs/build/config-default.make <<'EOF'
@@ -259,6 +278,7 @@ CPPFLAGS="%{rpmcppflags} -DUSE_LIBC_PRIVATE_SYMBOLS -DUSE_COMPILER_TLS"
--enable-big-arrays \
--with-large-heap \
%endif
+ --with-csc=mcs \
--with-libgc=included \
--without-monotouch \
--with-sgen \
@@ -293,6 +313,19 @@ install -d pld-doc/notes
cp -a docs/* pld-doc/notes
%{__rm} pld-doc/*/Makefile*
+# Roslyn binaries are not shipped, so drop their wrappers too
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/{csc,csi,vbc}
+# upstream keeps mcs/tools/linker NO_BUILD under MCS_MODE, so monolinker.exe
+# does not exist; drop its wrapper and man page rather than ship them broken
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/monolinker
+%{__rm} $RPM_BUILD_ROOT%{_mandir}/man1/monolinker.1
+
+# system-aot still emits images for assemblies we do not ship (Roslyn);
+# an AOT image without its assembly is dead weight
+for so in $RPM_BUILD_ROOT%{_prefix}/lib/mono/4.5/*.so ; do
+ [ -f "${so%.so}" ] || %{__rm} "$so"
+done
+
%{__mv} $RPM_BUILD_ROOT%{_bindir}/mono-find-* $RPM_BUILD_ROOT%{_rpmlibdir}
# loadable modules
@@ -455,7 +488,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_prefix}/lib/mono/mono-configuration-crypto/4.5/mono-configuration-crypto.exe
%exclude %{_prefix}/lib/mono/gac/monodoc
%{_prefix}/lib/mono/gac
-%exclude %{_prefix}/lib/mono/gac/*/*/*.pdb
+%exclude %{_prefix}/lib/mono/gac/*/*/*.mdb
%{_prefix}/lib/mono-source-libs
%dir %{_datadir}/.mono
%dir %{_datadir}/.mono/keypairs
@@ -542,7 +575,6 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_bindir}/mono-package-runtime
%attr(755,root,root) %{_bindir}/mono-symbolicate
%attr(755,root,root) %{_bindir}/monodis
-%attr(755,root,root) %{_bindir}/monolinker
%attr(755,root,root) %{_bindir}/monop
%attr(755,root,root) %{_bindir}/monop2
%attr(755,root,root) %{_bindir}/mono-shlib-cop
@@ -607,7 +639,6 @@ rm -rf $RPM_BUILD_ROOT
%{_prefix}/lib/mono/4.5/mono-shlib-cop.exe.config
%attr(755,root,root) %{_prefix}/lib/mono/4.5/mono-symbolicate.exe
%attr(755,root,root) %{_prefix}/lib/mono/4.5/mono-xmltool.exe
-%attr(755,root,root) %{_prefix}/lib/mono/4.5/monolinker.exe
%attr(755,root,root) %{_prefix}/lib/mono/4.5/monop.exe
%attr(755,root,root) %{_prefix}/lib/mono/4.5/permview.exe
%attr(755,root,root) %{_prefix}/lib/mono/4.5/resgen.exe
@@ -617,9 +648,8 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_prefix}/lib/mono/4.5/xbuild.exe
%{_prefix}/lib/mono/4.5/xbuild.exe.config
%{_prefix}/lib/mono/4.5/xbuild.rsp
-%{_prefix}/lib/mono/msbuild
-%exclude %{_prefix}/lib/mono/xbuild/*/bin/*.pdb
-%exclude %{_prefix}/lib/mono/xbuild/Microsoft/NuGet/*.pdb
+%exclude %{_prefix}/lib/mono/xbuild/*/bin/*.mdb
+%exclude %{_prefix}/lib/mono/xbuild/Microsoft/NuGet/*.mdb
%{_prefix}/lib/mono/xbuild
%{_prefix}/lib/mono/xbuild-frameworks
# mono support for lldb
@@ -667,7 +697,6 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/mono-symbolicate.1*
%{_mandir}/man1/mono-xmltool.1*
%{_mandir}/man1/monodis.1*
-%{_mandir}/man1/monolinker.1*
%{_mandir}/man1/monop.1*
%{_mandir}/man1/permview.1*
%{_mandir}/man1/resgen.1*
@@ -679,35 +708,20 @@ rm -rf $RPM_BUILD_ROOT
%files debug
%defattr(644,root,root,755)
-%{_prefix}/lib/mono/4.5/*.pdb
-%{_prefix}/lib/mono/4.5/Facades/*.pdb
-%{_prefix}/lib/mono/gac/*/*/*.pdb
-%{_prefix}/lib/mono/mono-configuration-crypto/4.5/*.pdb
-%{_prefix}/lib/mono/xbuild/12.0/bin/xbuild.pdb
-%{_prefix}/lib/mono/xbuild/14.0/bin/xbuild.pdb
-%{_prefix}/lib/mono/xbuild/Microsoft/NuGet/Microsoft.NuGet.Build.Tasks.pdb
+%{_prefix}/lib/mono/4.5/*.mdb
+%{_prefix}/lib/mono/4.5/Facades/*.mdb
+%{_prefix}/lib/mono/gac/*/*/*.mdb
+%{_prefix}/lib/mono/mono-configuration-crypto/4.5/*.mdb
+%{_prefix}/lib/mono/xbuild/12.0/bin/xbuild.exe.mdb
+%{_prefix}/lib/mono/xbuild/14.0/bin/xbuild.exe.mdb
+%{_prefix}/lib/mono/xbuild/Microsoft/NuGet/Microsoft.NuGet.Build.Tasks.dll.mdb
%files csharp -f mcs.lang
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/csc
%attr(755,root,root) %{_bindir}/csharp
-%attr(755,root,root) %{_bindir}/csi
%attr(755,root,root) %{_bindir}/dmcs
%attr(755,root,root) %{_bindir}/mcs
-%attr(755,root,root) %{_bindir}/vbc
-%attr(755,root,root) %{_prefix}/lib/mono/4.5/VBCSCompiler.exe
-%{_prefix}/lib/mono/4.5/VBCSCompiler.exe.config
-%attr(755,root,root) %{_prefix}/lib/mono/4.5/csc.exe
-%{_prefix}/lib/mono/4.5/csc.exe.config
-%attr(755,root,root) %{_prefix}/lib/mono/4.5/csc.exe.so
-%{_prefix}/lib/mono/4.5/csc.rsp
%attr(755,root,root) %{_prefix}/lib/mono/4.5/csharp.exe
-%attr(755,root,root) %{_prefix}/lib/mono/4.5/csi.exe
-%{_prefix}/lib/mono/4.5/csi.exe.config
-%{_prefix}/lib/mono/4.5/csi.rsp
-%attr(755,root,root) %{_prefix}/lib/mono/4.5/vbc.exe
-%{_prefix}/lib/mono/4.5/vbc.exe.config
-%{_prefix}/lib/mono/4.5/vbc.rsp
%{_mandir}/man1/mcs.1*
%{_mandir}/man1/csharp.1*
@@ -729,7 +743,7 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{_prefix}/lib/mono/4.5/mdoc.exe
%attr(755,root,root) %{_prefix}/lib/mono/4.5/mod.exe
%attr(755,root,root) %{_prefix}/lib/mono/monodoc/monodoc.dll
-%exclude %{_prefix}/lib/mono/gac/monodoc/*/*.pdb
+%exclude %{_prefix}/lib/mono/gac/monodoc/*/*.mdb
%{_prefix}/lib/mono/gac/monodoc
%dir %{_prefix}/lib/mono/monodoc
%dir %{_prefix}/lib/monodoc
diff --git a/consistent-rpm-prov-req.patch b/consistent-rpm-prov-req.patch
index 3c45fd2..77bc2a0 100644
--- a/consistent-rpm-prov-req.patch
+++ b/consistent-rpm-prov-req.patch
@@ -1,5 +1,5 @@
---- mono-6.14.1/scripts/mono-find-provides.in 2025-01-13 20:10:41.000000000 +0100
-+++ mono-6.14.1/scripts/mono-find-provides.in 2026-08-09 13:11:10.368212546 +0200
+--- mono-6.14.1/scripts/mono-find-provides.in
++++ mono-6.14.1/scripts/mono-find-provides.in
@@ -16,7 +16,7 @@
# Only include files with /gac/, /Facades/ or /4.5/ in path
@@ -18,9 +18,19 @@
echo "monodis missing or unusable, exiting..." 1>&2
exit 1
fi
---- mono-6.14.1/scripts/mono-find-requires.in 2025-01-13 20:10:41.000000000 +0100
-+++ mono-6.14.1/scripts/mono-find-requires.in 2026-08-09 13:11:10.368693162 +0200
-@@ -30,7 +30,7 @@
+--- mono-6.14.1/scripts/mono-find-requires.in
++++ mono-6.14.1/scripts/mono-find-requires.in
+@@ -14,6 +14,9 @@
+ IFS=$'\n'
+ filelist=($(grep -Ev '/usr/doc/|/usr/share/doc/'))
+ monolist=($(printf "%s\n" "${filelist[@]}" | egrep "\\.(exe|dll)\$"))
++# *-api/ holds compile-time reference assemblies; they are never loaded at
++# runtime, so their assembly references are not runtime dependencies
++monolist=($(printf "%s\n" "${monolist[@]}" | grep -v -- "-api/"))
+
+ # parse .config files to find which native libraries to depend on
+ # (target attribute must have double quotes for this to work, ie: target="file" )
+@@ -30,7 +33,7 @@
bindir=$prefix/bin
# Bail out if monodis or libmono is missing
diff --git a/mono-mdoc-declare-iface.patch b/mono-mdoc-declare-iface.patch
new file mode 100644
index 0000000..bad4f2a
--- /dev/null
+++ b/mono-mdoc-declare-iface.patch
@@ -0,0 +1,41 @@
+From 415b0ca76d1071bc2bb89f8860f4ce831d6a090a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m at gmail.com>
+Date: Mon, 3 Feb 2020 23:09:36 +0100
+Subject: [PATCH] DocumentationEnumerator.cs: Declare iface and ifaceMethod
+ correctly to fix NRE
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Using TypeReference and MethodReference instead of var to declare them.
+
+Fix #462
+
+Signed-off-by: Robert-André Mauchin <zebob.m at gmail.com>
+---
+ mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs
+index be22bf0..1917b59 100644
+--- a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs
++++ b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs
+@@ -341,7 +341,7 @@ namespace Mono.Documentation.Updater
+ var method = ((PropertyDefinition) mr).GetMethod ?? ((PropertyDefinition) mr).SetMethod;
+ if (method?.Overrides != null && method.Overrides.Any())
+ {
+- DocUtils.GetInfoForExplicitlyImplementedMethod(method, out var iface, out var ifaceMethod);
++ DocUtils.GetInfoForExplicitlyImplementedMethod(method, out TypeReference iface, out MethodReference ifaceMethod);
+ var newName = DocUtils.GetMemberForProperty(ifaceMethod.Name);
+ if (newName == memberName && verifyInterface(mr) && docName.Contains (iface.Name))
+ yield return mr;
+@@ -428,4 +428,4 @@ namespace Mono.Documentation.Updater
+ return count;
+ }
+ }
+-}
+\ No newline at end of file
++}
+--
+2.24.1
+
diff --git a/mono-mdoc-old-csharp.patch b/mono-mdoc-old-csharp.patch
new file mode 100644
index 0000000..9b32249
--- /dev/null
+++ b/mono-mdoc-old-csharp.patch
@@ -0,0 +1,301 @@
+From bf5c5a72978a0f9d32c9934e216bfaaf2d1717be Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m at gmail.com>
+Date: Mon, 3 Feb 2020 18:38:58 +0100
+Subject: [PATCH] Replace new Csharp features with old ones
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Replace new Csharp features like switch statements and
+"is null" to allow mdoc.exe to build with mcs.
+
+Signed-off-by: Robert-André Mauchin <zebob.m at gmail.com>
+---
+ mdoc/Mono.Documentation/Updater/DocUtils.cs | 91 ++++++++++---------
+ .../CppFormatters/CppFullMemberFormatter.cs | 26 +++---
+ .../Updater/Formatters/FSharpFormatter.cs | 16 ++--
+ .../Updater/Formatters/JsFormatter.cs | 27 +++---
+ .../Updater/Formatters/JsMemberFormatter.cs | 9 +-
+ 5 files changed, 85 insertions(+), 84 deletions(-)
+
+diff --git a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/DocUtils.cs b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/DocUtils.cs
+index 331ef90..fe2da59 100644
+--- a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/DocUtils.cs
++++ b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/DocUtils.cs
+@@ -287,24 +287,24 @@ namespace Mono.Documentation.Updater
+ return inst != null
+ ? inst.GenericArguments.Count
+ : type.GenericParameters.Count;
+- }
++ }
+
+ class TypeEquality : IEqualityComparer<TypeReference>
+- {
+- bool IEqualityComparer<TypeReference>.Equals (TypeReference x, TypeReference y)
++ {
++ bool IEqualityComparer<TypeReference>.Equals (TypeReference x, TypeReference y)
++ {
++ if (x == null && y == null) return true;
++ if (x == null || y == null) return false;
++ return x.FullName == y.FullName;
++ }
++
++ int IEqualityComparer<TypeReference>.GetHashCode (TypeReference obj)
+ {
+- if (x is null && y is null) return true;
+- if (x is null || y is null) return false;
+- return x.FullName == y.FullName;
+- }
+-
+- int IEqualityComparer<TypeReference>.GetHashCode (TypeReference obj)
+- {
+- return obj.GetHashCode ();
++ return obj.GetHashCode ();
+ }
+ }
+ static TypeEquality typeEqualityComparer = new TypeEquality ();
+-
++
+ public static IEnumerable<TypeReference> GetAllPublicInterfaces (TypeDefinition type)
+ {
+ return GetAllInterfacesFromType (type)
+@@ -314,7 +314,7 @@ namespace Mono.Documentation.Updater
+
+ private static IEnumerable<TypeReference> GetAllInterfacesFromType(TypeDefinition type)
+ {
+- if (type is null)
++ if (type == null)
+ yield break;
+
+ foreach(var i in type.Interfaces)
+@@ -525,26 +525,29 @@ namespace Mono.Documentation.Updater
+ FillUnifiedMemberTypeNames(unifiedTypeNames, memberReference as IGenericParameterProvider);// Fill the member generic parameters unified names as M0, M1....
+ FillUnifiedTypeNames(unifiedTypeNames, memberReference.DeclaringType, genericInterface);// Fill the type generic parameters unified names as T0, T1....
+
+- switch (memberReference)
+- {
+- case IMethodSignature methodSignature:
+- buf.Append(GetUnifiedTypeName(methodSignature.ReturnType, unifiedTypeNames)).Append(" ");
+- buf.Append(SimplifyName(memberReference.Name)).Append(" ");
+- AppendParameters(buf, methodSignature.Parameters, unifiedTypeNames);
+- break;
+- case PropertyDefinition propertyReference:
+- buf.Append(GetUnifiedTypeName(propertyReference.PropertyType, unifiedTypeNames)).Append(" ");
+- if (propertyReference.GetMethod != null)
+- buf.Append("get").Append(" ");
+- if (propertyReference.SetMethod != null)
+- buf.Append("set").Append(" ");
+- buf.Append(SimplifyName(memberReference.Name)).Append(" ");
+- AppendParameters(buf, propertyReference.Parameters, unifiedTypeNames);
+- break;
+- case EventDefinition eventReference:
+- buf.Append(GetUnifiedTypeName(eventReference.EventType, unifiedTypeNames)).Append(" ");
+- buf.Append(SimplifyName(memberReference.Name)).Append(" ");
+- break;
++ if (memberReference is IMethodSignature)
++ {
++ IMethodSignature methodSignature = (IMethodSignature)memberReference;
++ buf.Append(GetUnifiedTypeName(methodSignature.ReturnType, unifiedTypeNames)).Append(" ");
++ buf.Append(SimplifyName(memberReference.Name)).Append(" ");
++ AppendParameters(buf, methodSignature.Parameters, unifiedTypeNames);
++ }
++ if (memberReference is PropertyDefinition)
++ {
++ PropertyDefinition propertyReference = (PropertyDefinition)memberReference;
++ buf.Append(GetUnifiedTypeName(propertyReference.PropertyType, unifiedTypeNames)).Append(" ");
++ if (propertyReference.GetMethod != null)
++ buf.Append("get").Append(" ");
++ if (propertyReference.SetMethod != null)
++ buf.Append("set").Append(" ");
++ buf.Append(SimplifyName(memberReference.Name)).Append(" ");
++ AppendParameters(buf, propertyReference.Parameters, unifiedTypeNames);
++ }
++ if (memberReference is EventDefinition)
++ {
++ EventDefinition eventReference = (EventDefinition)memberReference;
++ buf.Append(GetUnifiedTypeName(eventReference.EventType, unifiedTypeNames)).Append(" ");
++ buf.Append(SimplifyName(memberReference.Name)).Append(" ");
+ }
+
+ var memberUnifiedTypeNames = new Dictionary<string, string>();
+@@ -666,14 +669,20 @@ namespace Mono.Documentation.Updater
+ /// </summary>
+ private static Collection<MethodReference> GetOverrides(MemberReference memberReference)
+ {
+- switch (memberReference)
++ if (memberReference is MethodDefinition)
++ {
++ MethodDefinition methodDefinition = (MethodDefinition)memberReference;
++ return methodDefinition.Overrides;
++ }
++ if (memberReference is PropertyDefinition)
++ {
++ PropertyDefinition propertyDefinition = (PropertyDefinition)memberReference;
++ return (propertyDefinition.GetMethod ?? propertyDefinition.SetMethod)?.Overrides;
++ }
++ if (memberReference is EventDefinition)
+ {
+- case MethodDefinition methodDefinition:
+- return methodDefinition.Overrides;
+- case PropertyDefinition propertyDefinition:
+- return (propertyDefinition.GetMethod ?? propertyDefinition.SetMethod)?.Overrides;
+- case EventDefinition evendDefinition:
+- return evendDefinition.AddMethod.Overrides;
++ EventDefinition evendDefinition = (EventDefinition)memberReference;
++ return evendDefinition.AddMethod.Overrides;
+ }
+
+ return null;
+@@ -692,4 +701,4 @@ namespace Mono.Documentation.Updater
+ return method.Name.StartsWith("op_", StringComparison.Ordinal);
+ }
+ }
+-}
+\ No newline at end of file
++}
+diff --git a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs
+index 7d68c38..6b9bcf6 100644
+--- a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs
++++ b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppFullMemberFormatter.cs
+@@ -1029,20 +1029,16 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
+ if (mref.IsDefinition == false)
+ mref = mref.Resolve() as MemberReference;
+
+- switch (mref)
+- {
+- case FieldDefinition field:
+- return IsSupportedField(field);
+- case MethodDefinition method:
+- return IsSupportedMethod(method);
+- case PropertyDefinition property:
+- return IsSupportedProperty(property);
+- case EventDefinition @event:
+- return IsSupportedEvent(@event);
+- case AttachedPropertyDefinition _:
+- case AttachedEventDefinition _:
+- return false;
+- }
++ if (mref is FieldDefinition)
++ return IsSupportedField((FieldDefinition)mref);
++ else if (mref is MethodDefinition)
++ return IsSupportedMethod((MethodDefinition)mref);
++ else if (mref is PropertyDefinition)
++ return IsSupportedProperty((PropertyDefinition)mref);
++ else if (mref is EventDefinition)
++ return IsSupportedEvent((EventDefinition)mref);
++ else if (mref is AttachedPropertyDefinition || mref is AttachedEventDefinition)
++ return false;
+
+ throw new NotSupportedException("Unsupported member type: " + mref?.GetType().FullName);
+ }
+@@ -1119,4 +1115,4 @@ namespace Mono.Documentation.Updater.Formatters.CppFormatters
+ return true;
+ }
+ }
+-}
+\ No newline at end of file
++}
+diff --git a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/FSharpFormatter.cs b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/FSharpFormatter.cs
+index 236d56f..f91bf9a 100644
+--- a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/FSharpFormatter.cs
++++ b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/FSharpFormatter.cs
+@@ -1029,15 +1029,15 @@ namespace Mono.Documentation.Updater
+ }
+ return false;
+ }
+- switch (mref)
++ if (mref is MethodDefinition)
+ {
+- case MethodDefinition method:
+- return !(method.HasCustomAttributes && method.CustomAttributes.Any(
+- ca => ca.GetDeclaringType() ==
+- "System.Diagnostics.Contracts.ContractInvariantMethodAttribute"
+- || ca.GetDeclaringType() ==
+- Consts.CompilerGeneratedAttribute))
+- && AppendVisibility(new StringBuilder(), method) != null;
++ MethodDefinition method = (MethodDefinition)mref;
++ return !(method.HasCustomAttributes && method.CustomAttributes.Any(
++ ca => ca.GetDeclaringType() ==
++ "System.Diagnostics.Contracts.ContractInvariantMethodAttribute"
++ || ca.GetDeclaringType() ==
++ Consts.CompilerGeneratedAttribute))
++ && AppendVisibility(new StringBuilder(), method) != null;
+ }
+
+ return true;
+diff --git a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/JsFormatter.cs b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/JsFormatter.cs
+index f8b2f04..92b8f3c 100644
+--- a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/JsFormatter.cs
++++ b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/JsFormatter.cs
+@@ -68,23 +68,22 @@ namespace mdoc.Mono.Documentation.Updater.Formatters
+
+ public override bool IsSupported(MemberReference mref)
+ {
+- switch (mref)
++ if (mref is PropertyDefinition)
+ {
+- case PropertyDefinition propertyDefinition:
+- if (!IsPropertySupported(propertyDefinition))
+- return false;
+- break;
+- case MethodDefinition methodDefinition:
+- if (!IsMethodSupported(methodDefinition))
+- return false;
+- break;
+- case FieldDefinition _:
+- return false;// In WinRT fields can be exposed only by structures.
+- case AttachedEventDefinition _:
++ PropertyDefinition propertyDefinition = (PropertyDefinition)mref;
++ if (!IsPropertySupported(propertyDefinition))
+ return false;
+- case AttachedPropertyDefinition _:
++ }
++ else if (mref is MethodDefinition)
++ {
++ MethodDefinition methodDefinition = (MethodDefinition)mref;
++ if (!IsMethodSupported(methodDefinition))
+ return false;
+ }
++ else if (mref is FieldDefinition // In WinRT fields can be exposed only by structures.
++ || mref is AttachedEventDefinition
++ || mref is AttachedPropertyDefinition)
++ return false;
+
+ var member = mref.Resolve();
+ return member != null
+@@ -169,4 +168,4 @@ namespace mdoc.Mono.Documentation.Updater.Formatters
+ return fullName;
+ }
+ }
+-}
+\ No newline at end of file
++}
+diff --git a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/JsMemberFormatter.cs b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/JsMemberFormatter.cs
+index 6bc6995..f6c8af6 100644
+--- a/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/JsMemberFormatter.cs
++++ b/external/api-doc-tools/mdoc/Mono.Documentation/Updater/Formatters/JsMemberFormatter.cs
+@@ -58,12 +58,9 @@ namespace mdoc.Mono.Documentation.Updater.Formatters
+
+ public override bool IsSupported(MemberReference mref)
+ {
+- switch (mref)
++ if (mref is PropertyDefinition || mref is EventDefinition)
+ {
+- case PropertyDefinition _:
+- return false;
+- case EventDefinition _:
+- return false;
++ return false;
+ }
+ return base.IsSupported(mref);
+ }
+@@ -82,4 +79,4 @@ namespace mdoc.Mono.Documentation.Updater.Formatters
+ return base.IsSupported(tref);
+ }
+ }
+-}
+\ No newline at end of file
++}
+--
+2.24.1
+
diff --git a/mono-mdoc-reenable.patch b/mono-mdoc-reenable.patch
new file mode 100644
index 0000000..c757eb2
--- /dev/null
+++ b/mono-mdoc-reenable.patch
@@ -0,0 +1,86 @@
+From 7d46c195498b06f6fe0562f957f7309140c24a46 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= <zebob.m at gmail.com>
+Date: Mon, 3 Feb 2020 20:51:40 +0100
+Subject: [PATCH] Reenable mdoc.exe build
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Robert-Andr<C3><A9> Mauchin <zebob.m at gmail.com>
+---
+ mcs/docs/Makefile | 4 ----
+ mcs/tools/mdoc/Makefile | 18 ++++++------------
+ 2 files changed, 6 insertions(+), 16 deletions(-)
+
+diff --git a/mcs/docs/Makefile b/mcs/docs/Makefile
+index b66d70230..519a98443 100644
+--- a/mcs/docs/Makefile
++++ b/mcs/docs/Makefile
+@@ -38,10 +38,6 @@ DISABLE_MCS_DOCS = yes
+ endif
+ endif
+
+-ifdef MCS_MODE
+-DISABLE_MCS_DOCS = yes
+-endif
+-
+ test-local run-test-local run-test-ondotnet-local doc-update:
+
+ clean-local:
+diff --git a/mcs/tools/mdoc/Makefile b/mcs/tools/mdoc/Makefile
+index e3c5a321d..008203616 100644
+--- a/mcs/tools/mdoc/Makefile
++++ b/mcs/tools/mdoc/Makefile
+@@ -44,12 +44,6 @@ $(PROGRAM): $(PROGRAM_DEPS)
+
+ PROGRAM_COMPILE = $(CSCOMPILE)
+
+-ifdef MCS_MODE
+-NO_INSTALL=1
+-NO_BUILD=1
+-NO_TEST=1
+-endif
+-
+ include ../../build/executable.make
+
+ MONO = \
+@@ -63,6 +57,11 @@ DIFF = diff -rupZ
+ DIFF_QUIET = diff --brief -Z
+ endif
+
++ifdef MCS_MODE
++DIFF = echo "WARNING: running in mcs mode, tests are specific to roslyn and would fail. Skipping diff check."
++DIFF_QUIET = $(DIFF)
++endif
++
+ dist-local: dist-default dist-tests
+
+ dist-tests:
+@@ -360,7 +359,7 @@ check-mdoc-export-msxdoc-update:
+
+ check-mdoc-export-msxdoc:
+ $(MONO) $(PROGRAM) export-msxdoc -o - Test/en.expected.importslashdoc \
+- | $(DIFF) - Test/msxdoc-expected.importslashdoc.xml
++ | $(DIFF_QUIET) - Test/msxdoc-expected.importslashdoc.xml
+
+ my_abs_top_srcdir = $(shell cd . && pwd)
+
+@@ -390,10 +389,6 @@ run-test-local: check-doc-tools
+
+ run-test-update : check-doc-tools-update
+
+-ifdef MCS_MODE
+-check-doc-tools:
+- @echo "WARNING: running in mcs mode, mdoc doesn't compile with mcs. Skipping."
+-else
+ check-doc-tools: \
+ check-monodocer-since \
+ check-monodocer-importecmadoc \
+@@ -412,7 +407,6 @@ check-doc-tools: \
+ check-monodocer-dropns-multi-withexisting
+
+ #check-monodocer-dropns-delete
+-endif
+
+ check-doc-tools-update: check-monodocer-since-update \
+ check-monodocer-importecmadoc-update \
diff --git a/mono-roslyn-binaries.patch b/mono-roslyn-binaries.patch
new file mode 100644
index 0000000..c957712
--- /dev/null
+++ b/mono-roslyn-binaries.patch
@@ -0,0 +1,16 @@
+--- a/mcs/packages/Makefile 2019-02-21 04:53:46.843939657 +0000
++++ b/mcs/packages/Makefile 2019-02-21 04:53:40.111824983 +0000
+@@ -42,11 +42,13 @@
+
+ install-local:
+ $(MKINSTALLDIRS) $(TARGET_DIR)
++ifndef MCS_MODE
+ $(INSTALL_LIB) $(ROSLYN_FILES_FOR_MONO) $(TARGET_DIR)
+ $(MKINSTALLDIRS) $(MSBUILD_ROSLYN_DIR)
+ $(INSTALL_LIB) $(ROSLYN_FILES_TO_COPY_FOR_MSBUILD) $(MSBUILD_ROSLYN_DIR)
+
+ (cd $(MSBUILD_ROSLYN_DIR); for asm in $(ROSLYN_FILES_FOR_MONO); do ln -fs ../../../../$(FRAMEWORK_VERSION)/$$(basename $$asm) . ; done)
++endif
+
+ run-test-local: test-csi
+
diff --git a/mono-use-mcs.patch b/mono-use-mcs.patch
new file mode 100644
index 0000000..294ece2
--- /dev/null
+++ b/mono-use-mcs.patch
@@ -0,0 +1,11 @@
+--- mono-6.14.1/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs 2019-02-20 21:17:20.324780985 +0000
++++ mono-6.14.1/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks/Csc.cs 2019-02-20 21:17:43.537165909 +0000
+@@ -219,7 +219,7 @@
+
+ protected override string ToolName {
+ get {
+- return MSBuildUtils.RunningOnWindows ? "csc.bat" : "csc.exe";
++ return MSBuildUtils.RunningOnWindows ? "mcs.bat" : "mcs.exe";
+ }
+ }
+
diff --git a/mono-zlib-alloc.patch b/mono-zlib-alloc.patch
new file mode 100644
index 0000000..d9c3b25
--- /dev/null
+++ b/mono-zlib-alloc.patch
@@ -0,0 +1,35 @@
+From ed68c250b8589663601aa7dd88177697d0b37ec9 Mon Sep 17 00:00:00 2001
+From: jo-oe <38652639+jo-oe at users.noreply.github.com>
+Date: Tue, 9 Apr 2024 16:57:39 +0200
+Subject: [PATCH] Correct the selection of alloc/free functions for zlib.
+
+Avoids segfault when working with zlib-ng.
+See:
+https://github.com/zlib-ng/zlib-ng/issues/1708
+---
+ support/zlib-helper.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/support/zlib-helper.c b/support/zlib-helper.c
+index 76d8951ad8a8a..a5fbc0138822d 100644
+--- a/support/zlib-helper.c
++++ b/support/zlib-helper.c
+@@ -76,6 +76,8 @@ CreateZStream (gint compress, guchar gzip, read_write_func func, void *gchandle)
+ return NULL;
+
+ z = z_new0 (z_stream);
++ z->zalloc = z_alloc;
++ z->zfree = z_free;
+ if (compress) {
+ retval = deflateInit2 (z, Z_DEFAULT_COMPRESSION, Z_DEFLATED, gzip ? 31 : -15, 8, Z_DEFAULT_STRATEGY);
+ } else {
+@@ -86,8 +88,6 @@ CreateZStream (gint compress, guchar gzip, read_write_func func, void *gchandle)
+ free (z);
+ return NULL;
+ }
+- z->zalloc = z_alloc;
+- z->zfree = z_free;
+ result = z_new0 (ZStream);
+ result->stream = z;
+ result->func = func;
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/mono.git/commitdiff/c72b8ad8a7fb860b3e45ed194c82fb001b35b8f5
More information about the pld-cvs-commit
mailing list