1
0
Fork 0
mirror of https://github.com/NixOS/nixos-hardware synced 2024-12-27 12:09:45 +01:00
nixos-hardware/milkv/pioneer/zsbl.nix
2024-04-05 13:35:18 +00:00

51 lines
1 KiB
Nix

{ buildPackages
, bison
, fetchFromGitHub
, flex
, lib
, stdenv
, ...
}:
stdenv.mkDerivation rec {
pname = "zsbl-sg2042";
version = "git-cc806273";
src = fetchFromGitHub {
owner = "sophgo";
repo = "zsbl";
rev = "cc806273e0f679bef2f6b017c68adede1594ad31";
hash = "sha256-zOlBM7mwz8FUM/BlzOxJmpI8LI/KcFOGXegvgiilbaM=";
};
patches = [
# Depending on the sdcard, reading larger initrds (say >= 25MB)
# can hit the timeout.
./zsbl-increase-timeout.patch
];
nativeBuildInputs = [
bison
flex
];
depsBuildBuild = [
buildPackages.stdenv.cc
];
hardeningDisable = [
"fortify"
"stackprotector"
];
makeFlags = [
"CROSS_COMPILE=${stdenv.cc.targetPrefix}"
];
configurePhase = "make sg2042_defconfig";
installPhase = "install -D zsbl.bin $out";
enableParallelBuilding = true;
dontStrip = true;
meta = {
homepage = "https://github.com/sophgo/zsbl";
description = "Sophgo RISC-V Zero Stage Boot Loader";
license = lib.licenses.gpl2;
};
}