From ae0c9b626f5d66fb400a915a4c9c2d12dfd24fcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Mon, 13 Jan 2014 21:38:44 +0100 Subject: [PATCH] llvm: add 3.4, urge for versioned usage The 3.4 code was tested preliminary in x-updates, described by 2e4eab1228. Updates to llvm break builds of dependent packages (in all cases I've seen), and often upstream isn't too fast in porting to the newest version. Consequently, it seems better to keep more versions (two ATM), both in one file to share eventual changes. Also, using versioned llvm_* attributes is proposed because of this. --- pkgs/development/compilers/llvm/default.nix | 17 +++++++++++------ pkgs/top-level/all-packages.nix | 5 ++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix index bed6bf1fc13..7ef7adfa324 100644 --- a/pkgs/development/compilers/llvm/default.nix +++ b/pkgs/development/compilers/llvm/default.nix @@ -1,17 +1,21 @@ -{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils_gold }: +{ stdenv, fetchurl, perl, groff, cmake, python, libffi, binutils_gold, version }: -let version = "3.3"; in +with { inherit (stdenv.lib) optional; }; + +assert version == "3.4" || version == "3.3"; stdenv.mkDerivation rec { name = "llvm-${version}"; src = fetchurl { url = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz"; - sha256 = "0y3mfbb5qzcpw3v5qncn69x1hdrrrfirgs82ypi2annhf0g6nxk8"; + sha256 = + if version == "3.4" then "0a169ba045r4apb9cv6ncrwl83l7yiajnzirkcdlhj1cd4nn3995" + else /*3.3*/ "0y3mfbb5qzcpw3v5qncn69x1hdrrrfirgs82ypi2annhf0g6nxk8"; }; # The default rlimits are too low for shared libraries. - patches = [ ./more-memory-for-bugpoint.patch ]; + patches = optional (version == "3.3") [ ./more-memory-for-bugpoint.patch ]; # libffi was propagated before, but it wasn't even being used, so # unless something needs it just an input is fine. @@ -25,8 +29,9 @@ stdenv.mkDerivation rec { "-DCMAKE_BUILD_TYPE=Release" "-DLLVM_ENABLE_FFI=ON" "-DLLVM_BINUTILS_INCDIR=${binutils_gold}/include" - "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=R600" # for mesa - ] ++ lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON"; + ] + ++ optional (version == "3.3") "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=R600" # for mesa + ++ optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON"; enableParallelBuilding = true; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c7d86057fb4..0a0ac731cd7 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2903,11 +2903,14 @@ let lessc = callPackage ../development/compilers/lessc { }; - llvm = callPackage ../development/compilers/llvm { + llvm = llvm_33; # deprecated, depend on llvm_* directly + llvm_34 = callPackage ../development/compilers/llvm { + version = "3.4"; stdenv = if stdenv.isDarwin then stdenvAdapters.overrideGCC stdenv gccApple else stdenv; }; + llvm_33 = llvm_34.override { version = "3.3"; }; mentorToolchains = recurseIntoAttrs ( callPackage_i686 ../development/compilers/mentor {}