2021-04-05 15:23:46 +00:00
|
|
|
{ lib, stdenv, fetchFromGitiles, pkg-config, libuuid, openssl, libyaml, xz }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "111.15329";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
pname = "vboot_reference";
|
|
|
|
|
|
|
|
src = fetchFromGitiles {
|
|
|
|
url = "https://chromium.googlesource.com/chromiumos/platform/vboot_reference";
|
2023-03-04 12:14:45 +00:00
|
|
|
rev = "1a1cb5c9a38030a5868e2aaad295c68432c680fd"; # refs/heads/release-R111-15329.B
|
|
|
|
sha256 = "sha256-56/hqqFiKHw0/ah0D20U1ueIU2iq8I4Wn5DiEWxB9qA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2023-03-04 12:14:45 +00:00
|
|
|
buildInputs = [ libuuid libyaml openssl xz ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2023-03-04 12:14:45 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString [
|
|
|
|
# This apparently doesn't work as expected:
|
|
|
|
# - https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/refs/heads/release-R111-15329.B/Makefile#439
|
|
|
|
# Let's apply the same flag manually.
|
|
|
|
"-Wno-error=deprecated-declarations"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "ar qc" '${stdenv.cc.bintools.targetPrefix}ar qc'
|
2023-03-04 12:14:45 +00:00
|
|
|
# Drop flag unrecognized by GCC 9 (for e.g. aarch64-linux)
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "-Wno-unknown-warning" ""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preBuild = ''
|
|
|
|
patchShebangs scripts
|
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"HOST_ARCH=${stdenv.hostPlatform.parsed.cpu.name}"
|
2023-03-04 12:14:45 +00:00
|
|
|
"USE_FLASHROM=0"
|
|
|
|
# Upstream has weird opinions about DESTDIR
|
|
|
|
# https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/refs/heads/release-R111-15329.B/Makefile#51
|
|
|
|
"UB_DIR=${placeholder "out"}/bin"
|
|
|
|
"UL_DIR=${placeholder "out"}/lib"
|
|
|
|
"UI_DIR=${placeholder "out"}/include/vboot"
|
|
|
|
"US_DIR=${placeholder "out"}/share/vboot"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/vboot
|
|
|
|
cp -r tests/devkeys* $out/share/vboot/
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Chrome OS partitioning and kernel signing tools";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.linux;
|
2023-03-04 12:14:45 +00:00
|
|
|
maintainers = with maintainers; [ lheckemann samueldr ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|