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