2021-11-24 00:15:10 +01:00
|
|
|
{ lib, callPackage }:
|
2021-11-20 00:18:45 +01:00
|
|
|
let
|
2021-11-24 00:15:10 +01:00
|
|
|
common = arch: callPackage (
|
|
|
|
{ bison
|
|
|
|
, callPackage
|
|
|
|
, curl
|
|
|
|
, fetchgit
|
|
|
|
, flex
|
|
|
|
, getopt
|
|
|
|
, git
|
|
|
|
, gnat11
|
|
|
|
, lib
|
|
|
|
, perl
|
|
|
|
, stdenvNoCC
|
|
|
|
, zlib
|
|
|
|
}:
|
2021-06-27 05:54:04 +02:00
|
|
|
|
2021-11-24 00:15:10 +01:00
|
|
|
stdenvNoCC.mkDerivation rec {
|
|
|
|
pname = "coreboot-toolchain-${arch}";
|
|
|
|
version = "4.15";
|
|
|
|
|
|
|
|
src = fetchgit {
|
|
|
|
url = "https://review.coreboot.org/coreboot";
|
|
|
|
rev = version;
|
|
|
|
sha256 = "1qsb2ca22h5f0iwc254qsfm7qcn8967ir8aybdxa1pakgmnfsyp9";
|
|
|
|
fetchSubmodules = false;
|
|
|
|
leaveDotGit = true;
|
|
|
|
postFetch = ''
|
|
|
|
patchShebangs $out/util/crossgcc/buildgcc
|
|
|
|
PATH=${lib.makeBinPath [ getopt ]}:$PATH $out/util/crossgcc/buildgcc -W > $out/.crossgcc_version
|
|
|
|
rm -rf $out/.git
|
|
|
|
'';
|
|
|
|
};
|
2021-06-27 05:54:04 +02:00
|
|
|
|
2021-11-24 00:15:10 +01:00
|
|
|
nativeBuildInputs = [ bison curl git perl ];
|
|
|
|
buildInputs = [ flex gnat11 zlib ];
|
2021-06-27 05:54:04 +02:00
|
|
|
|
2021-11-24 00:15:10 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
dontInstall = true;
|
2021-10-03 20:39:55 +02:00
|
|
|
|
2021-11-24 00:15:10 +01:00
|
|
|
postPatch = ''
|
|
|
|
mkdir -p util/crossgcc/tarballs
|
2021-10-03 20:39:55 +02:00
|
|
|
|
2021-11-24 00:15:10 +01:00
|
|
|
${lib.concatMapStringsSep "\n" (
|
|
|
|
file: "ln -s ${file.archive} util/crossgcc/tarballs/${file.name}"
|
|
|
|
) (callPackage ./stable.nix { })
|
|
|
|
}
|
2021-06-27 05:54:04 +02:00
|
|
|
|
2021-11-24 00:15:10 +01:00
|
|
|
patchShebangs util/genbuild_h/genbuild_h.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
export CROSSGCC_VERSION=$(cat .crossgcc_version)
|
|
|
|
make crossgcc-${arch} CPUS=$NIX_BUILD_CORES DEST=$out
|
|
|
|
'';
|
2021-11-20 00:18:45 +01:00
|
|
|
|
2021-11-24 00:15:10 +01:00
|
|
|
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 ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
);
|
|
|
|
in
|
2021-06-27 05:54:04 +02:00
|
|
|
|
2021-11-24 00:15:10 +01:00
|
|
|
lib.listToAttrs (map (arch: lib.nameValuePair arch (common arch {})) [
|
|
|
|
"i386"
|
|
|
|
"x64"
|
|
|
|
"arm"
|
|
|
|
"aarch64"
|
|
|
|
"riscv"
|
|
|
|
"ppc64"
|
|
|
|
"nds32le"
|
|
|
|
])
|