From a5aedafbd9819880aa27c455345cfa7c26a68424 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Sun, 19 Feb 2017 14:33:47 -0600 Subject: [PATCH] llvm-4.0: Distinguish release version, fix naming to clarify rc2. --- .../development/compilers/llvm/4.0/clang/default.nix | 4 ++-- pkgs/development/compilers/llvm/4.0/default.nix | 12 ++++++------ pkgs/development/compilers/llvm/4.0/llvm.nix | 5 +++-- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pkgs/development/compilers/llvm/4.0/clang/default.nix b/pkgs/development/compilers/llvm/4.0/clang/default.nix index d482f91cb83a..f566cd6d21c2 100644 --- a/pkgs/development/compilers/llvm/4.0/clang/default.nix +++ b/pkgs/development/compilers/llvm/4.0/clang/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, clang-tools-extra_src, python }: +{ stdenv, fetch, cmake, libxml2, libedit, llvm, version, release_version, clang-tools-extra_src, python }: let gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; @@ -33,7 +33,7 @@ let # Clang expects to find sanitizer libraries in its own prefix postInstall = '' ln -sv ${llvm}/lib/LLVMgold.so $out/lib - ln -sv ${llvm}/lib/clang/${version}/lib $out/lib/clang/${version}/ + ln -sv ${llvm}/lib/clang/${release_version}/lib $out/lib/clang/${release_version}/ ln -sv $out/bin/clang $out/bin/cpp ''; diff --git a/pkgs/development/compilers/llvm/4.0/default.nix b/pkgs/development/compilers/llvm/4.0/default.nix index a239825533eb..f407b2cdc9f5 100644 --- a/pkgs/development/compilers/llvm/4.0/default.nix +++ b/pkgs/development/compilers/llvm/4.0/default.nix @@ -1,15 +1,15 @@ { newScope, stdenv, isl, fetchurl, overrideCC, wrapCC, darwin, ccWrapperFun }: let - callPackage = newScope (self // { inherit stdenv isl version fetch; }); + callPackage = newScope (self // { inherit stdenv isl release_version version fetch; }); - version = "4.0.0"; + release_version = "4.0.0"; rc = "rc2"; + version = "${release_version}${rc}"; - fetch = fetch_v version; - fetch_v = ver: name: sha256: fetchurl { - url = "http://llvm.org/pre-releases/${version}/${rc}/${name}-${version}${rc}.src.tar.xz"; + fetch = name: sha256: fetchurl { + url = "http://llvm.org/pre-releases/${release_version}/${rc}/${name}-${version}.src.tar.xz"; # Once 4.0 is released, use this instead: - # url = "http://llvm.org/releases/${version}/${name}-${ver}.src.tar.xz"; + # url = "http://llvm.org/releases/${release-version}/${name}-${version}.src.tar.xz"; inherit sha256; }; diff --git a/pkgs/development/compilers/llvm/4.0/llvm.nix b/pkgs/development/compilers/llvm/4.0/llvm.nix index 0139f40791cc..d54390e5ee8d 100644 --- a/pkgs/development/compilers/llvm/4.0/llvm.nix +++ b/pkgs/development/compilers/llvm/4.0/llvm.nix @@ -11,6 +11,7 @@ , valgrind , ncurses , version +, release_version , zlib , compiler-rt_src , libcxxabi @@ -25,7 +26,7 @@ let # Used when creating a version-suffixed symlink of libLLVM.dylib shortVersion = with stdenv.lib; - concatStringsSep "." (take 2 (splitString "." version)); + concatStringsSep "." (take 2 (splitString "." release_version)); in stdenv.mkDerivation rec { name = "llvm-${version}"; @@ -99,7 +100,7 @@ in stdenv.mkDerivation rec { install_name_tool -id $lib/lib/libLLVM.dylib $lib/lib/libLLVM.dylib install_name_tool -change @rpath/libLLVM.dylib $lib/lib/libLLVM.dylib $out/bin/llvm-config ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib - ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${version}.dylib + ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib ''; enableParallelBuilding = true;