C#: building GtkSharp with lang/dotnet and cake

Background: The first roadblock of porting Ryujinx is the failing initialization of Gtk. It uses GtkSharp, a C# wrapper for Gtk. The problem is in Source/Libs/Shared/FuncLoader.cs, where it loads the shared library which includes dlopen. It uses different libraries for different platforms, e.g. kernel32.dll for Windows or libdl.so.2 for Linux. Eight months ago it gained "support for unknown unix", which loads libc. This is the program path FreeBSD would take. The problem is that Ryujinx uses a local copy of GtkSharp which it hasn't updated in two years and therefore doesn't include the unix addition. Before I approach upstream I want to compile and test a newer GtkSharp with Ryujinx myself.

Problem: The build of GtkSharp fails and I am a bit clueless, because I'm still not proficient with the C#/dotnet toolchain. I follow the build instructions:
Code:
git clone https://github.com/GtkSharp/GtkSharp.git gtksharp
cd gtksharp
dotnet tool restore
dotnet cake build.cake
I get:
Code:
No scripts found at /usr/home/user/gtksharp/CakeScripts/GAssembly.cake.
No scripts found at /usr/home/user/gtksharp/CakeScripts/Settings.cake.
No scripts found at /usr/home/user/gtksharp/CakeScripts/TargetEnvironment.cake.
No scripts found at /usr/home/user/gtksharp/CakeScripts/GAssembly.cake.
No scripts found at /usr/home/user/gtksharp/CakeScripts/Settings.cake.
No scripts found at /usr/home/user/gtksharp/CakeScripts/TargetEnvironment.cake.
Error: Failed to install addin 'Cake.FileHelpers'.

The question is: am I missing something obvious, like some environment variable I need to set, or is there some FreeBSD related incompatibility? Does somebody have a better insight in C# and cake?
 
The underlying problem is that Cake does not know that FreeBSD exists as it builds against NETStandard 2.1 and lacks explicit detection for it on newer standards.

I have PR to resolve that issue but be aware many third party tools/projects also do not know about FreeBSD and will need specific patching to resolve. This can get rather complicated.

As an example from Cake itself:
To build Cake you need a tool called GitVersion (which does not know about FreeBSD as it uses Cake!) which uses Lib2GitSharp (which does not know about FreeBSD) which is a dotNET wrapper for Lib2Git which, while there is a FreeBSD version in ports, is not built from Lib2Git.NativeBinaries as there are no FreeBSD runners on Github and the build flow uses a standalone Windows NuGet binary to bundle the libraries from Lib2Git.NativeBinaries for consumption.

Once all of that is resolved you can actually get Cake to dogfood!
 
The underlying problem is that Cake does not know that FreeBSD exists as it builds against NETStandard 2.1 and lacks explicit detection for it on newer standards.

I have PR to resolve that issue but be aware many third party tools/projects also do not know about FreeBSD and will need specific patching to resolve. This can get rather complicated.

As an example from Cake itself:
To build Cake you need a tool called GitVersion (which does not know about FreeBSD as it uses Cake!) which uses Lib2GitSharp (which does not know about FreeBSD) which is a dotNET wrapper for Lib2Git which, while there is a FreeBSD version in ports, is not built from Lib2Git.NativeBinaries as there are no FreeBSD runners on Github and the build flow uses a standalone Windows NuGet binary to bundle the libraries from Lib2Git.NativeBinaries for consumption.

Once all of that is resolved you can actually get Cake to dogfood!

Thank you for your explanations! Yeah I feared it wouldn't be that easy.
 
Back
Top