uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
77
pkgs/development/tools/misc/coreboot-toolchain/default.nix
Normal file
77
pkgs/development/tools/misc/coreboot-toolchain/default.nix
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
{ lib, callPackage }:
|
||||
let
|
||||
common = arch: callPackage (
|
||||
{ bison
|
||||
, callPackage
|
||||
, curl
|
||||
, fetchgit
|
||||
, flex
|
||||
, getopt
|
||||
, git
|
||||
, gnat11
|
||||
, lib
|
||||
, perl
|
||||
, stdenvNoCC
|
||||
, zlib
|
||||
}:
|
||||
|
||||
stdenvNoCC.mkDerivation rec {
|
||||
pname = "coreboot-toolchain-${arch}";
|
||||
version = "4.16";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://review.coreboot.org/coreboot";
|
||||
rev = version;
|
||||
sha256 = "073n8yid3v0l9wgwnrdqrlgzaj9mnhs33a007dgr7xq3z0iw3i52";
|
||||
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
|
||||
'';
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ bison curl git perl ];
|
||||
buildInputs = [ flex gnat11 zlib ];
|
||||
|
||||
enableParallelBuilding = true;
|
||||
dontConfigure = true;
|
||||
dontInstall = true;
|
||||
|
||||
postPatch = ''
|
||||
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 ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
);
|
||||
in
|
||||
|
||||
lib.listToAttrs (map (arch: lib.nameValuePair arch (common arch {})) [
|
||||
"i386"
|
||||
"x64"
|
||||
"arm"
|
||||
"aarch64"
|
||||
"riscv"
|
||||
"ppc64"
|
||||
"nds32le"
|
||||
])
|
||||
51
pkgs/development/tools/misc/coreboot-toolchain/stable.nix
Normal file
51
pkgs/development/tools/misc/coreboot-toolchain/stable.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{ fetchurl }: [
|
||||
{
|
||||
name = "gmp-6.2.1.tar.xz";
|
||||
archive = fetchurl {
|
||||
sha256 = "1wml97fdmpcynsbw9yl77rj29qibfp652d0w3222zlfx5j8jjj7x";
|
||||
url = "mirror://gnu/gmp/gmp-6.2.1.tar.xz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "mpfr-4.1.0.tar.xz";
|
||||
archive = fetchurl {
|
||||
sha256 = "0zwaanakrqjf84lfr5hfsdr7hncwv9wj0mchlr7cmxigfgqs760c";
|
||||
url = "mirror://gnu/mpfr/mpfr-4.1.0.tar.xz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "mpc-1.2.1.tar.gz";
|
||||
archive = fetchurl {
|
||||
sha256 = "0n846hqfqvmsmim7qdlms0qr86f1hck19p12nq3g3z2x74n3sl0p";
|
||||
url = "mirror://gnu/mpc/mpc-1.2.1.tar.gz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "gcc-11.2.0.tar.xz";
|
||||
archive = fetchurl {
|
||||
sha256 = "12zs6vd2rapp42x154m479hg3h3lsafn3xhg06hp5hsldd9xr3nh";
|
||||
url = "mirror://gnu/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "binutils-2.37.tar.xz";
|
||||
archive = fetchurl {
|
||||
sha256 = "0b53hhgfnafw27y0c3nbmlfidny2cc5km29pnfffd8r0y0j9f3c2";
|
||||
url = "mirror://gnu/binutils/binutils-2.37.tar.xz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "acpica-unix2-20211217.tar.gz";
|
||||
archive = fetchurl {
|
||||
sha256 = "0521hmaw2zhi0mpgnaf2i83dykfgql4bx98cg7xqy8wmj649z194";
|
||||
url = "https://acpica.org/sites/acpica/files/acpica-unix2-20211217.tar.gz";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "nasm-2.15.05.tar.bz2";
|
||||
archive = fetchurl {
|
||||
sha256 = "1l1gxs5ncdbgz91lsl4y7w5aapask3w02q9inayb2m5bwlwq6jrw";
|
||||
url = "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2";
|
||||
};
|
||||
}
|
||||
]
|
||||
36
pkgs/development/tools/misc/coreboot-toolchain/update.sh
Executable file
36
pkgs/development/tools/misc/coreboot-toolchain/update.sh
Executable file
|
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell --pure -i bash -p nix cacert git getopt
|
||||
|
||||
if [ ! -d .git ]; then
|
||||
echo "This script needs to be run from the root directory of nixpkgs. Exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pkg_dir="$(dirname "$0")"
|
||||
|
||||
src="$(nix-build . --no-out-link -A coreboot-toolchain.i386.src)"
|
||||
urls=$($src/util/crossgcc/buildgcc -u)
|
||||
|
||||
tmp=$(mktemp)
|
||||
echo '{ fetchurl }: [' > $tmp
|
||||
|
||||
for url in $urls; do
|
||||
name="$(basename $url)"
|
||||
hash="$(nix-prefetch-url "$url")"
|
||||
|
||||
cat << EOF >> $tmp
|
||||
{
|
||||
name = "$name";
|
||||
archive = fetchurl {
|
||||
sha256 = "$hash";
|
||||
url = "$url";
|
||||
};
|
||||
}
|
||||
EOF
|
||||
done
|
||||
|
||||
echo ']' >> $tmp
|
||||
|
||||
sed -ie 's/https\:\/\/ftpmirror\.gnu\.org/mirror\:\/\/gnu/g' $tmp
|
||||
|
||||
mv $tmp $pkg_dir/sources.nix
|
||||
Loading…
Add table
Add a link
Reference in a new issue