Porting Mono


#21

NodeJS shudder


#22

Get Python interfaced with Qt5 on Haiku…aka PyQt port.

Already ported.

Get Python 3 to interface with Haiku’s GUI (ala the old Bethon)
Port NodeJS

Please, seat yourself, and take a part/port in the adventure! :wink:


#23

You seem to be grossly misinformed about how GSoC works.

Feel free to put in the work to port these.


#24

Indeed, people who do the work drive the project. People who only complain on the forums don’t. Did you expect things to work in any other way?

The developers are where they are because they think the project is interesting and they found it worth contributing to. Also I don’t think we have any active “core kernel developers” at the moment. Only people doing web browsers, drivers, build system stuff, etc. Which is not a good thing in the long term, but ok at the moment, as we are trying to stabilize things for the beta, not implement the next cool kernel tweak.


#25

When will we have paint .net? C:


#26

I would think we could accomplish developing a more native version of Paint for Haiku :wink:


#27

Does ArtPaint have any specific deficiencies (compared to say paint.net)? Between that and WonderBrush, I’m pretty well covered. OK – for really advanced stuff I have to go to Linux/GIMP, but that’s pretty rare.


#28

Though I like ArtPaint and Wonderbrush, they both lack the real simplicity of Microsoft Paint (probably the only app I actually like coming from Redmond). I have PaintBrush on Mac that is a close cousin.


#29

There is KDE-based KolourPaint in the repos. It it exactly the same as MS Paint was before they introduced that office ribbon control =)


#30

I have it installed actually. However, it would be great to get a more native Paint like app for Haiku.

As for the ribbon UI… I hate it :dizzy_face:


#31

Well, Kolourpaint is a Qt application, but how do you actually notice this while using it? Apart from the file dialog it looks exactly like a native Haiku application to me.


#32

I think even when Mono is ported the UI components won’t be. Paint.net needs Win32 controls and the Win32 API to be implemented as well as Mono.


#33

That is rather impossible, so one would probably go for QtSharp or something similar. Paint.NET is out of question, so let’s hope CLR will be running at least… Calvin doesn’t quite get any help on GitHub with that issue, so first let’s see if it’s feasible to do at all =)


#34

Or maybe the support .mono from Godot engine 3.0, it can use it.


#35

An old version of Paint.NET is possible (before they closed sourced it, let alone added more native Windows stuff) once Mono is ported, and then work on getting libgdiplus/Mono.Windows.Forms outputting onto app_server can be done for the UI. Work for sure, but quite doable.

I haven’t used Godot, but once Mono works, it’d probably work there I guess.

I’m still stumped, but I haven’t done any debugging in a while. I’d like for someone smarter than me to give it a shot though…


#36

As a little motivation: /r/OpenBSD_Gaming has games written for XNA (that were ported to Linux via FNA/MonoGame) running on OpenBSD, unmodified, just with minor library tweaks - including games like Bastion, Owlboy, Rogue Legacy, and Stardew Valley. If we get Mono running, then we can just get FNA/MonoGame working and have a bunch of hot indie games people play, working fine on Haiku.


#37

i think in the gamer develop it is very very needed.


#38

Still working on it, and I still would really like help debugging this runtime termination issue. I really don’t know if I’m hitting a Mono bug or a possible Haiku bug.

If you care to join me working against master, apply this patch (i’ll submit a PR for it) to the corefx submodule, and configure with --with-sigaltstack=no:

diff --git a/src/Native/Unix/System.Native/pal_errno.c b/src/Native/Unix/System.Native/pal_errno.c
index 996d777da0..793d09747a 100644
--- a/src/Native/Unix/System.Native/pal_errno.c
+++ b/src/Native/Unix/System.Native/pal_errno.c
@@ -178,8 +178,10 @@ int32_t SystemNative_ConvertErrorPlatformToPal(int32_t platformErrno)
             return Error_ETXTBSY;
         case EXDEV:
             return Error_EXDEV;
+#ifdef ESOCKTNOSUPPORT
         case ESOCKTNOSUPPORT:
             return Error_ESOCKTNOSUPPORT;
+#endif
         case EPFNOSUPPORT:
             return Error_EPFNOSUPPORT;
         case ESHUTDOWN:
@@ -366,8 +368,10 @@ int32_t SystemNative_ConvertErrorPalToPlatform(int32_t error)
             return EXDEV;
         case Error_EPFNOSUPPORT:
             return EPFNOSUPPORT;
