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:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,58 @@
{ lib, stdenv, fetchFromGitiles, pkg-config, libuuid, openssl, libyaml, xz }:
stdenv.mkDerivation rec {
version = "20180311";
checkout = "4c84e077858c809ee80a9a6f9b38185cf7dcded7";
pname = "vboot_reference";
src = fetchFromGitiles {
url = "https://chromium.googlesource.com/chromiumos/platform/vboot_reference";
rev = checkout;
sha256 = "1zja4ma6flch08h5j2l1hqnxmw2xwylidnddxxd5y2x05dai9ddj";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl libuuid libyaml xz ];
enableParallelBuilding = true;
patches = [ ./dont_static_link.patch ];
NIX_CFLAGS_COMPILE = [
# fix build with gcc9
"-Wno-error"
# workaround build failure on -fno-common toolchains:
# ld: /build/source/build/futility/vb2_helper.o:(.bss+0x0): multiple definition of
# `vboot_version'; /build/source/build/futility/futility.o:(.bss+0x0): first defined here
# TODO: remove it when next release contains:
# https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/df4d2000a22db673a788b8e57e8e7c0cc3cee777
"-fcommon"
];
postPatch = ''
substituteInPlace Makefile \
--replace "ar qc" '${stdenv.cc.bintools.targetPrefix}ar qc'
'';
preBuild = ''
patchShebangs scripts
'';
makeFlags = [
"DESTDIR=$(out)"
"HOST_ARCH=${stdenv.hostPlatform.parsed.cpu.name}"
];
postInstall = ''
mkdir -p $out/share/vboot
cp -r tests/devkeys* $out/share/vboot/
'';
meta = with lib; {
description = "Chrome OS partitioning and kernel signing tools";
license = licenses.bsd3;
platforms = platforms.linux;
maintainers = with maintainers; [ lheckemann ];
};
}

View file

@ -0,0 +1,30 @@
---
--- a/Makefile
+++ b/Makefile
@@ -964,7 +964,7 @@ ${UTILLIB21}: ${UTILLIB21_OBJS} ${FWLIB2
# Link tests for external repos
${BUILD}/host/linktest/extern: ${HOSTLIB}
${BUILD}/host/linktest/extern: LIBS = ${HOSTLIB}
-${BUILD}/host/linktest/extern: LDLIBS += -static
+#${BUILD}/host/linktest/extern: LDLIBS += -static
TEST_OBJS += ${BUILD}/host/linktest/extern.o
.PHONY: hostlib
@@ -1056,7 +1056,7 @@ ${UTIL_BINS} ${UTIL_BINS_STATIC}: ${UTIL
${UTIL_BINS} ${UTIL_BINS_STATIC}: LIBS = ${UTILLIB}
# Utilities for auto-update toolkits must be statically linked.
-${UTIL_BINS_STATIC}: LDFLAGS += -static
+${UTIL_BINS_STATIC}:
.PHONY: utils
@@ -1089,7 +1089,7 @@ futil: ${FUTIL_STATIC_BIN} ${FUTIL_BIN}
${FUTIL_STATIC_BIN}: ${FUTIL_STATIC_OBJS} ${UTILLIB}
@${PRINTF} " LD $(subst ${BUILD}/,,$@)\n"
- ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} -static $^ ${LDLIBS}
+ ${Q}${LD} -o $@ ${CFLAGS} ${LDFLAGS} $^ ${LDLIBS}
${FUTIL_BIN}: LDLIBS += ${CRYPTO_LIBS}
${FUTIL_BIN}: ${FUTIL_OBJS} ${UTILLIB}