JetBrains / skija

Java bindings for Skia
Apache License 2.0
2.63k stars 127 forks source link

Configurable native library loading strategy? #148

Closed Glavo closed 1 year ago

Glavo commented 2 years ago

I noticed that skija was hardcoding the supported platforms and forcing to extract and load native libraries from known platform jars.

This is frustrating to me, and I hope that skija can improve the way that native libraries are loaded, making it more flexible for users to provide native libraries.

This is my idea:

These are my suggestions, what do you think? I can get the job done if that's acceptable.

tonsky commented 2 years ago

I’m not opposed to the idea, but could you elaborate how do you see it working for users? If we start supporting new platforms, isn’t it better to contribute them to upstream?

Glavo commented 2 years ago

I’m not opposed to the idea, but could you elaborate how do you see it working for users? If we start supporting new platforms, isn’t it better to contribute them to upstream?

It would really be best if support for all platforms could be provided upstream. However, I guess this is not an easy thing to do.

For the above reasons, I think it is reasonable for upstream to only provide support for popular platforms.

tonsky commented 2 years ago

So what are you suggesting? Check java.library.path for dll/so/dylib before extracting in Library.java?

Glavo commented 1 year ago

https://github.com/HumbleUI/Skija/releases/tag/0.109.1