+#ifdef ESOCKTNOSUPPORT:
         case Error_ESOCKTNOSUPPORT:
             return ESOCKTNOSUPPORT;
+#endif
         case Error_ESHUTDOWN:
             return ESHUTDOWN;
         case Error_EHOSTDOWN:
diff --git a/src/Native/Unix/System.Native/pal_io.c b/src/Native/Unix/System.Native/pal_io.c
index f95a18a5de..c8c65e6299 100644
--- a/src/Native/Unix/System.Native/pal_io.c
+++ b/src/Native/Unix/System.Native/pal_io.c
@@ -121,8 +121,8 @@ c_static_assert(PAL_SEEK_CUR == SEEK_CUR);
 c_static_assert(PAL_SEEK_END == SEEK_END);
 
 // Validate our PollFlags enum values are correct for the platform
-// HACK: AIX values are different; we convert them between PAL_POLL and POLL now
-#ifndef _AIX
+// HACK: AIX and Haiku values are different; we convert them between PAL_POLL and POLL now
+#if !(defined (_AIX) || defined (__HAIKU__))
 c_static_assert(PAL_POLLIN == POLLIN);
 c_static_assert(PAL_POLLPRI == POLLPRI);
 c_static_assert(PAL_POLLOUT == POLLOUT);
@@ -883,6 +883,7 @@ int32_t SystemNative_MAdvise(void* address, uint64_t length, int32_t advice)
 
 int32_t SystemNative_MLock(void* address, uint64_t length)
 {
+#if !defined (__HAIKU__)
     if (length > SIZE_MAX)
     {
         errno = ERANGE;
@@ -890,10 +891,15 @@ int32_t SystemNative_MLock(void* address, uint64_t length)
     }
 
     return mlock(address, (size_t)length);
+#else
+    errno = ENOSYS;
+    return -1;
+#endif
 }
 
 int32_t SystemNative_MUnlock(void* address, uint64_t length)
 {
+#if !defined (__HAIKU__)
     if (length > SIZE_MAX)
     {
         errno = ERANGE;
@@ -901,6 +907,10 @@ int32_t SystemNative_MUnlock(void* address, uint64_t length)
     }
 
     return munlock(address, (size_t)length);
+#else
+    errno = ENOSYS;
+    return -1;
+#endif
 }
 
 int32_t SystemNative_MProtect(void* address, uint64_t length, int32_t protection)
@@ -1442,7 +1452,7 @@ int32_t SystemNative_LockFileRegion(intptr_t fd, int64_t offset, int64_t length,
         return -1;
     }
 
-#if HAVE_FLOCK64
+#if HAVE_FLOCK64 && !defined (__HAIKU__)
     struct flock64 lockArgs;
 #else
     struct flock lockArgs;
