aboutsummaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/llvm/6
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2019-05-04 13:24:12 +0200
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2019-05-04 17:32:43 +0200
commit626a95a9b4299bed3ecdb4f5caec436c885cc0ac (patch)
treea64b144fd28de21bb6e70665730d2948a6540dca /pkgs/development/compilers/llvm/6
parent807ba5f123bda28080eaefba46dc2b0af71a26fa (diff)
llvm: create all versioned symlinks for libLLVM on darwin
Apply eb31e481475 to older versions where applicable.
Diffstat (limited to 'pkgs/development/compilers/llvm/6')
-rw-r--r--pkgs/development/compilers/llvm/6/llvm.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/pkgs/development/compilers/llvm/6/llvm.nix b/pkgs/development/compilers/llvm/6/llvm.nix
index 1d96513a0ece..9237d442b776 100644
--- a/pkgs/development/compilers/llvm/6/llvm.nix
+++ b/pkgs/development/compilers/llvm/6/llvm.nix
@@ -21,11 +21,13 @@ let
src = fetch "llvm" "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn";
- # Used when creating a version-suffixed symlink of libLLVM.dylib
- shortVersion = with stdenv.lib;
- concatStringsSep "." (take 2 (splitString "." release_version));
+ # Used when creating a versioned symlinks of libLLVM.dylib
+ versionSuffixes = with stdenv.lib;
+ let parts = splitString "." release_version; in
+ imap (i: _: concatStringsSep "." (take i parts)) parts;
+in
-in stdenv.mkDerivation (rec {
+stdenv.mkDerivation (rec {
name = "llvm-${version}";
unpackPhase = ''
@@ -133,8 +135,9 @@ in stdenv.mkDerivation (rec {
+ optionalString (stdenv.isDarwin && enableSharedLibraries) ''
substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
--replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
- ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${shortVersion}.dylib
- ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
+ ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+ ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
+ '') versionSuffixes}
'';
doCheck = stdenv.isLinux && (!stdenv.isi686);