From 1c00a8afd710beb2800945252ebd4001850d691a Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 20 Feb 2018 21:27:57 -0500 Subject: [PATCH 1/3] libiberty, libbfd: Make hash less fickle These shouldn't respond to targetPlatform, but previously did. The reason is somewhat complex: they would rely on the sources of gcc and binutils, respectively, which *do* depend on the target platform. Obviously the source is the same in all cases, but when those packages are no longer preserved from bootstrapping stages their `src` attributes use a different fetchurl resulting in a changed hash. --- pkgs/development/libraries/libbfd/default.nix | 6 ++++-- pkgs/development/libraries/libiberty/default.nix | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix index 018239a3e778..ac508908e8f2 100644 --- a/pkgs/development/libraries/libbfd/default.nix +++ b/pkgs/development/libraries/libbfd/default.nix @@ -1,8 +1,10 @@ -{ stdenv -, fetchurl, fetchpatch, gnu-config, autoreconfHook264, bison, binutils-raw +{ stdenv, buildPackages +, fetchurl, fetchpatch, gnu-config, autoreconfHook264, bison , libiberty, zlib }: +let inherit (buildPackages.buildPackages) binutils-raw; in + stdenv.mkDerivation rec { name = "libbfd-${version}"; inherit (binutils-raw.bintools) version src; diff --git a/pkgs/development/libraries/libiberty/default.nix b/pkgs/development/libraries/libiberty/default.nix index 6608a3393b12..516e6bbbe88c 100644 --- a/pkgs/development/libraries/libiberty/default.nix +++ b/pkgs/development/libraries/libiberty/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, gcc, staticBuild ? false }: +{ stdenv, buildPackages, fetchurl, staticBuild ? false }: + +let inherit (buildPackages.buildPackages) gcc; in stdenv.mkDerivation rec { name = "libiberty-${gcc.cc.version}"; From fe5ae8b5507fb195346522c9a8f689b73a0d39ce Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 20 Feb 2018 21:34:29 -0500 Subject: [PATCH 2/3] androidenv: Clean up whitespace --- .../development/mobile/androidenv/default.nix | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pkgs/development/mobile/androidenv/default.nix b/pkgs/development/mobile/androidenv/default.nix index 470fb31b03b0..2e8b5d286aca 100644 --- a/pkgs/development/mobile/androidenv/default.nix +++ b/pkgs/development/mobile/androidenv/default.nix @@ -4,7 +4,7 @@ rec { platformTools = import ./platform-tools.nix { inherit (pkgs) stdenv fetchurl unzip zlib; }; - + buildTools = import ./build-tools.nix { inherit (pkgs) stdenv fetchurl unzip zlib file; stdenv_32bit = pkgs_i686.stdenv; @@ -12,11 +12,11 @@ rec { ncurses_32bit = pkgs_i686.ncurses5; ncurses = pkgs.ncurses5; }; - + support = import ./support.nix { inherit (pkgs) stdenv fetchurl unzip; }; - + supportRepository = import ./support-repository.nix { inherit (pkgs) stdenv fetchurl unzip; }; @@ -47,18 +47,18 @@ rec { inherit (pkgs) stdenv fetchurl unzip makeWrapper; inherit (pkgs) zlib glxinfo freetype fontconfig glib gtk2 atk mesa file alsaLib jdk coreutils libpulseaudio dbus; inherit (pkgs.xorg) libX11 libXext libXrender libxcb libXau libXdmcp libXtst xkeyboardconfig; - + inherit platformTools buildTools support supportRepository platforms sysimages addons sources includeSources; - + stdenv_32bit = pkgs_i686.stdenv; }; - + androidsdk_2_1 = androidsdk { platformVersions = [ "7" ]; abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_2_2 = androidsdk { platformVersions = [ "8" ]; abiVersions = [ "armeabi-v7a" ]; @@ -70,49 +70,49 @@ rec { abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_3_0 = androidsdk { platformVersions = [ "11" ]; abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_3_1 = androidsdk { platformVersions = [ "12" ]; abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_3_2 = androidsdk { platformVersions = [ "13" ]; abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_4_0 = androidsdk { platformVersions = [ "14" ]; abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_4_0_3 = androidsdk { platformVersions = [ "15" ]; abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_4_1 = androidsdk { platformVersions = [ "16" ]; abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_4_2 = androidsdk { platformVersions = [ "17" ]; abiVersions = [ "armeabi-v7a" ]; useGoogleAPIs = true; }; - + androidsdk_4_3 = androidsdk { platformVersions = [ "18" ]; abiVersions = [ "armeabi-v7a" "x86" ]; @@ -152,7 +152,7 @@ rec { useExtraSupportLibs = true; useGooglePlayServices = true; }; - + androidsdk_6_0 = androidsdk { platformVersions = [ "23" ]; abiVersions = [ "armeabi-v7a" "x86" "x86_64"]; @@ -224,12 +224,12 @@ rec { inherit (pkgs) coreutils file findutils gawk gnugrep gnused jdk which; inherit platformTools; }; - + buildApp = import ./build-app.nix { inherit (pkgs) stdenv jdk ant gnumake gawk file which; inherit androidsdk androidndk; }; - + emulateApp = import ./emulate-app.nix { inherit (pkgs) stdenv; inherit androidsdk; From 7748972763c7db9589a3b7dc1bca4f9b688009e6 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 20 Feb 2018 18:31:16 -0500 Subject: [PATCH 3/3] androidenv: Better platform conditionals --- .../mobile/androidenv/androidndk.nix | 2 +- .../mobile/androidenv/androidndk_r8e.nix | 2 +- .../development/mobile/androidenv/default.nix | 20 +++++++++++++------ .../mobile/androidenv/platform-tools.nix | 9 +++++++-- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/pkgs/development/mobile/androidenv/androidndk.nix b/pkgs/development/mobile/androidenv/androidndk.nix index 8ef58471d6a0..81ec5732b9a2 100644 --- a/pkgs/development/mobile/androidenv/androidndk.nix +++ b/pkgs/development/mobile/androidenv/androidndk.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { phases = "buildPhase"; - buildInputs = [ p7zip makeWrapper ]; + nativeBuildInputs = [ p7zip makeWrapper ]; buildCommand = let bin_path = "$out/bin"; diff --git a/pkgs/development/mobile/androidenv/androidndk_r8e.nix b/pkgs/development/mobile/androidenv/androidndk_r8e.nix index ccf22d6b9536..271a18e4ee06 100644 --- a/pkgs/development/mobile/androidenv/androidndk_r8e.nix +++ b/pkgs/development/mobile/androidenv/androidndk_r8e.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { phases = "buildPhase"; - buildInputs = [ makeWrapper ]; + nativeBuildInputs = [ makeWrapper ]; buildCommand = let bin_path = "$out/bin"; diff --git a/pkgs/development/mobile/androidenv/default.nix b/pkgs/development/mobile/androidenv/default.nix index 2e8b5d286aca..98531eeb069e 100644 --- a/pkgs/development/mobile/androidenv/default.nix +++ b/pkgs/development/mobile/androidenv/default.nix @@ -1,8 +1,10 @@ -{pkgs, pkgs_i686, includeSources ? true}: +{ buildPackages, pkgs, pkgs_i686, targetPackages +, includeSources ? true +}: rec { platformTools = import ./platform-tools.nix { - inherit (pkgs) stdenv fetchurl unzip zlib; + inherit buildPackages pkgs; }; buildTools = import ./build-tools.nix { @@ -214,14 +216,20 @@ rec { }; androidndk = import ./androidndk.nix { - inherit (pkgs) stdenv fetchurl zlib ncurses p7zip lib makeWrapper; - inherit (pkgs) coreutils file findutils gawk gnugrep gnused jdk which; + inherit (buildPackages) + p7zip makeWrapper; + inherit (pkgs) + stdenv fetchurl zlib ncurses lib + coreutils file findutils gawk gnugrep gnused jdk which; inherit platformTools; }; androidndk_r8e = import ./androidndk_r8e.nix { - inherit (pkgs) stdenv fetchurl zlib ncurses lib makeWrapper; - inherit (pkgs) coreutils file findutils gawk gnugrep gnused jdk which; + inherit (buildPackages) + makeWrapper; + inherit (pkgs) + stdenv fetchurl zlib ncurses lib + coreutils file findutils gawk gnugrep gnused jdk which; inherit platformTools; }; diff --git a/pkgs/development/mobile/androidenv/platform-tools.nix b/pkgs/development/mobile/androidenv/platform-tools.nix index fe75655c02bd..f5e579942846 100644 --- a/pkgs/development/mobile/androidenv/platform-tools.nix +++ b/pkgs/development/mobile/androidenv/platform-tools.nix @@ -1,4 +1,9 @@ -{stdenv, zlib, fetchurl, unzip}: +{ buildPackages, pkgs }: + +let + inherit (buildPackages) fetchurl unzip; + inherit (pkgs) stdenv zlib; +in stdenv.mkDerivation rec { version = "26.0.2"; @@ -42,5 +47,5 @@ stdenv.mkDerivation rec { done ''; - buildInputs = [ unzip ]; + nativeBuildInputs = [ unzip ]; }