diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index cf2d38cd9978..a630691bd03a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -35,8 +35,8 @@ let targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) (targetPlatform.config + "-"); - ccVersion = (builtins.parseDrvName cc.name).version; - ccName = (builtins.parseDrvName cc.name).name; + ccVersion = if cc == null then null else stdenv.lib.getVersion cc; + ccName = cc.pname or (builtins.parseDrvName cc.name).name; libc_bin = if libc == null then null else getBin libc; libc_dev = if libc == null then null else getDev libc; @@ -96,6 +96,7 @@ stdenv.mkDerivation { name = targetPrefix + (if name != "" then name else stdenv.lib.removePrefix targetPrefix "${ccName}-wrapper") + (stdenv.lib.optionalString (cc != null && ccVersion != "") "-${ccVersion}"); + version = ccVersion; preferLocalBuild = true; diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index eee2c1a97a8c..f2874d8e79ac 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -101,8 +101,8 @@ let majorVersion = "4"; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; - stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + stageNameAddon = if crossStageStatic then "stage-static" else "stage-final"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; in @@ -110,7 +110,8 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; + pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}"; + inherit version; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index b4ac68be1a33..d887b47db343 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -106,8 +106,8 @@ let majorVersion = "4"; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; - stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + stageNameAddon = if crossStageStatic then "stage-static" else "stage-final"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; in @@ -115,7 +115,8 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; + pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}"; + inherit version; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix index cb327864f6e4..ddd95a5cb8c2 100644 --- a/pkgs/development/compilers/gcc/5/default.nix +++ b/pkgs/development/compilers/gcc/5/default.nix @@ -97,8 +97,8 @@ let majorVersion = "5"; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; - stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + stageNameAddon = if crossStageStatic then "stage-static" else "stage-final"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; in @@ -106,7 +106,8 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; + pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}"; + inherit version; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 2cecc5bbaa05..48aa36bc923b 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -93,8 +93,8 @@ let majorVersion = "6"; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; - stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + stageNameAddon = if crossStageStatic then "stage-static" else "stage-final"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; in @@ -102,7 +102,8 @@ in assert x11Support -> (filter (x: x == null) ([ gtk2 libart_lgpl ] ++ xlibs)) == []; stdenv.mkDerivation ({ - name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; + pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}"; + inherit version; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index c1592dbcb9b0..d371b7252ddc 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -71,13 +71,14 @@ let majorVersion = "7"; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; - stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + stageNameAddon = if crossStageStatic then "stage-static" else "stage-final"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; in stdenv.mkDerivation ({ - name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; + pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}"; + inherit version; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 7288bebff9d9..b81e1c4b1d9b 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -63,13 +63,14 @@ let majorVersion = "8"; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; - stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + stageNameAddon = if crossStageStatic then "stage-static" else "stage-final"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; in stdenv.mkDerivation ({ - name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; + pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}"; + inherit version; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index a172be2aa163..e7c9e94747db 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -62,13 +62,14 @@ let majorVersion = "9"; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; - stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + stageNameAddon = if crossStageStatic then "stage-static" else "stage-final"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; in stdenv.mkDerivation ({ - name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; + pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}"; + inherit version; builder = ../builder.sh; diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix index 0519f04629ea..7e4afa169a0d 100644 --- a/pkgs/development/compilers/gcc/snapshot/default.nix +++ b/pkgs/development/compilers/gcc/snapshot/default.nix @@ -59,13 +59,14 @@ let majorVersion = "7"; /* Cross-gcc settings (build == host != target) */ crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt"; - stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final"; - crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else ""; + stageNameAddon = if crossStageStatic then "stage-static" else "stage-final"; + crossNameAddon = optionalString (targetPlatform != hostPlatform) "${targetPlatform.config}-${stageNameAddon}-"; in stdenv.mkDerivation ({ - name = crossNameAddon + "${name}${if stripped then "" else "-debug"}-${version}"; + pname = "${crossNameAddon}${name}${if stripped then "" else "-debug"}"; + inherit version; builder = ../builder.sh; diff --git a/pkgs/development/compilers/llvm/4/clang/default.nix b/pkgs/development/compilers/llvm/4/clang/default.nix index f50da39a6249..6b67e2cc8561 100644 --- a/pkgs/development/compilers/llvm/4/clang/default.nix +++ b/pkgs/development/compilers/llvm/4/clang/default.nix @@ -6,7 +6,8 @@ let gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; self = stdenv.mkDerivation ({ - name = "clang-${version}"; + pname = "clang"; + inherit version; src = fetch "cfe" "16vnv3msnvx33dydd17k2cq0icndi1a06bg5vcxkrhjjb1rqlwv1"; @@ -91,7 +92,7 @@ let platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "clang-manpages-${version}"; + pname = "clang-manpages"; buildPhase = '' make docs-clang-man diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix index 7e8559953524..ed80bc100674 100644 --- a/pkgs/development/compilers/llvm/4/llvm.nix +++ b/pkgs/development/compilers/llvm/4/llvm.nix @@ -24,7 +24,8 @@ let in stdenv.mkDerivation ({ - name = "llvm-${version}"; + pname = "llvm"; + inherit version; src = fetch "llvm" "0l9bf7kdwhlj0kq1hawpyxhna1062z3h7qcz2y8nfl9dz2qksy6s"; @@ -166,7 +167,7 @@ stdenv.mkDerivation ({ platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "llvm-manpages-${version}"; + pname = "llvm-manpages"; buildPhase = '' make docs-llvm-man diff --git a/pkgs/development/compilers/llvm/5/clang/default.nix b/pkgs/development/compilers/llvm/5/clang/default.nix index 7a3b151f8358..6695609b8ecd 100644 --- a/pkgs/development/compilers/llvm/5/clang/default.nix +++ b/pkgs/development/compilers/llvm/5/clang/default.nix @@ -6,7 +6,8 @@ let gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; self = stdenv.mkDerivation ({ - name = "clang-${version}"; + pname = "clang"; + inherit version; src = fetch "cfe" "0018520c4qxf5hgjdqgpz2dgl3faf4gsz87fdlb8zdmx99rfk77s"; @@ -87,7 +88,7 @@ let platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "clang-manpages-${version}"; + pname = "clang-manpages"; buildPhase = '' make docs-clang-man diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm.nix index 02db395db571..3e926d8e532b 100644 --- a/pkgs/development/compilers/llvm/5/llvm.nix +++ b/pkgs/development/compilers/llvm/5/llvm.nix @@ -23,7 +23,8 @@ let in stdenv.mkDerivation ({ - name = "llvm-${version}"; + pname = "llvm"; + inherit version; src = fetch "llvm" "0g1bbj2n6xv4p1n6hh17vj3vpvg56wacipc81dgwga9mg2lys8nm"; @@ -149,7 +150,7 @@ stdenv.mkDerivation ({ platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "llvm-manpages-${version}"; + pname = "llvm-manpages"; buildPhase = '' make docs-llvm-man diff --git a/pkgs/development/compilers/llvm/6/clang/default.nix b/pkgs/development/compilers/llvm/6/clang/default.nix index ff9064f455ec..d093379b3c99 100644 --- a/pkgs/development/compilers/llvm/6/clang/default.nix +++ b/pkgs/development/compilers/llvm/6/clang/default.nix @@ -6,7 +6,8 @@ let gcc = if stdenv.cc.isGNU then stdenv.cc.cc else stdenv.cc.cc.gcc; self = stdenv.mkDerivation ({ - name = "clang-${version}"; + pname = "clang"; + inherit version; src = fetch "cfe" "0rxn4rh7rrnsqbdgp4gzc8ishbkryhpl1kd3mpnxzpxxhla3y93w"; @@ -87,7 +88,7 @@ let platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "clang-manpages-${version}"; + pname = "clang-manpages"; buildPhase = '' make docs-clang-man diff --git a/pkgs/development/compilers/llvm/6/llvm.nix b/pkgs/development/compilers/llvm/6/llvm.nix index 2586602d7378..5ae24bf0f335 100644 --- a/pkgs/development/compilers/llvm/6/llvm.nix +++ b/pkgs/development/compilers/llvm/6/llvm.nix @@ -26,7 +26,8 @@ let in stdenv.mkDerivation ({ - name = "llvm-${version}"; + pname = "llvm"; + inherit version; src = fetch "llvm" "1qpls3vk85lydi5b4axl0809fv932qgsqgdgrk098567z4jc7mmn"; @@ -154,7 +155,7 @@ stdenv.mkDerivation ({ platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "llvm-manpages-${version}"; + pname = "llvm-manpages"; buildPhase = '' make docs-llvm-man diff --git a/pkgs/development/compilers/llvm/7/clang/default.nix b/pkgs/development/compilers/llvm/7/clang/default.nix index e49c8387f7ef..5ac9a7a2672a 100644 --- a/pkgs/development/compilers/llvm/7/clang/default.nix +++ b/pkgs/development/compilers/llvm/7/clang/default.nix @@ -6,7 +6,8 @@ let self = stdenv.mkDerivation ({ - name = "clang-${version}"; + pname = "clang"; + inherit version; src = fetch "cfe" "0vc4i87qwxnw9lci4ayws9spakg0z6w5w670snj9f8g5m9rc8zg9"; @@ -93,7 +94,7 @@ let platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "clang-manpages-${version}"; + pname = "clang-manpages"; buildPhase = '' make docs-clang-man diff --git a/pkgs/development/compilers/llvm/7/llvm.nix b/pkgs/development/compilers/llvm/7/llvm.nix index cfcda02b4131..f9443a987a23 100644 --- a/pkgs/development/compilers/llvm/7/llvm.nix +++ b/pkgs/development/compilers/llvm/7/llvm.nix @@ -30,7 +30,8 @@ let imap (i: _: concatStringsSep "." (take i parts)) parts; in stdenv.mkDerivation ({ - name = "llvm-${version}"; + pname = "llvm"; + inherit version; src = fetch "llvm" "0r1p5didv4rkgxyvbkyz671xddg6i3dxvbpsi1xxipkla0l9pk0v"; polly_src = fetch "polly" "16qkns4ab4x0azrvhy4j7cncbyb2rrbdrqj87zphvqxm5pvm8m1h"; @@ -172,7 +173,7 @@ in stdenv.mkDerivation ({ platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "llvm-manpages-${version}"; + pname = "llvm-manpages"; buildPhase = '' make docs-llvm-man diff --git a/pkgs/development/compilers/llvm/8/clang/default.nix b/pkgs/development/compilers/llvm/8/clang/default.nix index 6911089250e8..8c540e45b286 100644 --- a/pkgs/development/compilers/llvm/8/clang/default.nix +++ b/pkgs/development/compilers/llvm/8/clang/default.nix @@ -6,7 +6,8 @@ let self = stdenv.mkDerivation ({ - name = "clang-${version}"; + pname = "clang"; + inherit version; src = fetch "cfe" "0ihnbdl058gvl2wdy45p5am55bq8ifx8m9mhcsgj9ax8yxlzvvvh"; @@ -105,7 +106,7 @@ let platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "clang-manpages-${version}"; + pname = "clang-manpages"; buildPhase = '' make docs-clang-man diff --git a/pkgs/development/compilers/llvm/8/llvm.nix b/pkgs/development/compilers/llvm/8/llvm.nix index 70e666ba27de..e27e47a3b228 100644 --- a/pkgs/development/compilers/llvm/8/llvm.nix +++ b/pkgs/development/compilers/llvm/8/llvm.nix @@ -28,7 +28,8 @@ let concatStringsSep "." (take 1 (splitString "." release_version)); in stdenv.mkDerivation ({ - name = "llvm-${version}"; + pname = "llvm"; + inherit version; src = fetch "llvm" "1rvm5gqp5v8hfn17kqws3zhk94w4kxndal12bqa0y57p09nply24"; polly_src = fetch "polly" "1lfjdz3ilj5xmjxvicd8f5ykybks67ry2pdb777352r3mzlgg8g8"; @@ -150,7 +151,7 @@ in stdenv.mkDerivation ({ platforms = stdenv.lib.platforms.all; }; } // stdenv.lib.optionalAttrs enableManpages { - name = "llvm-manpages-${version}"; + pname = "llvm-manpages"; buildPhase = '' make docs-llvm-man