From 222524b5e687c0ceb87f4fdc396306a9d5295ffe Mon Sep 17 00:00:00 2001
From: Daiderd Jordan <daiderd@gmail.com>
Date: Sun, 24 Jun 2018 14:59:18 +0200
Subject: [PATCH] gfortran: fix darwin build on hydra

All the warnings about unused -isystem arguments causes the build log to
exceed the hydra limit.
---
 pkgs/development/compilers/gcc/7/default.nix | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index fab9b8fe745..d671743ee62 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -254,6 +254,9 @@ stdenv.mkDerivation ({
     ++ (optional hostPlatform.isDarwin targetPackages.stdenv.cc.bintools)
     ;
 
+  # TODO: Use optionalString with next rebuild.
+  ${if (stdenv.cc.isClang && langFortran) then "NIX_CFLAGS_COMPILE" else null} = "-Wno-unused-command-line-argument";
+
   NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
   preConfigure = stdenv.lib.optionalString (hostPlatform.isSunOS && hostPlatform.is64bit) ''