lol

Merge pull request #95309 from obsidiansystems/mobile-fixes

Support Android 29 in cross-compilation

authored by

Matthew Bauer and committed by
GitHub
d0e52b6b 14d80306

+84 -144
+2 -2
lib/systems/examples.nix
··· 46 46 47 47 armv7a-android-prebuilt = { 48 48 config = "armv7a-unknown-linux-androideabi"; 49 - sdkVer = "24"; 49 + sdkVer = "29"; 50 50 ndkVer = "18b"; 51 51 platform = platforms.armv7a-android; 52 52 useAndroidPrebuilt = true; ··· 54 54 55 55 aarch64-android-prebuilt = { 56 56 config = "aarch64-unknown-linux-android"; 57 - sdkVer = "24"; 57 + sdkVer = "29"; 58 58 ndkVer = "18b"; 59 59 platform = platforms.aarch64-multiplatform; 60 60 useAndroidPrebuilt = true;
+30
pkgs/development/androidndk-pkgs/default.nix
··· 30 30 androidndk = androidComposition.ndk-bundle; 31 31 targetAndroidndkPkgs = targetPackages.androidndkPkgs_18b; 32 32 }; 33 + 34 + "21" = 35 + let 36 + ndkVersion = "21.0.6113669"; 37 + 38 + buildAndroidComposition = buildPackages.buildPackages.androidenv.composeAndroidPackages { 39 + includeNDK = true; 40 + inherit ndkVersion; 41 + }; 42 + 43 + androidComposition = androidenv.composeAndroidPackages { 44 + includeNDK = true; 45 + inherit ndkVersion; 46 + }; 47 + in 48 + import ./androidndk-pkgs.nix { 49 + inherit (buildPackages) 50 + makeWrapper; 51 + inherit (pkgs) 52 + stdenv 53 + runCommand wrapBintoolsWith wrapCCWith; 54 + # buildPackages.foo rather than buildPackages.buildPackages.foo would work, 55 + # but for splicing messing up on infinite recursion for the variants we 56 + # *dont't* use. Using this workaround, but also making a test to ensure 57 + # these two really are the same. 58 + buildAndroidndk = buildAndroidComposition.ndk-bundle; 59 + androidndk = androidComposition.ndk-bundle; 60 + targetAndroidndkPkgs = targetPackages.androidndkPkgs_21; 61 + }; 62 + 33 63 }
+9 -2
pkgs/development/compilers/ghc/8.10.1.nix
··· 62 62 endif 63 63 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 64 64 INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} 65 - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 66 - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} 65 + '' 66 + # We only need to build stage1 on most cross-compilation because 67 + # we will be running the compiler on the native system. In some 68 + # situations, like native Musl compilation, we need the compiler 69 + # to actually link to our new Libc. The iOS simulator is a special 70 + # exception because we can’t actually run simulators binaries 71 + # ourselves. 72 + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 73 + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} 67 74 CrossCompilePrefix = ${targetPrefix} 68 75 HADDOCK_DOCS = NO 69 76 BUILD_SPHINX_HTML = NO
+9 -2
pkgs/development/compilers/ghc/8.6.5.nix
··· 59 59 endif 60 60 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 61 61 INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} 62 - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 63 - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} 62 + '' 63 + # We only need to build stage1 on most cross-compilation because 64 + # we will be running the compiler on the native system. In some 65 + # situations, like native Musl compilation, we need the compiler 66 + # to actually link to our new Libc. The iOS simulator is a special 67 + # exception because we can’t actually run simulators binaries 68 + # ourselves. 69 + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 70 + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} 64 71 CrossCompilePrefix = ${targetPrefix} 65 72 HADDOCK_DOCS = NO 66 73 BUILD_SPHINX_HTML = NO
+9 -2
pkgs/development/compilers/ghc/8.8.2.nix
··· 59 59 endif 60 60 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 61 61 INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} 62 - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 63 - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} 62 + '' 63 + # We only need to build stage1 on most cross-compilation because 64 + # we will be running the compiler on the native system. In some 65 + # situations, like native Musl compilation, we need the compiler 66 + # to actually link to our new Libc. The iOS simulator is a special 67 + # exception because we can’t actually run simulators binaries 68 + # ourselves. 69 + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 70 + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} 64 71 CrossCompilePrefix = ${targetPrefix} 65 72 HADDOCK_DOCS = NO 66 73 BUILD_SPHINX_HTML = NO
+9 -2
pkgs/development/compilers/ghc/8.8.3.nix
··· 62 62 endif 63 63 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 64 64 INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} 65 - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 66 - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} 65 + '' 66 + # We only need to build stage1 on most cross-compilation because 67 + # we will be running the compiler on the native system. In some 68 + # situations, like native Musl compilation, we need the compiler 69 + # to actually link to our new Libc. The iOS simulator is a special 70 + # exception because we can’t actually run simulators binaries 71 + # ourselves. 72 + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 73 + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} 67 74 CrossCompilePrefix = ${targetPrefix} 68 75 HADDOCK_DOCS = NO 69 76 BUILD_SPHINX_HTML = NO
+9 -2
pkgs/development/compilers/ghc/8.8.4.nix
··· 62 62 endif 63 63 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 64 64 INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} 65 - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 66 - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} 65 + '' 66 + # We only need to build stage1 on most cross-compilation because 67 + # we will be running the compiler on the native system. In some 68 + # situations, like native Musl compilation, we need the compiler 69 + # to actually link to our new Libc. The iOS simulator is a special 70 + # exception because we can’t actually run simulators binaries 71 + # ourselves. 72 + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 73 + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} 67 74 CrossCompilePrefix = ${targetPrefix} 68 75 HADDOCK_DOCS = NO 69 76 BUILD_SPHINX_HTML = NO
+1 -1
pkgs/development/compilers/ghc/head.nix
··· 69 69 DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} 70 70 BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"} 71 71 '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' 72 - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} 72 + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} 73 73 CrossCompilePrefix = ${targetPrefix} 74 74 HADDOCK_DOCS = NO 75 75 BUILD_SPHINX_HTML = NO
+1 -1
pkgs/development/mobile/androidenv/compose-android-packages.nix
··· 14 14 , lldbVersions ? [ ] 15 15 , cmakeVersions ? [ ] 16 16 , includeNDK ? false 17 - , ndkVersion ? "18.1.5063045" 17 + , ndkVersion ? "21.0.6113669" 18 18 , useGoogleAPIs ? false 19 19 , useGoogleTVAddOns ? false 20 20 , includeExtras ? []
-128
pkgs/development/mobile/androidenv/generated/addons.nix
··· 672 672 }; 673 673 674 674 675 - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { 676 - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; 677 - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; 678 - revision = "1"; 679 - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; 680 - archives = { 681 - 682 - all = fetchurl { 683 - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; 684 - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; 685 - }; 686 - 687 - }; 688 - }; 689 - 690 - 691 - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { 692 - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; 693 - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; 694 - revision = "1"; 695 - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; 696 - archives = { 697 - 698 - all = fetchurl { 699 - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; 700 - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; 701 - }; 702 - 703 - }; 704 - }; 705 - 706 - 707 - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { 708 - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; 709 - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; 710 - revision = "1"; 711 - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; 712 - archives = { 713 - 714 - all = fetchurl { 715 - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; 716 - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; 717 - }; 718 - 719 - }; 720 - }; 721 - 722 - 723 - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8" = { 724 - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha8"; 725 - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha8"; 726 - revision = "1"; 727 - displayName = "Solver for ConstraintLayout 1.0.0-alpha8"; 728 - archives = { 729 - 730 - all = fetchurl { 731 - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha8.zip"; 732 - sha1 = "cd13d16a8f0198c1d6040ec8b1d0d4e5bb7feb6a"; 733 - }; 734 - 735 - }; 736 - }; 737 - 738 - 739 675 "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8" = { 740 676 name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha8"; 741 677 path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha8"; ··· 890 826 all = fetchurl { 891 827 url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; 892 828 sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; 893 - }; 894 - 895 - }; 896 - }; 897 - 898 - 899 - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { 900 - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; 901 - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; 902 - revision = "1"; 903 - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; 904 - archives = { 905 - 906 - all = fetchurl { 907 - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; 908 - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; 909 - }; 910 - 911 - }; 912 - }; 913 - 914 - 915 - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { 916 - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; 917 - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; 918 - revision = "1"; 919 - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; 920 - archives = { 921 - 922 - all = fetchurl { 923 - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; 924 - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; 925 - }; 926 - 927 - }; 928 - }; 929 - 930 - 931 - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { 932 - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; 933 - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; 934 - revision = "1"; 935 - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; 936 - archives = { 937 - 938 - all = fetchurl { 939 - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; 940 - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; 941 - }; 942 - 943 - }; 944 - }; 945 - 946 - 947 - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha8" = { 948 - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha8"; 949 - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha8"; 950 - revision = "1"; 951 - displayName = "ConstraintLayout for Android 1.0.0-alpha8"; 952 - archives = { 953 - 954 - all = fetchurl { 955 - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha8.zip"; 956 - sha1 = "7912ba03b04831f918f523648f118c4ee4da7604"; 957 829 }; 958 830 959 831 };
+4 -2
pkgs/development/mobile/androidenv/ndk-bundle/default.nix
··· 7 7 inherit package os; 8 8 buildInputs = [ autoPatchelfHook makeWrapper pkgs.python2 ] 9 9 ++ lib.optional (os == "linux") [ pkgs.glibc pkgs.stdenv.cc.cc pkgs.ncurses5 pkgs.zlib pkgs.libcxx.out ]; 10 - patchInstructions = lib.optionalString (os == "linux") '' 10 + patchInstructions = lib.optionalString (os == "linux") ('' 11 11 patchShebangs . 12 12 13 + '' + lib.optionalString (builtins.compareVersions (lib.getVersion package) "21" > 0) '' 13 14 patch -p1 \ 14 15 --no-backup-if-mismatch < ${./make_standalone_toolchain.py_18.patch} 15 16 wrapProgram $(pwd)/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}" 17 + '' + '' 16 18 17 19 # TODO: allow this stuff 18 20 rm -rf docs tests ··· 46 48 do 47 49 ln -sf ../libexec/android-sdk/ndk-bundle/$i $out/bin/$i 48 50 done 49 - ''; 51 + ''); 50 52 noAuditTmpdir = true; # Audit script gets invoked by the build/ component in the path for the make standalone script 51 53 }
+1
pkgs/top-level/all-packages.nix
··· 1183 1183 1184 1184 androidndkPkgs = androidndkPkgs_18b; 1185 1185 androidndkPkgs_18b = (callPackage ../development/androidndk-pkgs {})."18b"; 1186 + androidndkPkgs_21 = (callPackage ../development/androidndk-pkgs {})."21"; 1186 1187 1187 1188 androidsdk_9_0 = androidenv.androidPkgs_9_0.androidsdk; 1188 1189