nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 deployAndroidPackage,
3 lib,
4 stdenv,
5 package,
6 os,
7 arch,
8 autoPatchelfHook,
9 makeWrapper,
10 pkgs,
11 pkgsi686Linux,
12 postInstall,
13 meta,
14}:
15
16deployAndroidPackage {
17 inherit package os arch;
18 nativeBuildInputs = [ makeWrapper ] ++ lib.optionals (os == "linux") [ autoPatchelfHook ];
19 buildInputs =
20 lib.optionals (os == "linux") [
21 pkgs.glibc
22 pkgs.zlib
23 pkgs.ncurses5
24 pkgs.libcxx
25 ]
26 ++ lib.optionals (os == "linux" && stdenv.hostPlatform.isx86_64) (
27 with pkgsi686Linux;
28 [
29 glibc
30 zlib
31 ncurses5
32 ]
33 );
34 patchInstructions = ''
35 ${lib.optionalString (os == "linux") ''
36 addAutoPatchelfSearchPath $packageBaseDir/lib
37 if [[ -d $packageBaseDir/lib64 ]]; then
38 addAutoPatchelfSearchPath $packageBaseDir/lib64
39 autoPatchelf --no-recurse $packageBaseDir/lib64
40 fi
41 autoPatchelf --no-recurse $packageBaseDir
42 ''}
43
44 ${lib.optionalString (lib.toInt (lib.versions.major package.revision) < 33) ''
45 wrapProgram $PWD/mainDexClasses \
46 --prefix PATH : ${pkgs.jdk8}/bin
47 ''}
48
49 cd $out/libexec/android-sdk
50 ''
51 + postInstall;
52 noAuditTmpdir = true; # The checker script gets confused by the build-tools path that is incorrectly identified as a reference to /build
53
54 inherit meta;
55}