danipen / TextMateSharp

A port of tm4e to bring TextMate grammars to dotnet ecosystem
MIT License
87 stars 15 forks source link

Support for arm32 and arm64 #40

Open alexandrehtrb opened 1 year ago

alexandrehtrb commented 1 year ago

Hello,

First, thanks for this project!

I am using TextMateSharp through AvaloniaEdit.TextMate project and I would like to have support for arm and arm64.

I do not have an arm machine to test it, but the onigwrap.dll seem to be missing when I compile for win-arm64, although it appears for win-x64.

I would like support for the following .NET target runtimes:

linux-arm64 osx-x64 osx-arm64 win-arm win-arm64

Does it work on arm machines?

danipen commented 1 year ago

Hi. ARM is only supported in macos at this moment. Supporting arm on win/Linux should be straightforward just compiling onigwrap for those archs. A PR for that would be welcome.

EdWordy commented 11 months ago

Does this mean that android isn't supported? I have an Avalonia app that I'm building for android and TextMate doesn't seem to run without throwing any specific errors and I'm guessing it isn't supported but I was unsure.

danipen commented 11 months ago

Yes that's it. Adding the missing target archs for the native assemblies should fix the issue.

EdWordy commented 11 months ago

I see, what file type that would that be then for android? I'm not sure where to get started for compiling for android to be honest haha.

danipen commented 11 months ago

There are some instructions here: https://github.com/danipen/TextMateSharp/tree/master/onigwrap

EdWordy commented 11 months ago

I built a file using the docker image here: https://github.com/sjitech/android-gcc-toolchain

I think I've been able to package it into a nuGet package using the textmatesharp source, but I'm unsure of how to link it against the existing code and subsequently the avalonia android builds I've been trying all night have failed.

However I'm hardpressed to continue to try, as I started a summer project to build an IDE for android (one that runs on android) and syntax highlighting is a necessity.

alexandrehtrb commented 11 months ago

I think that the oniguruma .dlls / .so could be compiled using a GitHub Actions workflow, for each target runtime, including arm.

GitHub Actions machines are x64, but I believe that they can compile for ARM without problem.

(I don't have an ARM machine to test whether AvaloniaEdit on ARM would work flawlessly)

EdWordy commented 10 months ago

I've tried rebuilding with arm-none-eabi-gcc to no avail. I don't know if I'm building textmatesharp properly with the new native libraries after but I'm unable to get android to find the files afterwards and instead get a:

[monodroid assembly]: Shared library 'onigwrap' not loaded, p/invoke 'onigwrap_create' may fail

danipen commented 7 months ago

I think that the oniguruma .dlls / .so could be compiled using a GitHub Actions workflow, for each target runtime, including arm.

Absolutely! Building oniguruma/onigwrap DLLs are a nightmare right now. A PR for that would be more than welcome!