From 95c8277701fb746ad4d91841de494ee869886991 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 23 Jun 2017 17:45:27 -0400 Subject: misc pkgs: Remove unneeded *Platform == *Platform comparisons PR #26007 used these to avoid causing a mass rebuild. Now that we know things work, we do that to clean up. --- pkgs/os-specific/darwin/binutils/default.nix | 13 +++++++++---- pkgs/os-specific/darwin/cctools/port.nix | 15 +++++++++------ pkgs/os-specific/linux/busybox/default.nix | 6 +----- 3 files changed, 19 insertions(+), 15 deletions(-) (limited to 'pkgs/os-specific') diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix index f88f761f65a3..933e7558dbbf 100644 --- a/pkgs/os-specific/darwin/binutils/default.nix +++ b/pkgs/os-specific/darwin/binutils/default.nix @@ -2,11 +2,12 @@ , hostPlatform, targetPlatform }: -let - prefix = stdenv.lib.optionalString - (targetPlatform != hostPlatform) - "${targetPlatform.config}-"; +# Make sure both underlying packages claim to have prepended their binaries +# with the same prefix. +assert binutils-raw.prefix == cctools.prefix; +let + inherit (binutils-raw) prefix; cmds = [ "ar" "ranlib" "as" "dsymutil" "install_name_tool" "ld" "strip" "otool" "lipo" "nm" "strings" "size" @@ -50,4 +51,8 @@ stdenv.mkDerivation { ln -s ${cctools}/libexec $out/libexec ''; + + passthru = { + inherit prefix; + }; } diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix index 222c51603fdd..9fdb00d66be9 100644 --- a/pkgs/os-specific/darwin/cctools/port.nix +++ b/pkgs/os-specific/darwin/cctools/port.nix @@ -1,10 +1,12 @@ { stdenv, fetchFromGitHub, makeWrapper, autoconf, automake, libtool_2 , llvm, libcxx, libcxxabi, clang, libuuid , libobjc ? null, maloader ? null, xctoolchain ? null -, buildPlatform, hostPlatform, targetPlatform +, hostPlatform, targetPlatform }: let + # The prefix prepended to binary names to allow multiple binuntils on the + # PATH to both be usable. prefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-"; @@ -38,13 +40,10 @@ let enableParallelBuilding = true; + # TODO(@Ericson2314): Always pass "--target" and always prefix. + configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target"; configureFlags = stdenv.lib.optionals (!stdenv.isDarwin) [ "CXXFLAGS=-I${libcxx}/include/c++/v1" - ] ++ stdenv.lib.optionals (targetPlatform != buildPlatform) [ - # TODO make unconditional next hash break - "--build=${buildPlatform.config}" - "--host=${hostPlatform.config}" - "--target=${targetPlatform.config}" ]; postPatch = '' @@ -104,6 +103,10 @@ let done ''; + passthru = { + inherit prefix; + }; + meta = { homepage = "http://www.opensource.apple.com/source/cctools/"; description = "Mac OS X Compiler Tools (cross-platform port)"; diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index e1ea8fa8fdd2..815e2e0f6ef6 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -63,7 +63,7 @@ stdenv.mkDerivation rec { CONFIG_DEFAULT_SETFONT_DIR "/etc/kbd" ${extraConfig} - $extraCrossConfig + CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cc.prefix}" EOF make oldconfig @@ -79,10 +79,6 @@ stdenv.mkDerivation rec { buildInputs = lib.optionals (enableStatic && !useMusl) [ stdenv.cc.libc stdenv.cc.libc.static ]; - extraCrossConfig = if hostPlatform == buildPlatform then null else '' - CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cc.prefix}" - ''; - enableParallelBuilding = true; meta = with stdenv.lib; { -- cgit 1.4.1