From 7ccad2a4f2f89081903bc467bbd8b2fae41370ed Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Tue, 7 Nov 2017 00:34:44 -0500 Subject: [PATCH] vboot_reference: build all the tools This expands the build to include more things that are useful on chromebooks, like `crossystem` --- pkgs/tools/system/vboot_reference/default.nix | 16 +++++----- .../vboot_reference/dont_static_link.patch | 30 +++++++++++++++++++ 2 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 pkgs/tools/system/vboot_reference/dont_static_link.patch diff --git a/pkgs/tools/system/vboot_reference/default.nix b/pkgs/tools/system/vboot_reference/default.nix index 0b8933bb7af3..e410ef1cee50 100644 --- a/pkgs/tools/system/vboot_reference/default.nix +++ b/pkgs/tools/system/vboot_reference/default.nix @@ -17,17 +17,17 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - buildPhase = '' + patches = [ ./dont_static_link.patch ]; + + preBuild = '' patchShebangs scripts - make -j''${NIX_BUILD_CORES:-1} \ - `pwd`/build/cgpt/cgpt \ - `pwd`/build/futility/futility ''; - installPhase = '' - mkdir -p $out/bin - cp build/cgpt/cgpt $out/bin - cp build/futility/futility $out/bin + makeFlags = [ + "DESTDIR=$(out)" + ]; + + postInstall = '' mkdir -p $out/share/vboot cp -r tests/devkeys* $out/share/vboot/ ''; diff --git a/pkgs/tools/system/vboot_reference/dont_static_link.patch b/pkgs/tools/system/vboot_reference/dont_static_link.patch new file mode 100644 index 000000000000..506b942e246e --- /dev/null +++ b/pkgs/tools/system/vboot_reference/dont_static_link.patch @@ -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}