Project

General

Profile

Feature #837

Replicant Native Development Kit (NDK) build and release

Added by Anonymous over 3 years ago. Updated 6 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Build system
Target version:
Start date:
02/20/2014
Due date:
% Done:

0%

Resolution:
Device:

Description

It is great to have the Replicant SDK available for download. However, to build some native apps, the NDK is required. Any chance the replicant project can publish a NDK built from replicant sources?


Related issues

Related to Issue #1787: Make Replicant 6.0 buildable on a GNU FSDG-compliant distribution New 04/09/2017
Related to Feature #1784: Integrate toolchain build in Android build system New 04/09/2017

History

#1 Updated by Paul Kocialkowski over 3 years ago

I am not going to work on that, but perhaps someone else will.
Let me know if you have hints or a patch that will help building the NDK from Replicant's sources (I am not sure it actually uses the Android paltform source code).

#2 Updated by Paul Kocialkowski over 3 years ago

I add that to the list of Tasks.

#3 Updated by Denis 'GNUtoo' Carikli almost 3 years ago

  • Assignee set to Paul Kocialkowski

#4 Updated by Denis 'GNUtoo' Carikli almost 3 years ago

  • Category set to 51
  • Target version set to 21

#5 Updated by Paul Kocialkowski almost 3 years ago

  • Target version changed from 21 to Any version

#6 Updated by Beuc Beuc over 2 years ago

Please review NDKBuild for a first working set of NDK build instructions :)

#7 Updated by Denis 'GNUtoo' Carikli almost 2 years ago

  • Category changed from 51 to Build system
  • Device set to Not device specific

#8 Updated by Paul Kocialkowski over 1 year ago

  • Tracker changed from Issue to Feature
  • Subject changed from Publish Native Development Kit (NDK) downloads? to Replicant Native Development Kit (NDK) build and release
  • Device deleted (Not device specific)

#9 Updated by Wolfgang Wiedmeyer 6 months ago

Thank you very much for documenting the NDK build! I didn't try to reproduce it, but I went over the wiki page. Windows shouldn't be a target, it's enough if it's possible to provide a zip for GNU/Linux systems, so no need to get this working.

I know that Ubuntu is the reference platform Google is using, but afaik it still contains non-free software, even when only installing a build environment. On the BuildDependenciesInstallation page, Ubuntu was removed some time ago and only FSDG-compliant distros and Debian are listed. I'm not sure if we should include build instructions for Ubuntu on the wiki or not. Maybe someone else can chime in on this. If it indeed only worked with Ubuntu and not Debian or Trisquel, then the instructions should stay, because they are needed then as documentation to get it working on other distros that don't ship non-free software in the main package repository.

It looks like the git clone links need to be updated as the Replicant source code hosting has changed (at least for the init with the manifest). I'm not working on Replicant 4.2 and I'm focusing on Replicant 6.0. Not sure if Paul will resume work for Replicant 4.2 and get a NDK ready for it. At least, I wouldn't hold my breadth for it! But it's definitely a good thing to at least have the build documented!

As for Replicant 6.0, I spent quite some time to get rid of prebuilt binaries in the source tree. Building a NDK from the Replicant 6.0 sources would likely require to readd prebuilt binaries and the NDK build scripts may clash with the changes I did to get a toolchain built from source. I assume that the NDK scripts use the prebuilt toolchain from Google to build a new one. I broke that chain and got the toolchain built using the compilers that come with the GNU/Linux distribution. It's still not perfect as some prebuilts are still in use.

I would consider it a step back if we would use the NDK build scripts for Replicant 6.0 if they would use the prebuilt toolchain. I think a full NDK isn't even necessary. It would probably be enough to offer a zip with the Android cross compilers and some tools that are usually not available on GNU/Linux systems. This could be combined with the archive idea I described as a temporary solution in #1787.

In general, I consider offering such a zip with build tools only a quick-and-dirty solution. The long-term solution is to get these tools packaged by GNU/Linux distributions.

#10 Updated by Beuc Beuc 6 months ago

Hi Wolfgang,

Yeah at the time I used Ubuntu first and waited when Paul asked to review, then I moved to the SDK where I worked with Trisquel (cf. BuildEnvironments).

The NDK releases are independent from the SDK, about a year ago I provided instructions for NDK 10 (on another website since nothing was moving here).
http://android-rebuilds.beuc.net/NDK_10/
with an automated build recipe:
https://gitlab.com/android-rebuilds/auto/tree/master/ndk-10e
with an Ubuntu base since I wanted to stay as close to the original as possible.
That can be used for porting to the Replicant branch.

Good job and tackling the prebuilts. Is there some documentation about your work?
I have some notes at http://android-rebuilds.beuc.net/Prebuilts/ but I remember the situation is a mess, with the prebuilt installation (headers...) being patched directly rather than having GCC rebuilt from source.

The NDK is more than cross-compilers and support tools, it also contains all the C-level API (e.g. access to EGL).
From your comment it seems to goal of the Replicant NDK is not well defined, for instance its level of compatibility with the official Android NDK.

Debian made some recent progress, see https://wiki.debian.org/AndroidTools, though for now coverage is minimal.
I'm not sure this will be enough to provide an environment that allow rebuilding a common F-Droid app.

#11 Updated by Wolfgang Wiedmeyer 6 months ago

  • Assignee deleted (Paul Kocialkowski)

#12 Updated by Wolfgang Wiedmeyer 6 months ago

Thanks for documenting the build! Your documentation was quite helpful when I started to figure out how to build the compilers from source.

I wrote about the toolchain (and prebuilts in general): Toolchain

Beuc Beuc wrote:

The NDK is more than cross-compilers and support tools, it also contains all the C-level API (e.g. access to EGL).
From your comment it seems to goal of the Replicant NDK is not well defined, for instance its level of compatibility with the official Android NDK.

Well, a zip with the cross-compilers and tools needed for #1787 would indeed not be a full NDK and wouldn't be compatible with the official NDK. But the question is if a full NDK with the C-level API is really needed. We already had some cases where someone wanted to start contributing by working on a specific implementation, e.g. support for a GPS chip, but they were alienated by the huge Replicant source code download and the disk space that is required. For these kind of contributions, having a rather small downloadable zip that includes the Android ARM cross-compiler toolchain among others would be a perfect way to get started on some HAL implementation. I'm only bringing this up because I fear that getting a full NDK build working with all the toolchain changes in Replicant 6.0 could be a lot of work. But if it's possible, a full NDK would obviously be better.

Debian made some recent progress, see https://wiki.debian.org/AndroidTools, though for now coverage is minimal.
I'm not sure this will be enough to provide an environment that allow rebuilding a common F-Droid app.

The recent blog post answers this.

It looks like the Debian Android Tools team will continue to focus on packaging parts that belong to the SDK. But still, it's worth it to also contact them and ask if they are interested to start packaging parts of the NDK. They were at least interested in packaging the Android ARM cross-compiler toolchain the last time this was brought up, but this was over a year ago.

Also available in: Atom PDF