llvm-4.0: Distinguish release version, fix naming to clarify rc2.

This commit is contained in:
Will Dietz 2017-02-19 14:33:47 -06:00
parent 753058baef
commit a5aedafbd9
3 changed files with 11 additions and 10 deletions

View File

@ -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
'';

View File

@ -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;
};

View File

@ -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;