diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2019-05-07 19:29:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-07 19:29:06 +0200 |
commit | a80982b4c9e5dc9a34973638d62b0c748bef4eec (patch) | |
tree | 2d2d426102de35f584636864dd5228b509de6a6a /pkgs/development/compilers/llvm/4/llvm.nix | |
parent | 6ae8aed1c2ec25a523c809bb5b0c3e3e89d0bb5e (diff) | |
parent | 0196d8f11cff9790531f7599153a077bb493b9cf (diff) | |
download | nixlib-a80982b4c9e5dc9a34973638d62b0c748bef4eec.tar nixlib-a80982b4c9e5dc9a34973638d62b0c748bef4eec.tar.gz nixlib-a80982b4c9e5dc9a34973638d62b0c748bef4eec.tar.bz2 nixlib-a80982b4c9e5dc9a34973638d62b0c748bef4eec.tar.lz nixlib-a80982b4c9e5dc9a34973638d62b0c748bef4eec.tar.xz nixlib-a80982b4c9e5dc9a34973638d62b0c748bef4eec.tar.zst nixlib-a80982b4c9e5dc9a34973638d62b0c748bef4eec.zip |
Merge staging-next into master
Diffstat (limited to 'pkgs/development/compilers/llvm/4/llvm.nix')
-rw-r--r-- | pkgs/development/compilers/llvm/4/llvm.nix | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix index 5cd7901fe22c..ecb18a580540 100644 --- a/pkgs/development/compilers/llvm/4/llvm.nix +++ b/pkgs/development/compilers/llvm/4/llvm.nix @@ -19,10 +19,13 @@ let src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s"; - # Used when creating a version-suffixed symlink of libLLVM.dylib - shortVersion = with stdenv.lib; - concatStringsSep "." (take 2 (splitString "." release_version)); -in stdenv.mkDerivation (rec { + # 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 + +stdenv.mkDerivation (rec { name = "llvm-${version}"; unpackPhase = '' @@ -136,8 +139,9 @@ in stdenv.mkDerivation (rec { + stdenv.lib.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); |