Commit Graph

304 Commits

Author SHA1 Message Date
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
Sigmanificient
63d05d989e pkgs/development: remove unused arguments 2024-08-03 17:18:20 +02:00
NAHO
a7cc1dcd68
treewide: fix broken 'nix.dev' URLs 2024-07-07 17:15:35 +02:00
Pol Dellaiera
4b2ef8f2f0
Merge pull request #315233 from numinit/android-studio-full
android-studio-full: init
2024-06-16 08:35:21 +02:00
Travis A. Everett
9ff9bbdb34
doc: add stdenv passthru chapter (#315909)
* doc: add stdenv passthru chapter

Broad strokes:
- create the chapter
- move existing stdenv passthru coverage into it
- move out-of-place coverage of passthru.tests from the stdenv meta chapter into it
- (try to) apply 1-sentence-per-line to text I've touched
- add legacy anchors for everything moved
- update existing links to the new anchors
- add tentative motivating text
- make nixpkgs-internal links relative/branchless

razor: if it is only ever needed by contributors, which is likely if links
refer to the latest revision of the source code, then it's for
the contributor guide

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
2024-06-11 10:51:03 +02:00
Morgan Jones
88ef7a8598
{android-studio,androidenv}: add withSdk passthru and androidPkgs
Rename androidPkgs_9_0 to androidPkgs, and treat it more like a "full"
androidenv package.
2024-06-03 23:01:44 -07: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
Sandro
01ec8ad898
Merge pull request #304716 from asyncmeow/fix-compose-android-packages
androidenv: fix compose-android-packages on non-x86_64 environments
2024-04-18 13:02:15 +02:00
pearl
0e2402e288 androidenv: fix compose-android-packages on non-x86_64 environments
This has always been possible, however the nix package previously checked against stdenv.system with only x86_64 architectures used.
2024-04-16 23:55:15 -04:00
Morgan Jones
a10fada751
androidenv: update to latest 2024-04-09 20:10:14 -07:00
Hadi
3f00b40fff
androidenv: don't include emulator when includeEmulator is false 2024-01-22 19:04:40 -05:00
Hadi
da977da39e
androidenv: fix bugs, add new arguments, and deprecate arguments
- Fix the bug in #265479
- New arguments:
  - configOptions
  - deviceName
- Deprecate arguments:
  - enableGPU
2023-12-15 16:20:39 -05:00
Morgan Jones
1809b32877 androidenv: updates for Android API 34 2023-11-05 14:31:44 +01:00
Artturi
2816671186
Merge pull request #230344 from hadilq/androidenv-remove-avd-list-target 2023-09-08 22:18:36 +03:00
Artturi
bd0a150fdf
Merge pull request #224415 from SomeoneSerge/androidenv-buildApp-fix 2023-09-08 17:54:49 +03:00
Someone Serge
5cedb097a0 androidenv.buildApp: fix after callPackage switch
builtins.functionArgs doesn't work with (callPackage composeAndroidPackages { .. })
2023-09-08 16:30:56 +03:00
Nick Cao
dbf5978a61
Merge pull request #248435 from hadilq/androidenv-fix-cmdline-beta-version
androidenv fix cmdline beta versions' problem
2023-08-13 00:25:14 -06:00
Hadi
430200fe06
androidenv update packages 2023-08-10 20:27:06 -04:00
Hadi
7c005a7b69
androidenv fix cmdline beta versions' problem 2023-08-10 20:09:15 -04:00
Hadi
9f959e7154 androidenv: rename android sdk package name 2023-05-23 08:16:20 +02:00
Hadi
3310972785
androidenv: update repo.json with a new strategy to expire 2023-05-12 18:33:46 -04:00
Hadi
6bf3ef3935
androidenv: remove avdmanager list target 2023-05-06 10:11:09 -04:00
Hadi
077588ad1a
androidenv: put a much nicer error message that includes the available options 2023-04-22 14:47:45 -04:00
Hadi
81f75f9569 androidenv: fix libgcc_s.so.1 -> not found 2023-04-18 20:18:13 +03:00
K900
61fd82abeb adb: fix libgcc_s reference 2023-04-10 08:45:51 +03:00
Sandro
7ecf5641d3
Merge pull request #216142 from status-im/androidenv/fix-toolchains 2023-04-01 23:51:19 +02:00
Hadi
a05928d7fe androidenv: make nix-build -A androidenv.test-suite work
androidenv: set config.allowUnfree = true for integration tests

androidenv: fix concerns in the PR
2023-02-28 08:53:43 -05:00
Hadi
d511bfd0e2 androidenv: add shell-with-emulator.nix to have test and more examples
androidenv: replace buildInputs with nativeBuildInputs
2023-02-28 08:53:43 -05:00
Hadi
e5fbfd894f androidenv: fix problem with avdmanager when trying to create an avd
To do so, we gathered different system images with the same
abiVersion in the same derivation.
2023-02-28 08:53:43 -05:00
Felix Buehler
bc3d5934d7 treewide: use lib.optionals 2023-02-14 19:11:59 +01: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
Artturi
bf9433fd4c
Merge pull request #210372 from hadilq/androidenv/generate-package.xml-files
androidenv: generate package.xml in packages' directory
2023-01-29 18:12:52 +02:00
Hadi
9c4e43ab70 androidenv: Implement cmdline-tools and patcher
- Replace cmdline-tools with tools because tools is obsolete now.
- Depend emulator package to systemImages

androidenv: fix issues on the PR

androidenv: reformat

androidenv: support excluding of `tools` package

androidenv: provide `tools`, and `build-tools`, dependencies

androidenv: replace includeTools with toolsVersion

androidenv: fix a typo

androidenv: add tests to check licenses and installed packages

androidenv: check if tests are running! this commit should fail!

androidenv: fix problems in the review https://github.com/NixOS/nixpkgs/pull/208793

androidenv: add test-suite to handle more tests around

androidenv: fix the test after couldn't running them with ofborg

Update pkgs/development/mobile/androidenv/build-tools.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

androidenv: Resolving https://github.com/NixOS/nixpkgs/pull/208793#discussion_r1065851539

Update pkgs/development/mobile/androidenv/cmdline-tools.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

Update pkgs/development/mobile/androidenv/tools.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

androidenv: fix a typo
2023-01-27 18:15:47 -05:00
Hadi
181e0e91ba androidenv: generate package.xml in packages' directory 2023-01-12 10:19:11 -05:00
Hadi
8ca4470a5e androidenv: use unzip in nativeBuildInputs 2023-01-03 18:17:11 -05:00
Hadi
2f06edee4f
Update pkgs/development/mobile/androidenv/deploy-androidpackages.nix
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
2023-01-03 11:05:57 -05:00
Hadi
d1a1f2fa06 androidenv: Fix we are using 2 spaces to intend nix code in
see: https://github.com/NixOS/nixpkgs/pull/208137#discussion_r1059518929
2022-12-31 12:21:21 -05:00
Hadi
bceccb7f70 androidenv: Replace deploy-androidpackage.nix with deploy-androidpackages.nix 2022-12-31 11:21:40 -05:00
Artturi
338097c04c
Merge pull request #208300 from hadilq/androidenv/fix-system-image-download-url-for-default-type 2022-12-30 15:48:07 +02:00
Hadi
6fd11aec99 androidenv: Fix system image download url for default type 2022-12-30 15:30:27 +02:00
Hadi
2f688374e0
androidenv: fix missing packages in repo json (#208137) 2022-12-30 15:28:12 +02:00
jakobkukla
14c7a30161 androidenv: fix missing inherit os 2022-12-20 04:28:20 +01:00
jakobkukla
8851f074f8 androidenv: fix non-existent emulatorVersion 2022-12-20 04:28:20 +01:00
Vanilla
32c1e7d7db
androidenv: fix missing inherit os in build-tools 2022-12-17 13:21:54 +08:00
Artturi
f9b2c36a7f
Merge pull request #205701 from Artturin/deprecatereplacechars
lib.replaceChars: warn about being a deprecated alias
2022-12-15 23:46:51 +02:00
Artturin
05a2dfd674 lib.replaceChars: warn about being a deprecated alias
replaceStrings has been in nix since 2015(nix 1.10)

so it is safe to remove the fallback

d6d5885c15
2022-12-15 22:25:51 +02:00
Artturin
a2f85e0fa8 androidenv: use callPackage instead of import & fix infinite recursion
infinite recursion was due to autoPatchelfHook being in buildInputs of
platform-tools, i will add a lint for it in nix-community/nixpkgs-lint.

```
$ nix build ".#pkgsCross.aarch64-android-prebuilt.hello" --show-trace 2>&1 | rg 'while evaluating the attr.+deriv'
    … while evaluating the attribute 'stdenv' of the derivation 'zlib-aarch64-unknown-linux-android-1.2.13'
    … while evaluating the attribute 'CPPFLAGS' of the derivation 'python3-aarch64-unknown-linux-android-3.10.8'
    … while evaluating the attribute 'setuptools' of the derivation 'python-catch-conflicts-hook'
    … while evaluating the attribute 'nativeBuildInputs' of the derivation 'python3.10-pyelftools-0.28'
    … while evaluating the attribute 'passAsFile' of the derivation 'python3-3.10.8-env'
    … while evaluating the attribute 'pythonInterpreter' of the derivation 'auto-patchelf-hook'
    … while evaluating the attribute 'buildInputs' of the derivation 'platform-tools-33.0.2'
    … while evaluating the attribute 'installPhase' of the derivation 'ndk-24.0.8215888'
    … while evaluating the attribute 'installPhase' of the derivation 'aarch64-unknown-linux-android-ndk-toolchain-24.0.8215888'
    … while evaluating the attribute 'bintools_bin' of the derivation 'aarch64-unknown-linux-android-ndk-toolchain-wrapper-24.0.8215888'
    … while evaluating the attribute 'bintools' of the derivation 'aarch64-unknown-linux-android-ndk-toolchain-wrapper-24.0.8215888'
    … while evaluating the attribute 'defaultNativeBuildInputs' of the derivation 'stdenv-linux'
    … while evaluating the attribute 'stdenv' of the derivation 'hello-aarch64-unknown-linux-android-2.12.1'
```

stdenv -> stdenv.cc -> bintools -> android-ndk-toolchain -> ndk -> platform-tools -> auto-patchelf-hook -> python3 -> zlib -> stdenv -> stdenv.cc -> ...

autoPatchelfHook was in buildInputs of platform-tools so we needed the host tools to build
it but platform-tools was a required tool
2022-12-15 21:55:22 +02:00
Léo Gaspard
ad25aa1098
androidenv: use emulator from the path that makes it find qemu (#202088) 2022-12-06 21:16:49 +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