Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Support for Desktop Platforms (Linux, Windows, macOS) #62

Open
felix-barz-brickmakers opened this issue Mar 25, 2021 · 8 comments
Open

Comments

@felix-barz-brickmakers
Copy link

No description provided.

@Sunbreak
Copy link

Interested to help. Could someone elaborate the usecase?

@felix-barz-brickmakers
Copy link
Author

felix-barz-brickmakers commented Mar 30, 2021

Well, the usecase is to simply be able to use this library for the desktop platforms, which are in beta now and will become stable soon. So, my personal usecase is to be able to develop a flutter app that needs encryption for all of the platforms.

More specificly, I found out that we already have a somewhat support for desktop: In lib/src/bindings/libsodium.dart The library can already be loaded on the desktop platforms. However, there are two things to improve here, so we can easily use the library on desktop:

  1. Make the path configurable. /usr/local/lib/libsodium.so might work for Ubuntu, but not for other distros. And someone might want to statically link or distribute the library with the final app. So a Sodium.setNativeLib("path/to/libsodium.so") or similar would be very nice.
  2. Distribute libsodium for desktop with the package, just like you do for Android/iOS. This should be easy for Windows and macOS but more complicated for linux. However, as long as we have Option 1, it is not really neccessary.

@Sunbreak
Copy link

More specificly, I found out that we already have a somewhat support for desktop: In lib/src/bindings/libsodium.dart The library can already be loaded on the desktop platforms.

https://github.com/firstfloorsoftware/flutter_sodium/tree/master/lib/src/bindings is code manually or generated?

  1. Distribute libsodium for desktop with the package, just like you do for Android/iOS. This should be easy for Windows and macOS but more complicated for linux. However, as long as we have Option 1, it is not really neccessary.

What about the architecture of https://github.com/woodemi/quick_usb?

  1. Make the path configurable. /usr/local/lib/libsodium.so might work for Ubuntu, but not for other distros. And someone might want to statically link or distribute the library with the final app. So a Sodium.setNativeLib("path/to/libsodium.so") or similar would be very nice.

Maybe a workaround woodemi/quick_usb#14 (comment) ?

@j0chn1
Copy link

j0chn1 commented Jan 12, 2022

If it is possible you could load the library with a relative path. I am not experience in this area. But I try to publish my app to flathub and have no access to /usr. The library is stored in /app/lib and could be found if linked dynamically.

@Ezwen
Copy link

Ezwen commented Jan 13, 2022

I confirm this is a problem for flatpaks.

@j0chn1
Copy link

j0chn1 commented Jan 13, 2022

Can we excpect any changes to this topic?
Would be nice to get an answer so we can decide to wait or find another solution.
Thank you!

@Skycoder42
Copy link

In lack of a better solution, I created my own sodium wrappers here: https://github.com/Skycoder42/libsodium_dart_bindings
They support all platforms (mobile, desktop and web), for dart and for flutter out of the box.

@j0chn1
Copy link

j0chn1 commented Jan 15, 2022

I just saw that flutter_sodium actually uses a dynamic call

DynamicLibrary.open("libsodium.so.23").

But the pub.dev plugin is not updated yet.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants