Author: raskin
Date: Wed Aug  3 08:38:34 2011
New Revision: 28133
URL: https://svn.nixos.org/websvn/nix/?rev=28133&sc=1

Log:
Missing files

Added:
   nixpkgs/trunk/pkgs/development/compilers/llvm/clang-include-paths-svn.patch
   nixpkgs/trunk/pkgs/development/compilers/llvm/svn-head.nix
Modified:
   nixpkgs/trunk/pkgs/top-level/all-packages.nix

Added: 
nixpkgs/trunk/pkgs/development/compilers/llvm/clang-include-paths-svn.patch
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixpkgs/trunk/pkgs/development/compilers/llvm/clang-include-paths-svn.patch 
Wed Aug  3 08:38:34 2011        (r28133)
@@ -0,0 +1,40 @@
+diff -ru -x '*~' a/tools/clang/lib/Frontend/InitHeaderSearch.cpp 
b/tools/clang/lib/Frontend/InitHeaderSearch.cpp
+--- a/tools/clang/lib/Frontend/InitHeaderSearch.cpp    2010-09-03 
18:45:53.000000000 +0200
++++ b/tools/clang/lib/Frontend/InitHeaderSearch.cpp    2011-02-05 
14:59:08.669573190 +0100
+@@ -480,6 +480,7 @@
+       AddPath(*i, System, false, false, false);
+     return;
+   }
+ 
++#if 0
+   switch (os) {
+   case llvm::Triple::Win32: {
+@@ -593,7 +593,9 @@
+   }
+ 
+   if ( os != llvm::Triple::RTEMS )
+     AddPath("/usr/include", System, false, false, false);
++#endif
++  AddPath(C_INCLUDE_PATH, System, false, false, false);
+ }
+ 
+ void InitHeaderSearch::
+@@ -550,6 +553,7 @@
+                                   triple);
+     return;
+   }
++#if 0  
+   // FIXME: temporary hack: hard-coded paths.
+ 
+   if (triple.isOSDarwin()) {
+@@ -769,6 +773,10 @@
+   default:
+     break;
+   }
++#endif
++  AddGnuCPlusPlusIncludePaths(
++      CPP_INCLUDE_PATH,
++      CPP_HOST, "", "", triple);
+ }
+ 
+ void InitHeaderSearch::AddDefaultSystemIncludePaths(const LangOptions &Lang,

Added: nixpkgs/trunk/pkgs/development/compilers/llvm/svn-head.nix
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ nixpkgs/trunk/pkgs/development/compilers/llvm/svn-head.nix  Wed Aug  3 
08:38:34 2011        (r28133)
@@ -0,0 +1,66 @@
+{ stdenv, fetchurl, gcc, flex, perl, libtool, groff, fetchsvn
+, buildClang ? false }:
+
+let rev =  "134309"; in
+stdenv.mkDerivation ({
+  name = "llvm-r${rev}";
+  
+  src = fetchsvn {
+    url    = "http://llvm.org/svn/llvm-project/llvm/trunk";;
+    inherit rev;
+    sha256 = "136qwpcl22r5bl9y4kk94vgbha1m58xrggy7qw19lg7jkgxxj8s6";
+  };
+
+  buildInputs = [ gcc flex perl groff ];
+
+  configureFlags = [ "--enable-optimized" "--enable-shared" "--disable-static" 
];
+
+  meta = {
+    homepage = http://llvm.org/;
+    description = "Collection of modular and reusable compiler and toolchain 
technologies";
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; all;
+  };
+}
+// stdenv.lib.optionalAttrs buildClang (
+  # I write the assert because 'gcc.libc' will be evaluated although 'triplet' 
would not
+  # evaluate properly (in the preConfigure below)
+  assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+  let
+    triplet = if (stdenv.system == "i686-linux") then "i686-unknown-linux-gnu"
+              else if (stdenv.system == "x86_64-linux") then 
"x86_64-unknown-linux-gnu"
+              else throw "System not supported";
+  in rec {
+    name = "clang-r${rev}";
+
+    srcClang = fetchsvn {
+      url = http://llvm.org/svn/llvm-project/cfe/trunk;
+      inherit rev;
+      sha256 = "0afbrjakfw6zgsplxblgzr2kwjndlnr2lnqjnbj16ggam5fcnhlr";
+    };
+
+    prePatch = ''
+      cp -r ${srcClang} tools/clang
+      chmod u+rwX -R tools/clang
+    '';
+
+    patches = [ ./clang-include-paths-svn.patch ];
+
+    # Set up the header file paths
+    preConfigure = ''
+      sed -i -e 's,C_INCLUDE_PATH,"${gcc.libc}/include/",' \
+        -e 's,CPP_HOST,"${triplet}",' \
+        -e 's,CPP_INCLUDE_PATH,"${gcc.gcc}/include/c++/${gcc.gcc.version}",' \
+        tools/clang/lib/Frontend/InitHeaderSearch.cpp
+    '';
+
+    meta = {
+      homepage = http://clang.llvm.org/;
+      description = "A C language family frontend for LLVM";
+      license = "BSD";
+      maintainers = with stdenv.lib.maintainers; [viric];
+      platforms = with stdenv.lib.platforms; linux;
+    };
+  }
+))

Modified: nixpkgs/trunk/pkgs/top-level/all-packages.nix
==============================================================================
--- nixpkgs/trunk/pkgs/top-level/all-packages.nix       Wed Aug  3 07:49:21 
2011        (r28132)
+++ nixpkgs/trunk/pkgs/top-level/all-packages.nix       Wed Aug  3 08:38:34 
2011        (r28133)
@@ -2170,6 +2170,8 @@
   };
 
   llvm = callPackage ../development/compilers/llvm { };
+
+  # Works partially
   llvmSVN = callPackage ../development/compilers/llvm/svn-head.nix { };
 
   mitscheme = callPackage ../development/compilers/mit-scheme { };
_______________________________________________
nix-commits mailing list
nix-comm...@cs.uu.nl
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to