Files
nixpkgs/pkgs/development/tools/misc/coreboot-toolchain/default.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

107 lines
2.3 KiB
Nix

{
stdenv,
lib,
callPackage,
}:
let
common =
arch:
callPackage (
{
bison,
callPackage,
curl,
fetchgit,
flex,
getopt,
git,
gnat14,
gcc14,
lib,
perl,
stdenvNoCC,
zlib,
withAda ? true,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "coreboot-toolchain-${arch}";
version = "25.03";
src = fetchgit {
url = "https://review.coreboot.org/coreboot";
rev = finalAttrs.version;
hash = "sha256-zyfBQKVton+2vjYd6fqrUqkHY9bci411pujRGabvTjQ=";
fetchSubmodules = false;
leaveDotGit = true;
postFetch = ''
PATH=${lib.makeBinPath [ getopt ]}:$PATH ${stdenv.shell} $out/util/crossgcc/buildgcc -W > $out/.crossgcc_version
rm -rf $out/.git
'';
allowedRequisites = [ ];
};
nativeBuildInputs = [
bison
curl
git
perl
];
buildInputs = [
flex
zlib
(if withAda then gnat14 else gcc14)
];
enableParallelBuilding = true;
dontConfigure = true;
dontInstall = true;
postPatch = ''
patchShebangs util/crossgcc/buildgcc
mkdir -p util/crossgcc/tarballs
${lib.concatMapStringsSep "\n" (file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}") (
callPackage ./stable.nix { }
)}
patchShebangs util/genbuild_h/genbuild_h.sh
'';
buildPhase = ''
export CROSSGCC_VERSION=$(cat .crossgcc_version)
make crossgcc-${arch} CPUS=$NIX_BUILD_CORES DEST=$out
'';
meta = with lib; {
homepage = "https://www.coreboot.org";
description = "Coreboot toolchain for ${arch} targets";
license = with licenses; [
bsd2
bsd3
gpl2
lgpl2Plus
gpl3Plus
];
maintainers = with maintainers; [
felixsinger
jmbaur
];
platforms = platforms.linux;
};
})
);
in
lib.listToAttrs (
map (arch: lib.nameValuePair arch (common arch { })) [
"i386"
"x64"
"arm"
"aarch64"
"riscv"
"ppc64"
]
)