Change:
Describe the bug Cannot build Android 11 AOSP on nixos without source modification To Reproduce As android is huge to download, the following could take a few hours to process, and you will need a solid machine to build android. Steps to reproduce the behavior: android Android repository - :warning: This take a lot of time, you are about to download 100GB build - it :warning: to complete the build this require a good CPU with 16GB Ram and some space disk some build process if fail for linking issue to shared library. Expected behavior Build success Additional context Since I am on nix I use this to build android. But it no longer work on AOSP 11. This is the error that happen: This is caused by the android build system creating his own environment without . I didn't find any nix tips to have it working without modifying source, so I post this issue to indicate the fhs is no longer suffisant. Here is the dirty workaround that seems to work. I do not have encounter any issues yet. In following repo: Notify maintainers I have no idea who did the original FHS nor who trigger on this Metadata Maintainer information:
The Android build system (as of Android 11) now ignores certain environment variables by default, including . You can run before building to disable this behavior. Also, in case you aren't aware of it, can also be used to build AOSP using Nix.
I wasn't aware of this ninja option. Thanks ! It way cleaner than what i did. I will put it my android FHS, but it could be something nice to add to the example on nixos Wiki. Does someone know who trigger to do so ? I am aware of the Robotnix existence since i start searching for this issue, but i do not know how it work with local source tree, as I need to do heavy modification in multiple android repo(test it, build some debug code...). Is there any possibility with Robotnix to do something like this ?
Yeah, you're right that robotnix wouldn't help as much if you intend to do AOSP development (edit / test / debug cycles). It's most useful when you have something that works and want to allow end-users to easily build it using nix.
I didn't see the commit that change it, but wiki has been update. Thank you mysterious people :+1: He/She also add some other lines needed in new android build, that's nice ! I close this issue

Discussion:
<ins> { stdenv, fetchurl, jre }: let version = "2.7.1"; in stdenv.mkDerivation { name = "logisim-${version}"; src = fetchurl { url = "mirror://sourceforge/project/circuit/2.7.x/${version}/logisim-generic-${version}.jar"; sha256 = "1hkvc9zc7qmvjbl9579p84hw3n8wl3275246xlzj136i5b0phain"; }; phases = [ "installPhase" ]; installPhase = '' mkdir -pv $out/bin cp -v $src $out/logisim.jar cat > $out/bin/logisim << EOF #!${stdenv.shell} ${jre}/bin/java -jar $out/logisim.jar EOF chmod +x $out/bin/logisim ''; meta = { homepage = "http://ozark.hendrix.edu/~burch/logisim"; description = "Logisim is an educational tool for designing and simulating digital logic circuits."; license = "GPLv2+"; }; } </ins>

leo2 = callPackage ../applications/science/logic/leo2 {}; <ins> logisim = callPackage ../applications/science/logic/logisim {}; </ins> matita = callPackage ../applications/science/logic/matita { ocaml = ocaml_3_11_2; inherit (ocamlPackages_3_11_2) findlib lablgtk ocaml_expat gmetadom ocaml_http