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,60 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, libftdi
, infnoise, testers }:
stdenv.mkDerivation rec {
pname = "infnoise";
version = "0.3.2";
src = fetchFromGitHub {
owner = "leetronics";
repo = "infnoise";
rev = "e80ddd78085abf3d06df2e0d8c08fd33dade78eb";
sha256 = "sha256-9MKG1InkV+yrQPBTgi2gZJ3y9Fokb6WbxuAnM7n7FyA=";
};
patches = [
# Patch makefile so we can set defines from the command line instead of it depending on .git
./makefile.patch
# Fix getc return type
(fetchpatch {
url = "https://github.com/leetronics/infnoise/commit/7ed7014e14253311c07e530c8f89f1c8f4705c2b.patch";
sha256 = "sha256-seB/fJaxQ/rXJp5iPtnobXXOccQ2KUAk6HFx31dhOhs=";
})
];
GIT_COMMIT = src.rev;
GIT_VERSION = version;
GIT_DATE = "2019-08-12";
buildInputs = [ libftdi ];
makefile = "Makefile.linux";
makeFlags = [ "PREFIX=$(out)" ];
postPatch = ''
cd software
substituteInPlace init_scripts/infnoise.service --replace "/usr/local" "$out"
'';
postInstall = ''
make -C tools
find ./tools/ -executable -type f -exec \
sh -c "install -Dm755 {} $out/bin/infnoise-\$(basename {})" \;
'';
passthru = {
tests.version = testers.testVersion { package = infnoise; };
};
meta = with lib; {
homepage = "https://github.com/leetronics/infnoise";
description = "Driver for the Infinite Noise TRNG";
longDescription = ''
The Infinite Noise TRNG is a USB key hardware true random number generator.
It can either provide rng for userland applications, or provide rng for the OS entropy.
'';
license = licenses.cc0;
maintainers = with maintainers; [ StijnDW zhaofengli ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,14 @@
diff --git a/software/Makefile.linux b/software/Makefile.linux
index db48aa5..df8b3d2 100644
--- a/software/Makefile.linux
+++ b/software/Makefile.linux
@@ -1,6 +1,6 @@
-GIT_VERSION := $(shell git --no-pager describe --tags --always)
-GIT_COMMIT := $(shell git rev-parse --verify HEAD)
-GIT_DATE := $(firstword $(shell git --no-pager show --date=iso-strict --format="%ad" --name-only))
+GIT_VERSION ?= $(shell git --no-pager describe --tags --always)
+GIT_COMMIT ?= $(shell git rev-parse --verify HEAD)
+GIT_DATE ?= $(firstword $(shell git --no-pager show --date=iso-strict --format="%ad" --name-only))
PREFIX = $(DESTDIR)/usr/local