Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4964392e487a
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5fd27509cf48
Choose a head ref
  • 6 commits
  • 7 files changed
  • 1 contributor

Commits on Sep 7, 2020

  1. cc-wrapper: Fix for prebuilt android

    We don't want to use Nix-built GCC's libs with prebuilt clang in this
    case.
    Ericson2314 committed Sep 7, 2020
    Copy the full SHA
    204dc3a View commit details

Commits on Sep 8, 2020

  1. Copy the full SHA
    4c489b5 View commit details
  2. androidndkPkgs: Take version from underlying package

    We can now do this, so let's.
    Ericson2314 committed Sep 8, 2020
    Copy the full SHA
    7cac79b View commit details
  3. lib.systems.examples: Bump android SDK to 21

    074bc78 evidently meant to do this, but
    forgot.
    Ericson2314 committed Sep 8, 2020
    Copy the full SHA
    e2bef8f View commit details
  4. androidndk: Avoid depending on target-sensative openjdk

    We just need jdk for this script that helps set up toolchains. The
    script might need to know about the target platform, but the interpreter
    that runs it (or part of it) doesn't.
    Ericson2314 committed Sep 8, 2020
    Copy the full SHA
    452854a View commit details

Commits on Sep 9, 2020

  1. Merge pull request #97387 from Ericson2314/fix-android-prebuilt

    cc-wrapper: Fix for prebuilt android
    Ericson2314 authored Sep 9, 2020
    Copy the full SHA
    5fd2750 View commit details
4 changes: 2 additions & 2 deletions lib/systems/examples.nix
Original file line number Diff line number Diff line change
@@ -47,15 +47,15 @@ rec {
armv7a-android-prebuilt = {
config = "armv7a-unknown-linux-androideabi";
sdkVer = "29";
ndkVer = "18b";
ndkVer = "21";
platform = platforms.armv7a-android;
useAndroidPrebuilt = true;
};

aarch64-android-prebuilt = {
config = "aarch64-unknown-linux-android";
sdkVer = "29";
ndkVer = "18b";
ndkVer = "21";
platform = platforms.aarch64-multiplatform;
useAndroidPrebuilt = true;
};
12 changes: 9 additions & 3 deletions pkgs/build-support/cc-wrapper/default.nix
Original file line number Diff line number Diff line change
@@ -61,6 +61,12 @@ let
then import ../expand-response-params { inherit (buildPackages) stdenv; }
else "";

useGccForLibs = isClang
&& libcxx == null
&& !(stdenv.targetPlatform.useLLVM or false)
&& !(stdenv.targetPlatform.useAndroidPrebuilt or false)
&& gccForLibs != null;

# older compilers (for example bootstrap's GCC 5) fail with -march=too-modern-cpu
isGccArchSupported = arch:
if isGNU then
@@ -272,7 +278,7 @@ stdenv.mkDerivation {
##
## GCC libs for non-GCC support
##
+ optionalString (isClang && libcxx == null && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs != null) ''
+ optionalString useGccForLibs ''
echo "-B${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-cflags
echo "-L${gccForLibs}/lib/gcc/${targetPlatform.config}/${gccForLibs.version}" >> $out/nix-support/cc-ldflags
@@ -316,11 +322,11 @@ stdenv.mkDerivation {

# We have a libc++ directly, we have one via "smuggled" GCC, or we have one
# bundled with the C compiler because it is GCC
+ optionalString (libcxx != null || (isClang && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs.langCC or false) || (isGNU && cc.langCC or false)) ''
+ optionalString (libcxx != null || (useGccForLibs && gccForLibs.langCC or false) || (isGNU && cc.langCC or false)) ''
touch "$out/nix-support/libcxx-cxxflags"
touch "$out/nix-support/libcxx-ldflags"
''
+ optionalString (libcxx == null && (isClang && !(stdenv.targetPlatform.useLLVM or false) && gccForLibs.langCC or false)) ''
+ optionalString (libcxx == null && (useGccForLibs && gccForLibs.langCC or false)) ''
for dir in ${gccForLibs}/include/c++/*; do
echo "-isystem $dir" >> $out/nix-support/libcxx-cxxflags
done
4 changes: 3 additions & 1 deletion pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
Original file line number Diff line number Diff line change
@@ -53,7 +53,9 @@ in

rec {
# Misc tools
binaries = runCommand "ndk-gcc-binutils" {
binaries = runCommand "ndk-toolchain-binutils" {
pname = "ndk-toolchain-binutils";
inherit (androidndk) version;
isClang = true; # clang based cc, but bintools ld
nativeBuildInputs = [ makeWrapper ];
propagatedBuildInputs = [ androidndk ];
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{requireFile, autoPatchelfHook, pkgs, pkgs_i686, licenseAccepted ? false}:
{requireFile, autoPatchelfHook, pkgs, pkgsHostHost, pkgs_i686, licenseAccepted ? false}:

{ toolsVersion ? "25.2.5"
, platformToolsVersion ? "29.0.6"
@@ -144,7 +144,7 @@ rec {
) cmakeVersions;

ndk-bundle = import ./ndk-bundle {
inherit deployAndroidPackage os autoPatchelfHook makeWrapper pkgs lib platform-tools;
inherit deployAndroidPackage os autoPatchelfHook makeWrapper pkgs pkgsHostHost lib platform-tools;
package = packages.ndk-bundle.${ndkVersion};
};

4 changes: 2 additions & 2 deletions pkgs/development/mobile/androidenv/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{ config, pkgs ? import <nixpkgs> {}
{ config, pkgs ? import <nixpkgs> {}, pkgsHostHost ? pkgs.pkgsHostHost
, pkgs_i686 ? import <nixpkgs> { system = "i686-linux"; }
, licenseAccepted ? config.android_sdk.accept_license or false
}:

rec {
composeAndroidPackages = import ./compose-android-packages.nix {
inherit (pkgs) requireFile autoPatchelfHook;
inherit pkgs pkgs_i686 licenseAccepted;
inherit pkgs pkgsHostHost pkgs_i686 licenseAccepted;
};

buildApp = import ./build-app.nix {
3 changes: 2 additions & 1 deletion pkgs/development/mobile/androidenv/deploy-androidpackage.nix
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ let
extraParams = removeAttrs args [ "package" "os" "buildInputs" "patchInstructions" ];
in
stdenv.mkDerivation ({
name = package.name + "-" + package.revision;
pname = package.name;
version = package.revision;
src = if os != null && builtins.hasAttr os package.archives then package.archives.${os} else package.archives.all;
buildInputs = [ unzip ] ++ buildInputs;
preferLocalBuild = true;
8 changes: 6 additions & 2 deletions pkgs/development/mobile/androidenv/ndk-bundle/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{deployAndroidPackage, lib, package, os, autoPatchelfHook, makeWrapper, pkgs, platform-tools}:
{ lib, pkgs, pkgsHostHost, makeWrapper, autoPatchelfHook
, deployAndroidPackage, package, os, platform-tools
}:

let
runtime_paths = lib.makeBinPath [ pkgs.coreutils pkgs.file pkgs.findutils pkgs.gawk pkgs.gnugrep pkgs.gnused pkgs.jdk pkgs.python3 pkgs.which ] + ":${platform-tools}/platform-tools";
runtime_paths = lib.makeBinPath (with pkgsHostHost; [
coreutils file findutils gawk gnugrep gnused jdk python3 which
]) + ":${platform-tools}/platform-tools";
in
deployAndroidPackage {
inherit package os;