tangled
alpha
login
or
join now
tjh.dev
/
nixpkgs
Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
0
fork
atom
overview
issues
pulls
pipelines
coreboot-toolchain: format nix files
Jared Baur
1 year ago
dfd6da90
9bd6b9c0
+97
-69
2 changed files
expand all
collapse all
unified
split
pkgs
development
tools
misc
coreboot-toolchain
default.nix
stable.nix
+95
-68
pkgs/development/tools/misc/coreboot-toolchain/default.nix
···
1
1
-
{ stdenv, lib, callPackage }:
1
1
+
{
2
2
+
stdenv,
3
3
+
lib,
4
4
+
callPackage,
5
5
+
}:
2
6
let
3
3
-
common = arch: callPackage (
4
4
-
{ bison
5
5
-
, callPackage
6
6
-
, curl
7
7
-
, fetchgit
8
8
-
, flex
9
9
-
, getopt
10
10
-
, git
11
11
-
, gnat
12
12
-
, gcc
13
13
-
, lib
14
14
-
, perl
15
15
-
, stdenvNoCC
16
16
-
, zlib
17
17
-
, withAda ? true
18
18
-
}:
7
7
+
common =
8
8
+
arch:
9
9
+
callPackage (
10
10
+
{
11
11
+
bison,
12
12
+
callPackage,
13
13
+
curl,
14
14
+
fetchgit,
15
15
+
flex,
16
16
+
getopt,
17
17
+
git,
18
18
+
gnat,
19
19
+
gcc,
20
20
+
lib,
21
21
+
perl,
22
22
+
stdenvNoCC,
23
23
+
zlib,
24
24
+
withAda ? true,
25
25
+
}:
19
26
20
20
-
stdenvNoCC.mkDerivation (finalAttrs: {
21
21
-
pname = "coreboot-toolchain-${arch}";
22
22
-
version = "24.08";
27
27
+
stdenvNoCC.mkDerivation (finalAttrs: {
28
28
+
pname = "coreboot-toolchain-${arch}";
29
29
+
version = "24.08";
23
30
24
24
-
src = fetchgit {
25
25
-
url = "https://review.coreboot.org/coreboot";
26
26
-
rev = finalAttrs.version;
27
27
-
hash = "sha256-G/O8wN7moawiG4nAWsYSfiU3gpYxMvPtyvkgkrTL62E=";
28
28
-
fetchSubmodules = false;
29
29
-
leaveDotGit = true;
30
30
-
postFetch = ''
31
31
-
PATH=${lib.makeBinPath [ getopt ]}:$PATH ${stdenv.shell} $out/util/crossgcc/buildgcc -W > $out/.crossgcc_version
32
32
-
rm -rf $out/.git
33
33
-
'';
34
34
-
allowedRequisites = [ ];
35
35
-
};
31
31
+
src = fetchgit {
32
32
+
url = "https://review.coreboot.org/coreboot";
33
33
+
rev = finalAttrs.version;
34
34
+
hash = "sha256-G/O8wN7moawiG4nAWsYSfiU3gpYxMvPtyvkgkrTL62E=";
35
35
+
fetchSubmodules = false;
36
36
+
leaveDotGit = true;
37
37
+
postFetch = ''
38
38
+
PATH=${lib.makeBinPath [ getopt ]}:$PATH ${stdenv.shell} $out/util/crossgcc/buildgcc -W > $out/.crossgcc_version
39
39
+
rm -rf $out/.git
40
40
+
'';
41
41
+
allowedRequisites = [ ];
42
42
+
};
36
43
37
37
-
nativeBuildInputs = [ bison curl git perl ];
38
38
-
buildInputs = [ flex zlib (if withAda then gnat else gcc) ];
44
44
+
nativeBuildInputs = [
45
45
+
bison
46
46
+
curl
47
47
+
git
48
48
+
perl
49
49
+
];
50
50
+
buildInputs = [
51
51
+
flex
52
52
+
zlib
53
53
+
(if withAda then gnat else gcc)
54
54
+
];
39
55
40
40
-
enableParallelBuilding = true;
41
41
-
dontConfigure = true;
42
42
-
dontInstall = true;
56
56
+
enableParallelBuilding = true;
57
57
+
dontConfigure = true;
58
58
+
dontInstall = true;
43
59
44
44
-
postPatch = ''
45
45
-
patchShebangs util/crossgcc/buildgcc
60
60
+
postPatch = ''
61
61
+
patchShebangs util/crossgcc/buildgcc
46
62
47
47
-
mkdir -p util/crossgcc/tarballs
63
63
+
mkdir -p util/crossgcc/tarballs
48
64
49
49
-
${lib.concatMapStringsSep "\n" (
50
50
-
file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}"
51
51
-
) (callPackage ./stable.nix { })
52
52
-
}
65
65
+
${lib.concatMapStringsSep "\n" (file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}") (
66
66
+
callPackage ./stable.nix { }
67
67
+
)}
53
68
54
54
-
patchShebangs util/genbuild_h/genbuild_h.sh
55
55
-
'';
69
69
+
patchShebangs util/genbuild_h/genbuild_h.sh
70
70
+
'';
56
71
57
57
-
buildPhase = ''
58
58
-
export CROSSGCC_VERSION=$(cat .crossgcc_version)
59
59
-
make crossgcc-${arch} CPUS=$NIX_BUILD_CORES DEST=$out
60
60
-
'';
72
72
+
buildPhase = ''
73
73
+
export CROSSGCC_VERSION=$(cat .crossgcc_version)
74
74
+
make crossgcc-${arch} CPUS=$NIX_BUILD_CORES DEST=$out
75
75
+
'';
61
76
62
62
-
meta = with lib; {
63
63
-
homepage = "https://www.coreboot.org";
64
64
-
description = "coreboot toolchain for ${arch} targets";
65
65
-
license = with licenses; [ bsd2 bsd3 gpl2 lgpl2Plus gpl3Plus ];
66
66
-
maintainers = with maintainers; [ felixsinger jmbaur ];
67
67
-
platforms = platforms.linux;
68
68
-
};
69
69
-
})
70
70
-
);
77
77
+
meta = with lib; {
78
78
+
homepage = "https://www.coreboot.org";
79
79
+
description = "coreboot toolchain for ${arch} targets";
80
80
+
license = with licenses; [
81
81
+
bsd2
82
82
+
bsd3
83
83
+
gpl2
84
84
+
lgpl2Plus
85
85
+
gpl3Plus
86
86
+
];
87
87
+
maintainers = with maintainers; [
88
88
+
felixsinger
89
89
+
jmbaur
90
90
+
];
91
91
+
platforms = platforms.linux;
92
92
+
};
93
93
+
})
94
94
+
);
71
95
in
72
96
73
73
-
lib.listToAttrs (map (arch: lib.nameValuePair arch (common arch { })) [
74
74
-
"i386"
75
75
-
"x64"
76
76
-
"arm"
77
77
-
"aarch64"
78
78
-
"riscv"
79
79
-
"ppc64"
80
80
-
"nds32le"
81
81
-
])
97
97
+
lib.listToAttrs (
98
98
+
map (arch: lib.nameValuePair arch (common arch { })) [
99
99
+
"i386"
100
100
+
"x64"
101
101
+
"arm"
102
102
+
"aarch64"
103
103
+
"riscv"
104
104
+
"ppc64"
105
105
+
"nds32le"
106
106
+
]
107
107
+
)
108
108
+
+2
-1
pkgs/development/tools/misc/coreboot-toolchain/stable.nix
···
1
1
-
{ fetchurl }: [
1
1
+
{ fetchurl }:
2
2
+
[
2
3
{
3
4
name = "gmp-6.3.0.tar.xz";
4
5
archive = fetchurl {