forked from mirrors/nixpkgs
pijuice: init at 1.7
This commit is contained in:
parent
2ce7592267
commit
5d888bff27
61
pkgs/development/python-modules/pijuice/default.nix
Normal file
61
pkgs/development/python-modules/pijuice/default.nix
Normal file
|
@ -0,0 +1,61 @@
|
|||
{ lib
|
||||
, fetchFromGitHub
|
||||
, buildPythonPackage
|
||||
, pythonOlder
|
||||
, smbus-cffi
|
||||
, urwid
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "pijuice";
|
||||
version = "1.7";
|
||||
disabled = pythonOlder "3.6";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "PiSupply";
|
||||
repo = "PiJuice";
|
||||
# rev hash retrieved from the latest modification on file Software/Source/VERSION, as this project
|
||||
# does not use Github tags facility
|
||||
rev = "3ba6719ab614a3dc7495d5d9c900dd4ea977c7e3";
|
||||
sha256 = "GoNN07YgVaktpeY5iYDbfpy5fxkU1x0V3Sb1hgGAQt4=";
|
||||
};
|
||||
|
||||
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;
|
||||
|
||||
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
|
||||
'';
|
||||
|
||||
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 ];
|
||||
};
|
||||
}
|
|
@ -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
|
||||
#
|
|
@ -27431,6 +27431,8 @@ with pkgs;
|
|||
|
||||
pijul = callPackage ../applications/version-management/pijul { };
|
||||
|
||||
pijuice = with python3Packages; toPythonApplication pijuice;
|
||||
|
||||
ping = callPackage ../applications/networking/ping { };
|
||||
|
||||
piper = callPackage ../os-specific/linux/piper { };
|
||||
|
|
|
@ -5946,6 +5946,8 @@ in {
|
|||
|
||||
piexif = callPackage ../development/python-modules/piexif { };
|
||||
|
||||
pijuice = callPackage ../development/python-modules/pijuice { };
|
||||
|
||||
pika = callPackage ../development/python-modules/pika { };
|
||||
|
||||
pika-pool = callPackage ../development/python-modules/pika-pool { };
|
||||
|
|
Loading…
Reference in a new issue