nixpkgs/pkgs/development/mobile/androidenv/cmake.nix
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

11 lines
400 B
Nix

{deployAndroidPackage, lib, package, os, autoPatchelfHook, pkgs, stdenv}:
deployAndroidPackage {
inherit package os;
nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
buildInputs = lib.optional (os == "linux") [ pkgs.stdenv.cc.libc pkgs.stdenv.cc.cc pkgs.ncurses5 ];
patchInstructions = lib.optionalString (os == "linux") ''
autoPatchelf $packageBaseDir/bin
'';
}