WreckedAvent / slimCat

slimCat F-Chat Client
Other
27 stars 17 forks source link

Multiplatform support #401

Closed ghck-cmyk closed 8 years ago

ghck-cmyk commented 8 years ago

Hi. With recent official support of .NET/Mono on other platforms (Mac OS, Linux) by Microsoft, it would be great to add support for these platforms too.

I tried it and Bootstrap compiles ok (just install mono and then xbuild Bootstrap.csproj). With slimCat, I edited the csproj file a bit to start the compilation[1], but I ended with 193 errors like:

foo.cs(119,17): error CS0246: The type or namespace name `Bar' could not be found. Are you missing an assembly reference?

and

baz.cs(152,50): error CS0246: The type or namespace name `X' could not be found. Are you missing `Y' using directive?

I'm inexperienced w.r.t. C# and .NET programming (read: did a hello world once), so I'm not sure what is the issue. I only hope that this project is not using some Windows-only parts of .NET, if there are some - that would make the porting difficult. I will help with this as I can, though.

[1] The edit was to change <PreBuildEvent> into <PreBuildEvent Condition="'$(OS)' == 'Windows_NT' "> and adding a similar tag for != using posix shell commands. A cleaner alternative would be to use MSBuild tasks though: http://stackoverflow.com/a/35570384/1023519

For now, the changed code in slimCat.proj looks like:

     <PreBuildEvent Condition="'$(OS)' != 'Windows_NT'">
mkdir -p "$(TargetDir)Theme"
mkdir -p "$(TargetDir)lib"
mkdir -p "$(TargetDir)sounds"
mkdir -p "$(TargetDir)icons"
cp -r "$(ProjectDir)Theme/Theme.xaml" "$(TargetDir)Theme"
cp -r "$(ProjectDir)Theme/Colors.xaml" "$(TargetDir)Theme"
cp -r "$(ProjectDir)lib/"*.dll "$(TargetDir)lib"
cp -r "$(ProjectDir)catIcon.ico" "$(TargetDir)icons"
cp -r "$(ProjectDir)sounds/"* "$(TargetDir)sounds"
    </PreBuildEvent>
    <PreBuildEvent  Condition="'$(OS)' == 'Windows_NT' ">
cmd /x /c mkdir "$(TargetDir)Theme"
cmd /x /c mkdir "$(TargetDir)lib"
cmd /x /c mkdir "$(TargetDir)sounds"
cmd /x /c mkdir "$(TargetDir)icons"
xcopy "$(ProjectDir)Theme\Theme.xaml" "$(TargetDir)Theme" /c /i /d /y
xcopy "$(ProjectDir)Theme\Colors.xaml" "$(TargetDir)Theme"  /c /i /d /y
xcopy "$(ProjectDir)lib\*.dll" "$(TargetDir)lib" /c /i /d /y
xcopy "$(ProjectDir)Logs.lnk" "$(TargetDir)" /c /i /d /y
xcopy "$(ProjectDir)catIcon.ico" "$(TargetDir)icons" /c /i /d /y
xcopy "$(ProjectDir)sounds\*.*" "$(TargetDir)sounds" /c /i /d /y
    </PreBuildEvent>
WreckedAvent commented 8 years ago

.NET and mono are supported, but WPF, the main technology that slimCat uses, is not. WPF relies on DirectX, which is extremely unlikely to be ported cross-platform (but who knows anymore). Until these technologies move over, there's basically no chance of a proper cross-platform slimCat.

ghck-cmyk commented 8 years ago

Ah, all right then. I was afraid of this. So back to trying it in Wine...