-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native npm module node-sodium cross compiled to Android #880
Comments
Have you tried the Emscripten port already? I tried compiling the node-sodium directly in Termux app on Android by typing |
I have not tried libsodium.js port yet. Performance is a concern but getting it working would definitely be a great step forward. Thanks for that. It would still be good to know the best practices for getting npm modules with native code cross compiled. |
I see. I'd also like to know how to do it, but remember that active development for jxcore has sadly been discontinued by Nubisa. If we're lucky, node.js folks will eventually land an officially supported version in the future, which at the moment lacks. There is already some discussion about it on their repo. |
@lamuertepeluda yes, we are currently using the emscripten port, but it's a lot slower. |
Which engine you've been using with JXcore? If it was v8 3.14 you may follow leveldown-mobile approach without actually converting V8 API to JXcore macro. |
I will continue down that path using v8. Thanks @obastemur |
What is the best approach for getting an npm module with native code cross compiled for use on Android?
We are trying to get the npm module node-sodium into the runtime for use within and Android application. The problem is when doing an
npm install
from the host machine and then compiling jxcore with the android-ndk the npm module is compiled for the host platform's architecture. (e.g. jxcore is compiled for ARM while the npm native code is compiled for x86)Should we compile the library directly into the jxcore runtime and port the javascript to work from that level? Should we update the npm module to look for an ARCH environment variable and cross compile for Android? Does jxcore for android support shared libraries as such?
I have been having trouble finding a similar example except for leveldown which is why I started porting libsodium into the jxcore runtime. It would be good to hear from someone with higher level view of the architecture if this is the appropriate approach.
Thank you,
Gardner
The text was updated successfully, but these errors were encountered: