Open alexamiryan opened 4 years ago
You can use the build_libsodium.sh
script from my fork: https://github.com/MuntashirAkon/lazysodium-android
It'll build the libsodium.so
files and move them to the corresponding ABI directories inside jniLibs. You can edit the jni_dir
inside the script to copy them anywhere you want. I've also used -j
command for make which will use all the available CPUs to build the binaries which takes about 2 minutes on my device.
Usage:
./build_libsodium.sh ndk_path [api]
api
is set to 21 if not given.
NB: It will only build for arm-v7a, arm-v8a, x86, x86_64 because latest NDK only supports these variants.
Hi @alexamiryan and @MuntashirAkon,
I had been contacted a few months back for a similar thing. In fact, I am increasingly seeing F-Droid mentioned. Do you know if it would be worthwhile to have a script inside Lazysodium to build sources from scratch?
I had been contacted a few months back for a similar thing. In fact, I am increasingly seeing F-Droid mentioned. Do you know if it would be worthwhile to have a script inside Lazysodium to build sources from scratch?
I've implemented it on my repo already (but modified it a bit for my own use). I can make a PR with just this modification if you're interested. It takes less than 2 minutes to build libsodium on my 7 gen i3 dual core (4 threads) processor with 8 GB RAM. On JitPack, it takes less than a minute.
Can F-Droid invoke it's own build steps? Something like ./gradlew f-droid-build
?
I don't want to rebuild libsodium binaries over and over again because:
I don't want to rebuild libsodium binaries over and over again because:
- I'd like to keep testing time low.
You don't have to build it over and over again. If you're using CI, you can cache the binaries and put a check in the build script (already done in my repo). Same can be done in other cases as well. F-Droid never cache anything. So, they'll simply rebuild it instead.
- It adds extra complexity.
No, it doesn't. You'll simply need a script (which I've already done on my end) and two tasks in the build.gradle: one for building the binaries and the other for cleaning up the binaries.
Thank you for the advice. OK, let me see if this can be integrated.
@MuntashirAkon do I have permission to use and/or modify your script here? https://github.com/MuntashirAkon/lazysodium-android/blob/master/build_libsodium.sh
do I have permission to use and/or modify your script here? https://github.com/MuntashirAkon/lazysodium-android/blob/master/build_libsodium.sh
Sure! Just add a credit line at the top of the file (should be MPL-2.0 dated 28 Oct 2020).
Is there any update? The repository still seems to be using non-free binaries/blobs. If you cannot manage the time, maybe I can help.
Hello. I am founder and main dev of Stingle Photos (https://github.com/stingle/stingle-photos-android). We want to publish Stingle Photos on F-Droid and as you know their requirement is that everything should be built from sources on their side, no precompiled binaries allowed. I am struggling to build a CI script for F-Droid to compile LazySodium from scratch. Is there any chance you guys had similar experience and can help me with that?
Thanks in advance.