Stardew Valley on Haiku

I ported Stardew Valley to Haiku.
This was easier than Vintage Story, I just had to replace all the bundled dlls with the equivalent from the system .net installation, and symlink a couple of system dlls.

cp /boot/home/.net/shared/Microsoft.NETCore.App/8.0.27/* ./game
mkdir -p /usr/lib
ln -s /system/lib/libroot.so /usr/lib/libSystem.dylib
rm game/libSDL2-2.0.0.dylib
ln -s /system/lib/libSDL2-2.0.so.0.3200.10 game/libSDL2-2.0.0.dylib
dotnet game/Stardew\ Valley.dll

I used my GOG copy of Stardew.


EDIT: Updated commands:

cp /boot/home/.net/shared/Microsoft.NETCore.App/8.0.*/* ./game/

sed -i s]/usr/lib/libSystem.dylib]/system/lib/./libroot.so]g MonoGame.Framework.dll

rm game/libSDL2-2.0.0.dylib

ln -s /system/lib/libSDL2-2.0.so.0.*.* game/libSDL2-2.0.0.dylib

dotnet game/Stardew\ Valley.dll
16 Likes

Wait… we have a .net port available?
And .net binaries are platform agnostic? Didn’t know that, that’s really cool :smiley:

Yes, and yes. I believe @trungnt2910 did the .net port. However .net binaries will sometimes call into native libraries, which need to be swapped out.

1 Like

Need to get my hands on that then, it’s the only thing that’s stopping an OpenRA port atm.

1 Like
1 Like

Work well. There is a little something that bother me, the sound does not register off the mixer when you quit the game (i may have made an error in installing?)

I have just noticed that the created /usr/lib seems to be temporary, and must be recreated on reboot. This calls for a better solution.
This is the error message when it is not present, it appears this happens within monogame, which is open source, so it could probably be patched out.

Unhandled exception. System.TypeInitializationException: The type initializer for 'Sdl' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library '/usr/lib/libSystem.dylib' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable: 
No such file or directory

   at MonoGame.Framework.Utilities.FuncLoader.OSX.dlopen(String path, Int32 flags)
   at MonoGame.Framework.Utilities.FuncLoader.LoadLibraryExt(String libname) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\MonoGame.Desktop\MonoGame.Framework\Platform\Utilities\FuncLoader.Desktop.cs:line 46
   at Sdl..cctor() in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\MonoGame.Desktop\MonoGame.Framework\Platform\SDL\SDL2.cs:line 14
   --- End of inner exception stack trace ---
   at Microsoft.Xna.Framework.SdlGamePlatform..ctor(Game game) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\MonoGame.Desktop\MonoGame.Framework\Platform\SDL\SDLGamePlatform.cs:line 36
   at Microsoft.Xna.Framework.Game..ctor() in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\MonoGame.Desktop\MonoGame.Framework\Game.cs:line 77
   at StardewValley.GameRunner..ctor() in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\LocalMultiplayer.cs:line 402
   at StardewValley.Program.Main(String[] args) in D:\GitlabRunner\builds\Gq5qA5P4\0\ConcernedApe\stardewvalley\Farmer\Farmer\Program.cs:line 208

I don’t see your mixer issue, in fact I don’t see stardew appear on the mixer at all, however I have my headphones plugged into the linux computer, so I cannot hear whether sound is actually playing.

Okay, I have a somewhat hacky, but very neat solution; replacing /usr/lib/libSystem.dylib with /system/lib/./libroot.so in MonoGame.Framework.dll.