Skip to content

Commit a155990

Browse files
gcc-unwrapped: set main program
1 parent 653ed63 commit a155990

7 files changed

Lines changed: 18 additions & 7 deletions

File tree

pkgs/development/compilers/gcc/common/configure-flags.nix

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
enablePlugin,
2121
disableGdbPlugin ? !enablePlugin,
2222
enableShared,
23+
targetPrefix,
2324

2425
langC,
2526
langCC,
@@ -59,10 +60,6 @@ let
5960
crossDarwin =
6061
(!lib.systems.equals targetPlatform hostPlatform) && targetPlatform.libc == "libSystem";
6162

62-
targetPrefix = lib.optionalString (
63-
!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform
64-
) "${stdenv.targetPlatform.config}-";
65-
6663
crossConfigureFlags =
6764
# Ensure that -print-prog-name is able to find the correct programs.
6865
[

pkgs/development/compilers/gcc/common/meta.nix

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{ lib, version }:
1+
{
2+
lib,
3+
version,
4+
targetPrefix,
5+
}:
26

37
let
48
inherit (lib)
@@ -24,5 +28,6 @@ in
2428

2529
platforms = platforms.unix;
2630
teams = [ teams.gcc ];
31+
mainProgram = "${targetPrefix}gcc";
2732

2833
}

pkgs/development/compilers/gcc/default.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ let
119119
!lib.systems.equals targetPlatform hostPlatform
120120
) "${targetPlatform.config}${stageNameAddon}-";
121121

122+
targetPrefix = lib.optionalString (
123+
!lib.systems.equals stdenv.targetPlatform stdenv.hostPlatform
124+
) "${stdenv.targetPlatform.config}-";
125+
122126
callFile = callPackageWith {
123127
# lets
124128
inherit
@@ -340,7 +344,7 @@ pipe
340344
"target"
341345
];
342346

343-
configureFlags = callFile ./common/configure-flags.nix { };
347+
configureFlags = callFile ./common/configure-flags.nix { inherit targetPrefix; };
344348

345349
inherit targetConfig;
346350

@@ -449,13 +453,14 @@ pipe
449453
inherit enableShared enableMultilib;
450454

451455
meta = {
452-
inherit (callFile ./common/meta.nix { })
456+
inherit (callFile ./common/meta.nix { inherit targetPrefix; })
453457
homepage
454458
license
455459
description
456460
longDescription
457461
platforms
458462
teams
463+
mainProgram
459464
;
460465
}
461466
// optionalAttrs (!atLeast11) {

pkgs/os-specific/linux/minimal-bootstrap/gcc/4.6.cxx.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ bash.runCommand "${pname}-${version}"
102102
license = licenses.gpl3Plus;
103103
teams = [ teams.minimal-bootstrap ];
104104
platforms = platforms.unix;
105+
mainProgram = "gcc";
105106
};
106107
}
107108
''

pkgs/os-specific/linux/minimal-bootstrap/gcc/4.6.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ bash.runCommand "${pname}-${version}"
8484
license = licenses.gpl3Plus;
8585
teams = [ teams.minimal-bootstrap ];
8686
platforms = platforms.unix;
87+
mainProgram = "gcc";
8788
};
8889
}
8990
''

pkgs/os-specific/linux/minimal-bootstrap/gcc/8.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ bash.runCommand "${pname}-${version}"
101101
license = licenses.gpl3Plus;
102102
teams = [ teams.minimal-bootstrap ];
103103
platforms = platforms.unix;
104+
mainProgram = "gcc";
104105
};
105106
}
106107
''

pkgs/os-specific/linux/minimal-bootstrap/gcc/latest.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ bash.runCommand "${pname}-${version}"
100100
license = licenses.gpl3Plus;
101101
teams = [ teams.minimal-bootstrap ];
102102
platforms = platforms.unix;
103+
mainProgram = "gcc";
103104
};
104105
}
105106
''

0 commit comments

Comments
 (0)