diff --git a/src/Native/Unix/System.Native/pal_maphardwaretype.c b/src/Native/Unix/System.Native/pal_maphardwaretype.c
index 7f8e825783..47864e45f9 100644
--- a/src/Native/Unix/System.Native/pal_maphardwaretype.c
+++ b/src/Native/Unix/System.Native/pal_maphardwaretype.c
@@ -56,27 +56,39 @@ uint16_t MapHardwareType(uint16_t nativeType)
     {
         case IFT_ETHER:
             return NetworkInterfaceType_Ethernet;
+#ifdef IFT_ISO88025
         case IFT_ISO88025:
             return NetworkInterfaceType_TokenRing;
+#endif
+#ifdef IFT_FDDI
         case IFT_FDDI:
             return NetworkInterfaceType_Fddi;
+#endif
+#ifdef IFT_ISDNBASIC
         case IFT_ISDNBASIC:
             return NetworkInterfaceType_Isdn;
+#endif
+#ifdef IFT_ISDNPRIMARY
         case IFT_ISDNPRIMARY:
             return NetworkInterfaceType_PrimaryIsdn;
+#endif
         case IFT_PPP:
             return NetworkInterfaceType_Ppp;
         case IFT_LOOP:
             return NetworkInterfaceType_Loopback;
+#ifdef IFT_XETHER
         case IFT_XETHER:
             return NetworkInterfaceType_Ethernet3Megabit;
+#endif
         case IFT_SLIP:
             return NetworkInterfaceType_Slip;
+#ifdef IFT_ATM
         case IFT_ATM:
             return NetworkInterfaceType_Atm;
+#endif
         case IFT_MODEM:
             return NetworkInterfaceType_GenericModem;
-#if defined(IFT_IEEE1394)
+#ifdef IFT_IEEE1394
         case IFT_IEEE1394:
             return NetworkInterfaceType_HighPerformanceSerialBus;
 #endif
diff --git a/src/Native/Unix/System.Native/pal_networking.c b/src/Native/Unix/System.Native/pal_networking.c
index 74864b371b..0f7fcd5706 100644
--- a/src/Native/Unix/System.Native/pal_networking.c
+++ b/src/Native/Unix/System.Native/pal_networking.c
@@ -31,6 +31,10 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/socket.h>
+#if defined (__HAIKU__)
+#include <sys/time.h>
+#include <sys/sockio.h>
+#endif
 #include <sys/un.h>
 #if defined(__APPLE__) && __APPLE__
 #include <sys/socketvar.h>
@@ -49,6 +53,10 @@
 #if !HAVE_IN_PKTINFO
 #include <net/if.h>
 #if HAVE_GETIFADDRS
+#if defined (__HAIKU__)
+// Haiku needs this define for getifaddrs
+#define _BSD_SOURCE
+#endif
 #include <ifaddrs.h>
 #endif
 #endif
@@ -400,7 +408,7 @@ int32_t SystemNative_GetDomainName(uint8_t* name, int32_t nameLength)
 #endif
 
     return getdomainname((char*)name, namelen);
-#elif HAVE_UNAME
+#elif HAVE_UNAME && !defined (__HAIKU__)
     // On Android, there's no getdomainname but we can use uname to fetch the domain name
     // of the current device
     size_t namelen = (uint32_t)nameLength;
@@ -1852,9 +1860,11 @@ static bool TryConvertSocketTypePalToPlatform(int32_t palSocketType, int* platfo
             *platformSocketType = SOCK_RAW;
             return true;
 
+#ifdef SOCK_RDM
         case SocketType_SOCK_RDM:
             *platformSocketType = SOCK_RDM;
             return true;
+#endif
 
         case SocketType_SOCK_SEQPACKET:
             *platformSocketType = SOCK_SEQPACKET;
diff --git a/src/Native/Unix/System.Native/pal_tcpstate.c b/src/Native/Unix/System.Native/pal_tcpstate.c
index 7ea8fc1895..8fe6070708 100644
--- a/src/Native/Unix/System.Native/pal_tcpstate.c
+++ b/src/Native/Unix/System.Native/pal_tcpstate.c
@@ -11,7 +11,7 @@
 #elif HAVE_TCP_H_TCPSTATE_ENUM
 #include <netinet/tcp.h>
 #else
-#error System must have TCP states defined in either tcp.h or tcp_fsm.h.
+#warning System doesn't have TCP states defined in either tcp.h or tcp_fsm.h; falling back to always returning unknown.
 #endif
 
 int32_t SystemNative_MapTcpState(int32_t tcpState)
@@ -66,6 +66,9 @@ int32_t SystemNative_MapTcpState(int32_t tcpState)
             return TcpState_Closing;
         default:
             return TcpState_Unknown;
+#else
+        default:
+            return TcpState_Unknown;
 #endif
     }
 }

#39

Hello all,

I also would be interested in Mono ported to Haiku. Mono, .NET SDK, .NET Runtime… Mostly because I use C# to code some Games in Unity 3d. I don’t expect Unity 3d ported in the near future, but I already asked on GitHub about porting VSCode, which first needs Electron to be ported, which first needs Chromium and Node.js to be ported.

These “feature requests” (getting VSCode and Electron versions for Haiku) were closed as no demand for such requests.

Checking the apps based on Electron, it looks appealing to get it on Haiku (Skype, GitHub Desktop, GitKraken, VSCode, Wordpress, Slack…)

So, forgive me if I am too naive to ask this but, has anyone asked Microsoft/Xamarin to help in any way to get Mono ported to Haiku?

Regards,
RR


#40

Electron is a lot of work. You’d need to port libuv, V8 and Node just to get Node working. You’d then need to port the entire Chromium stack, including graphics libraries. You’d then need to integrate the two together.

Libuv probably wouldn’t be too hard, but V8 probably would be.