quiet / org.quietmodem.Quiet

Quiet for Android - TCP over sound
1.43k stars 125 forks source link

Build native libaries #3

Open alexbirkett opened 7 years ago

alexbirkett commented 7 years ago

Is it possible to build the NDK code as part of the build process rather than just including the pre-built binaries?

brian-armstrong commented 7 years ago

Maybe - it's a fairly involved process. I decided to include the JNI source since that's specific to this repo but bundle the binaries for everything else.

The script that produces the binaries is https://github.com/quiet/quiet-scripts/blob/master/build-android.sh but it requires some changes that I haven't pushed yet. I'm going to wrap that up and push what's left in the next few days.

ItsShadowCone commented 6 years ago

This should not be too hard at all. Any updates on the script?

brian-armstrong commented 6 years ago

I made some good progress on this recently. Previously this required building the NDK's standalone toolchains. Now I'm close to a build that doesn't require those. Once it's ready, I'll remove the static libs and just have it built alongside the library. It hasn't been a high priority for me though.

Is this something you'd like to see? I know shipping and using blobs isn't awesome.

ItsShadowCone commented 6 years ago

When I implemented a really similar thing in zstd it was as simple as adding two instructions to the cmake file to include the library for compilation plus adding a line to the Java part to load it (you probably already have that).

I might look at it, not sure yet.

brian-armstrong commented 6 years ago

Before the unified headers, building was pretty complicated. The configure phase for libquiet's dependencies needed to be massaged carefully depending on the arch and API version targeted. Now it looks like this isn't needed, thankfully, but it's still somewhat fragile and bespoken. Still won't be as simple as adding a couple lines since the dependencies have to be built in a specific order. Also, one of the deps needs a CMakeLists.txt since it currently only builds with Make.

aringot commented 6 years ago

@brian-armstrong , I would also be interested. It is not so straightforward to understand how all the components are interlinked, and being able to debug through the tests would really help ! Thanks !