diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix index ca562d2e456..40e2b8fcefb 100644 --- a/lib/systems/examples.nix +++ b/lib/systems/examples.nix @@ -46,7 +46,7 @@ rec { armv7a-android-prebuilt = { config = "armv7a-unknown-linux-androideabi"; - sdkVer = "24"; + sdkVer = "29"; ndkVer = "18b"; platform = platforms.armv7a-android; useAndroidPrebuilt = true; @@ -54,7 +54,7 @@ rec { aarch64-android-prebuilt = { config = "aarch64-unknown-linux-android"; - sdkVer = "24"; + sdkVer = "29"; ndkVer = "18b"; platform = platforms.aarch64-multiplatform; useAndroidPrebuilt = true; diff --git a/pkgs/development/androidndk-pkgs/default.nix b/pkgs/development/androidndk-pkgs/default.nix index 7bb779d1d13..10819d49ed3 100644 --- a/pkgs/development/androidndk-pkgs/default.nix +++ b/pkgs/development/androidndk-pkgs/default.nix @@ -30,4 +30,34 @@ androidndk = androidComposition.ndk-bundle; targetAndroidndkPkgs = targetPackages.androidndkPkgs_18b; }; + + "21" = + let + ndkVersion = "21.0.6113669"; + + buildAndroidComposition = buildPackages.buildPackages.androidenv.composeAndroidPackages { + includeNDK = true; + inherit ndkVersion; + }; + + androidComposition = androidenv.composeAndroidPackages { + includeNDK = true; + inherit ndkVersion; + }; + in + import ./androidndk-pkgs.nix { + inherit (buildPackages) + makeWrapper; + inherit (pkgs) + stdenv + runCommand wrapBintoolsWith wrapCCWith; + # buildPackages.foo rather than buildPackages.buildPackages.foo would work, + # but for splicing messing up on infinite recursion for the variants we + # *dont't* use. Using this workaround, but also making a test to ensure + # these two really are the same. + buildAndroidndk = buildAndroidComposition.ndk-bundle; + androidndk = androidComposition.ndk-bundle; + targetAndroidndkPkgs = targetPackages.androidndkPkgs_21; + }; + } diff --git a/pkgs/development/compilers/ghc/8.10.1.nix b/pkgs/development/compilers/ghc/8.10.1.nix index 761681a1d4f..d3835d01e5a 100644 --- a/pkgs/development/compilers/ghc/8.10.1.nix +++ b/pkgs/development/compilers/ghc/8.10.1.nix @@ -62,8 +62,15 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/8.6.5.nix b/pkgs/development/compilers/ghc/8.6.5.nix index 06266556cf3..a5d2bb5c88d 100644 --- a/pkgs/development/compilers/ghc/8.6.5.nix +++ b/pkgs/development/compilers/ghc/8.6.5.nix @@ -59,8 +59,15 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/8.8.2.nix b/pkgs/development/compilers/ghc/8.8.2.nix index 35440a82607..371a369496e 100644 --- a/pkgs/development/compilers/ghc/8.8.2.nix +++ b/pkgs/development/compilers/ghc/8.8.2.nix @@ -59,8 +59,15 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/8.8.3.nix b/pkgs/development/compilers/ghc/8.8.3.nix index 821ac70a76d..e26eacca204 100644 --- a/pkgs/development/compilers/ghc/8.8.3.nix +++ b/pkgs/development/compilers/ghc/8.8.3.nix @@ -62,8 +62,15 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/8.8.4.nix b/pkgs/development/compilers/ghc/8.8.4.nix index 975a3ce1e2f..22a9e6e25f9 100644 --- a/pkgs/development/compilers/ghc/8.8.4.nix +++ b/pkgs/development/compilers/ghc/8.8.4.nix @@ -62,8 +62,15 @@ let endif DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"} - '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + '' + # We only need to build stage1 on most cross-compilation because + # we will be running the compiler on the native system. In some + # situations, like native Musl compilation, we need the compiler + # to actually link to our new Libc. The iOS simulator is a special + # exception because we can’t actually run simulators binaries + # ourselves. + + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix index 111843b781f..6f9f577743f 100644 --- a/pkgs/development/compilers/ghc/head.nix +++ b/pkgs/development/compilers/ghc/head.nix @@ -69,7 +69,7 @@ let DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"} BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"} '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) '' - Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"} + Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"} CrossCompilePrefix = ${targetPrefix} HADDOCK_DOCS = NO BUILD_SPHINX_HTML = NO diff --git a/pkgs/development/mobile/androidenv/compose-android-packages.nix b/pkgs/development/mobile/androidenv/compose-android-packages.nix index f98547011bd..1786aebae83 100644 --- a/pkgs/development/mobile/androidenv/compose-android-packages.nix +++ b/pkgs/development/mobile/androidenv/compose-android-packages.nix @@ -14,7 +14,7 @@ , lldbVersions ? [ ] , cmakeVersions ? [ ] , includeNDK ? false -, ndkVersion ? "18.1.5063045" +, ndkVersion ? "21.0.6113669" , useGoogleAPIs ? false , useGoogleTVAddOns ? false , includeExtras ? [] diff --git a/pkgs/development/mobile/androidenv/generated/addons.nix b/pkgs/development/mobile/androidenv/generated/addons.nix index 23a55595cce..231e5b8ea22 100644 --- a/pkgs/development/mobile/androidenv/generated/addons.nix +++ b/pkgs/development/mobile/androidenv/generated/addons.nix @@ -672,70 +672,6 @@ }; - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip"; - sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha8"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha8"; - revision = "1"; - displayName = "Solver for ConstraintLayout 1.0.0-alpha8"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha8.zip"; - sha1 = "cd13d16a8f0198c1d6040ec8b1d0d4e5bb7feb6a"; - }; - - }; - }; - - "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8" = { name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha8"; path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha8"; @@ -896,70 +832,6 @@ }; - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4"; - revision = "1"; - displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip"; - sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe"; - }; - - }; - }; - - - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha8" = { - name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha8"; - path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha8"; - revision = "1"; - displayName = "ConstraintLayout for Android 1.0.0-alpha8"; - archives = { - - all = fetchurl { - url = "https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha8.zip"; - sha1 = "7912ba03b04831f918f523648f118c4ee4da7604"; - }; - - }; - }; - - "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha8" = { name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha8"; path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha8"; diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix index b81fab1ed76..6bdb7181590 100644 --- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix +++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix @@ -7,12 +7,14 @@ deployAndroidPackage { inherit package os; buildInputs = [ autoPatchelfHook makeWrapper pkgs.python2 ] ++ lib.optional (os == "linux") [ pkgs.glibc pkgs.stdenv.cc.cc pkgs.ncurses5 pkgs.zlib pkgs.libcxx.out ]; - patchInstructions = lib.optionalString (os == "linux") '' + patchInstructions = lib.optionalString (os == "linux") ('' patchShebangs . + '' + lib.optionalString (builtins.compareVersions (lib.getVersion package) "21" > 0) '' patch -p1 \ --no-backup-if-mismatch < ${./make_standalone_toolchain.py_18.patch} wrapProgram $(pwd)/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}" + '' + '' # TODO: allow this stuff rm -rf docs tests @@ -46,6 +48,6 @@ deployAndroidPackage { do ln -sf ../libexec/android-sdk/ndk-bundle/$i $out/bin/$i done - ''; + ''); noAuditTmpdir = true; # Audit script gets invoked by the build/ component in the path for the make standalone script } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 02caffbfa83..c57a2ed6e0d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1183,6 +1183,7 @@ in androidndkPkgs = androidndkPkgs_18b; androidndkPkgs_18b = (callPackage ../development/androidndk-pkgs {})."18b"; + androidndkPkgs_21 = (callPackage ../development/androidndk-pkgs {})."21"; androidsdk_9_0 = androidenv.androidPkgs_9_0.androidsdk;