Commit Graph

28 Commits

Author SHA1 Message Date
xeu
9c6c4891c7 androidenv.ndk-bundle: use ${package.path} instead of ndk/${package.revision}
For NDKs with `-rc*` like `30.0.14904198-rc1`, this avoids dangling
symlinks.
2026-05-05 20:01:26 +08:00
jappeace-sloth
b050c15a4a androidenv.ndk-bundle: use jdk_headless instead of jdk
ndk-build only needs java/javac, not GUI capabilities.
Switching to jdk_headless drops ~257 MB of unnecessary
desktop dependencies (GTK+3, icu4c, harfbuzz, cups, systemd)
from the closure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-08 14:02:44 +00:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Morgan Jones
3c13841124 androidenv: nixfmt 2025-03-29 22:13:03 +05:30
Morgan Jones
803aebe826 androidenv: support if-supported for include* options
This lets us stop hardcoding platforms and start filtering for which
archives have sources, which is the most accurate way to do it.

Tested on x86_64-linux, aarch64-linux, and aarch64-darwin.
2025-03-29 22:13:03 +05:30
Morgan Jones
fb25c379f4 androidenv: simplify updating and track latest
We can figure out the latest version for every package in mkrepo.rb,
instead of repeating ourselves in compose-android-packages.

Track the latest non-preview versions of all packages by default, and
remove version hardcoding everywhere. Enable the update script.
2025-03-29 22:13:03 +05:30
Hadi
d3f8c4d495 androidenv: upgradde to repository2-3
androidenv: apply numinit patch to have a nice error message

androidenv handle unsupported systems, and make tests running by default!

androidenv run nixfmt

androidenv: support emulator/systemimages/NDK only for certain systems

androidenv: apply nixfmt

androidenv: give a warning if archive doesn't exist
2025-02-20 11:33:43 +05:30
Reno Dakota
52bf1163fa treewide: use getLib when accessing clang / libclang / stdenv.cc.cc
In preparation to eliminate the lib output for the unwrapped clang, use
`lib.getLib` to access the `lib` output.
2024-11-07 10:27:41 +00:00
Artturin
e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00
Philipp Mildenberger
de0fdc1c78 androidenv: fix NDK toolchain linking issues
Fixes #298285, alternative to #300386.

As suggested in #298285 `lib64` was renamed to `lib`, so just doing the same
as for `lib64` seems to fix the issue.

See also recent discussion in #300386.
2024-05-21 00:08:09 +02:00
Morgan Jones
a10fada751 androidenv: update to latest 2024-04-09 20:10:14 -07:00
Jakub Sokołowski
93e9aac7dc androidenv: fix autopatching toolchains
Use of binaries from NDK `toolchains` has been broken by following PR:

* https://github.com/NixOS/nixpkgs/pull/195752

I'm splitting the patchInstructions to run the ELF patching only on Linux.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-14 16:12:13 +01:00
Jakub Sokołowski
af7c4c68bf androidenv: fix patching linux prebuilt binaries
This has been broken by following PR due to typo:
https://github.com/NixOS/nixpkgs/pull/195752

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2023-02-09 12:04:46 +01:00
Sheldon Neuberger
a5f4369130 androidenv: fix darwin ndk symlink
Today the nix ndk package on darwin points to a directory that doesn't
exist. This fix was added previously for linux but is needed on all
platforms.
2022-10-27 10:12:54 -07:00
Artturin
7e49471316 treewide: optional -> optionals where the argument is a list
the argument to optional should not be list
2022-10-10 15:40:21 +03:00
Van Tuan Vo
e8dfc2d72a androidenv: fix ndk linking for ndk < 23 2022-07-24 20:35:48 +02:00
Jari Vetoniemi
2408ef3c6f androidndk: remove legacy ndks
allows us to remove python2 dependencies and lot more
2022-06-29 18:27:16 +09:00
Jari Vetoniemi
5f1923d67e androidenv: fix android cross-compilers
These were completely broken. Even if they managed to output a binary,
it wouldn't actually run on the actual device.
2022-06-29 18:27:16 +09:00
Jakub Sokołowski
b0663a3dc3 androidenv: include autoPatchelfHook only on Linux
This is supposed to fix an issue caused by this PR:
https://github.com/NixOS/nixpkgs/pull/163924

Which made `autoPatchelfHook` available only on Linux, resulting in
builds of Android packages failing with:
```
error: Package ‘auto-patchelf-hook’ in /nix/store/...-nixpkgs-source/pkgs/build-support/trivial-builders.nix:73
    is not supported on ‘x86_64-darwin’, refusing to evaluate.
```

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-05-29 23:17:37 +02:00
Ryan Burns
15111f8a9a ndk-bundle: fix build
Since b79483d2b7,
the various architectures of the prebuilt libraries cause
errors, so we need to tell patchelf to ignore missing deps.
2021-11-19 23:37:11 -08:00
Rolf Schröder
c03f846b46 android: replace '$(pwd)' by '.' 2021-03-27 12:46:58 +01:00
Rolf Schröder
2985284ccb android: Fix shebangs in auto-generated android toolchain scripts
The script make_standalone_toolchain.py autogenerates some shell scripts
when invoked. These scripts have a hardcoded shebang of '#!/bin/bash'.
The generated scripts obviously do not work in a Nix environment. This
commit makes sure the scripts have the correct shebang.
2021-03-09 21:13:28 +01:00
numinit
5b91d4ab65 Rework androidenv package generation
androidenv did not previously write license files, which caused certain
gradle-based Android tools to fail. Restructure androidenv's list of
Android packages into a single repo.json file to prevent duplication
and enable us to extract the EULA texts, which we then hash with
builtins.hashString to produce the license files that Android gradle
tools look for.

Remove includeDocs and lldbVersions, as these have been removed
from the Android package repositories.

Improve documentation and examples.
2021-01-03 21:27:23 -07:00
John Ericson
452854a13c androidndk: Avoid depending on target-sensative openjdk
We just need jdk for this script that helps set up toolchains. The
script might need to know about the target platform, but the interpreter
that runs it (or part of it) doesn't.
2020-09-08 09:49:39 -04:00
Matthew Bauer
074bc78cc8 android: update sdk, ndk to 29, 21 2020-08-17 23:51:53 -05:00
edef
c89b2de425 androidenv: fix the $out/bin symlink for ndk-bundle 2019-05-24 02:32:14 +00:00
Sander van der Burg
074c7e99e0 Fix standalone generation script 2018-12-18 21:16:07 +01:00
Sander van der Burg
74750dc67d Replace androidenv by new implementation 2018-12-18 21:16:06 +01:00