about summary refs log tree commit diff
path: root/pkgs/development/tools/misc
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2017-06-23 17:45:27 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2017-06-30 10:09:31 -0400
commit95c8277701fb746ad4d91841de494ee869886991 (patch)
tree120ec8dad2d1a6d1c678f3d51778328f5ad2a110 /pkgs/development/tools/misc
parentd61c22341b00171b53697164cb8241184979d14c (diff)
downloadnixlib-95c8277701fb746ad4d91841de494ee869886991.tar
nixlib-95c8277701fb746ad4d91841de494ee869886991.tar.gz
nixlib-95c8277701fb746ad4d91841de494ee869886991.tar.bz2
nixlib-95c8277701fb746ad4d91841de494ee869886991.tar.lz
nixlib-95c8277701fb746ad4d91841de494ee869886991.tar.xz
nixlib-95c8277701fb746ad4d91841de494ee869886991.tar.zst
nixlib-95c8277701fb746ad4d91841de494ee869886991.zip
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.
Diffstat (limited to 'pkgs/development/tools/misc')
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix12
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix5
2 files changed, 13 insertions, 4 deletions
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 82eb7f77bb4c..ae58c72b786d 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -8,10 +8,13 @@ let
   version = "2.28";
   basename = "binutils-${version}";
   inherit (stdenv.lib) optional optionals optionalString;
+  # The prefix prepended to binary names to allow multiple binuntils on the
+  # PATH to both be usable.
+  prefix = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-";
 in
 
 stdenv.mkDerivation rec {
-  name = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-" + basename;
+  name = prefix + basename;
 
   src = fetchurl {
     url = "mirror://gnu/binutils/${basename}.tar.bz2";
@@ -78,15 +81,20 @@ stdenv.mkDerivation rec {
     then "-Wno-string-plus-int -Wno-deprecated-declarations"
     else "-static-libgcc";
 
+  # TODO(@Ericson2314): Always pass "--target" and always prefix.
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
   configureFlags =
     [ "--enable-shared" "--enable-deterministic-archives" "--disable-werror" ]
     ++ optional (stdenv.system == "mips64el-linux") "--enable-fix-loongson2f-nop"
-    ++ optional (targetPlatform != hostPlatform) "--target=${targetPlatform.config}" # TODO: make this unconditional
     ++ optionals gold [ "--enable-gold" "--enable-plugins" ]
     ++ optional (stdenv.system == "i686-linux") "--enable-targets=x86_64-linux-gnu";
 
   enableParallelBuilding = true;
 
+  passthru = {
+    inherit prefix;
+  };
+
   meta = with stdenv.lib; {
     description = "Tools for manipulating binaries (linker, assembler, etc.)";
     longDescription = ''
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 1e9cf910857c..78dd4a1e3f55 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -48,6 +48,9 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";
 
+  # TODO(@Ericson2314): Always pass "--target" and always prefix.
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+
   configureFlags = with stdenv.lib; [
     "--with-gmp=${gmp.dev}" "--with-mpfr=${mpfr.dev}" "--with-system-readline"
     "--with-system-zlib" "--with-expat" "--with-libexpat-prefix=${expat.dev}"
@@ -55,8 +58,6 @@ stdenv.mkDerivation rec {
       # TODO(@Ericson2314): make this conditional on whether host platform is NixOS
       "--with-separate-debug-dir=/run/current-system/sw/lib/debug"
     ++ stdenv.lib.optional (!pythonSupport) "--without-python"
-    # TODO(@Ericson2314): This should be done in stdenv, not per-package
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "--target=${targetPlatform.config}"
     ++ stdenv.lib.optional multitarget "--enable-targets=all";
 
   postInstall =