From 6fe628b99a5e45561162fe1ece368ee6c367ab81 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Thu, 5 Aug 2010 13:21:29 +0000
Subject: [PATCH] * Indentation fixes.

svn path=/nixpkgs/branches/stdenv-updates/; revision=22961
---
 .../development/compilers/gcc-4.5/default.nix | 99 ++++++++++---------
 .../libraries/cloog-ppl/default.nix           | 17 ++--
 2 files changed, 61 insertions(+), 55 deletions(-)

diff --git a/pkgs/development/compilers/gcc-4.5/default.nix b/pkgs/development/compilers/gcc-4.5/default.nix
index b5a5d20f501c..c1e3d3a402a3 100644
--- a/pkgs/development/compilers/gcc-4.5/default.nix
+++ b/pkgs/development/compilers/gcc-4.5/default.nix
@@ -183,6 +183,7 @@ stdenv.mkDerivation ({
 
   buildNativeInputs = [ texinfo which ]
     ++ optional (perl != null) perl;
+    
   buildInputs = [ gmp mpfr mpc libelf gettext ]
     ++ (optional (ppl != null) ppl)
     ++ (optional (cloogppl != null) cloogppl)
@@ -241,50 +242,50 @@ stdenv.mkDerivation ({
 
   targetConfig = if (cross != null) then cross.config else null;
 
-   crossAttrs = {
-     AR = "${stdenv.cross.config}-ar";
-     LD = "${stdenv.cross.config}-ld";
-     CC = "${stdenv.cross.config}-gcc";
-     CXX = "${stdenv.cross.config}-gcc";
-     AR_FOR_TARGET = "${stdenv.cross.config}-ar";
-     LD_FOR_TARGET = "${stdenv.cross.config}-ld";
-     CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
-     NM_FOR_TARGET = "${stdenv.cross.config}-nm";
-     CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
-     # If we are making a cross compiler, cross != null
-     NIX_GCC_CROSS = if cross == null then "${stdenv.gccCross}" else "";
-     dontStrip = true;
-     configureFlags = "
-       ${if enableMultilib then "" else "--disable-multilib"}
-       ${if enableShared then "" else "--disable-shared"}
-       ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-       ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
-       ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
-       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-       ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-       --with-gmp=${gmp.hostDrv}
-       --with-mpfr=${mpfr.hostDrv}
-       --disable-libstdcxx-pch
-       --without-included-gettext
-       --with-system-zlib
-       --enable-languages=${
-         concatStrings (intersperse ","
-           (  optional langC        "c"
-           ++ optional langCC       "c++"
-           ++ optional langFortran  "fortran"
-           ++ optional langJava     "java"
-           ++ optional langTreelang "treelang"
-           ++ optional langAda      "ada"
-           ++ optional langVhdl     "vhdl"
-           )
-         )
-       }
-       ${if langAda then " --enable-libada" else ""}
-       ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
-       ${if cross != null then crossConfigureFlags else ""}
-       --target=${stdenv.cross.config}
-     ";
-   };
+  crossAttrs = {
+    AR = "${stdenv.cross.config}-ar";
+    LD = "${stdenv.cross.config}-ld";
+    CC = "${stdenv.cross.config}-gcc";
+    CXX = "${stdenv.cross.config}-gcc";
+    AR_FOR_TARGET = "${stdenv.cross.config}-ar";
+    LD_FOR_TARGET = "${stdenv.cross.config}-ld";
+    CC_FOR_TARGET = "${stdenv.cross.config}-gcc";
+    NM_FOR_TARGET = "${stdenv.cross.config}-nm";
+    CXX_FOR_TARGET = "${stdenv.cross.config}-g++";
+    # If we are making a cross compiler, cross != null
+    NIX_GCC_CROSS = if cross == null then "${stdenv.gccCross}" else "";
+    dontStrip = true;
+    configureFlags = ''
+      ${if enableMultilib then "" else "--disable-multilib"}
+      ${if enableShared then "" else "--disable-shared"}
+      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
+      ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
+      --with-gmp=${gmp.hostDrv}
+      --with-mpfr=${mpfr.hostDrv}
+      --disable-libstdcxx-pch
+      --without-included-gettext
+      --with-system-zlib
+      --enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langTreelang "treelang"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          )
+        )
+      }
+      ${if langAda then " --enable-libada" else ""}
+      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+      ${if cross != null then crossConfigureFlags else ""}
+      --target=${stdenv.cross.config}
+    '';
+  };
  
 
   # Needed for the cross compilation to work
@@ -368,11 +369,13 @@ stdenv.mkDerivation ({
     platforms = stdenv.lib.platforms.linux ++ optionals (langAda == false) [ "i686-darwin" ];
   };
 }
-// (if cross != null && cross.libc == "msvcrt" && crossStageStatic then rec {
+
+// optionalAttrs (cross != null && cross.libc == "msvcrt" && crossStageStatic) {
   makeFlags = [ "all-gcc" "all-target-libgcc" ];
   installTargets = "install-gcc install-target-libgcc";
-} else {})
-// (if langVhdl then rec {
+}
+
+// optionalAttrs langVhdl rec {
   name = "ghdl-0.29";
 
   ghdlSrc = fetchurl {
@@ -405,4 +408,4 @@ stdenv.mkDerivation ({
     platforms = with stdenv.lib.platforms; linux;
   };
 
-} else {}))
+})
diff --git a/pkgs/development/libraries/cloog-ppl/default.nix b/pkgs/development/libraries/cloog-ppl/default.nix
index 0919afd83c27..ca662d30eb0f 100644
--- a/pkgs/development/libraries/cloog-ppl/default.nix
+++ b/pkgs/development/libraries/cloog-ppl/default.nix
@@ -1,13 +1,16 @@
 { fetchurl, stdenv, ppl, static ? false }:
 
-
 let
-    # --with-host-libstdcxx helps when *ppl* is built statically.
-    # But I will suppose that this is statically built only when ppl is also
-    # statically built.
-    staticFlags = assert static -> ppl.dontDisableStatic == true;
-        if static then " --enable-static --disable-shared --with-host-libstdcxx=-lstdc++" else "";
+
+  # --with-host-libstdcxx helps when *ppl* is built statically.
+  # But I will suppose that this is statically built only when ppl is also
+  # statically built.
+  staticFlags =
+    assert static -> ppl.dontDisableStatic == true;
+    if static then " --enable-static --disable-shared --with-host-libstdcxx=-lstdc++" else "";
+    
 in
+
 stdenv.mkDerivation rec {
   name = "cloog-ppl-0.15.9";
 
@@ -22,7 +25,7 @@ stdenv.mkDerivation rec {
   dontDisableStatic = if static then true else false;
 
   crossAttrs = {
-      configureFlags = "--with-ppl=${ppl.hostDrv}" + staticFlags;
+    configureFlags = "--with-ppl=${ppl.hostDrv}" + staticFlags;
   };
 
   doCheck = true;