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,65 @@
{ lib
, fetchFromGitHub
, buildPythonPackage
, pythonOlder
, smbus-cffi
, urwid
}:
buildPythonPackage rec {
pname = "pijuice";
version = "1.7";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "PiSupply";
repo = "PiJuice";
# Latest commit that fixes using the library against python 3.9 by renaming
# isAlive() to is_alive(). The former function was removed in python 3.9.
rev = "e2dca1f8dcfa12e009952a882c0674a545d193d6";
sha256 = "07Jr7RSjqI8j0tT0MNAjrN1sjF1+mI+V0vtKInvtxj8=";
};
patches = [
# The pijuice_cli.cli file doesn't have a shebang as the first line of the
# script. Without it, the pythonWrapPrograms hook will not wrap the program.
# Add a python shebang here so that the the hook is triggered.
./patch-shebang.diff
];
PIJUICE_BUILD_BASE = 1;
PIJUICE_VERSION = version;
preBuild = ''
cd Software/Source
'';
propagatedBuildInputs = [ smbus-cffi urwid ];
# Remove the following files from the package:
#
# pijuice_cli - A precompiled ELF binary that is a setuid wrapper for calling
# pijuice_cli.py
#
# pijuiceboot - a precompiled ELF binary for flashing firmware. Not needed for
# the python library.
#
# pijuice_sys.py - A program that acts as a system daemon for monitoring the
# pijuice.
preFixup = ''
rm $out/bin/pijuice_cli
rm $out/bin/pijuice_sys.py
rm $out/bin/pijuiceboot
mv $out/bin/pijuice_cli.py $out/bin/pijuice_cli
'';
# no tests
doCheck = false;
meta = with lib; {
description = "Library and resources for PiJuice HAT for Raspberry Pi";
homepage = "https://github.com/PiSupply/PiJuice";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ hexagonal-sun ];
};
}

View file

@ -0,0 +1,9 @@
diff --git a/Software/Source/src/pijuice_cli.py b/Software/Source/src/pijuice_cli.py
index c366fee..37af383 100644
--- a/Software/Source/src/pijuice_cli.py
+++ b/Software/Source/src/pijuice_cli.py
@@ -1,3 +1,4 @@
+#!/usr/bin/python3
# This python script to be executed as user pijuice by the setuid program pijuice_cli
# Python 3 only
#