1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 04:02:10 +00:00

nitrokey-app2: switch to pypaBuildHook and fix the build

This commit is contained in:
Nicolas Benes 2023-06-21 19:12:00 +02:00
parent 5afa5669c9
commit 48e6a7c70f

View file

@ -8,7 +8,9 @@
python3.pkgs.buildPythonApplication rec {
pname = "nitrokey-app2";
version = "2.1.2";
format = "flit";
pyproject = true;
disabled = python3.pythonOlder "3.9";
src = fetchFromGitHub {
owner = "Nitrokey";
@ -17,11 +19,22 @@ python3.pkgs.buildPythonApplication rec {
hash = "sha256-VyhIFNXxH/FohgjhBeZXoQYppP7PEz+ei0qzsWz1xhk=";
};
# https://github.com/Nitrokey/nitrokey-app2/issues/152
#
# pythonRelaxDepsHook does not work here, because it runs in postBuild and
# only modifies the dependencies in the built distribution.
postPatch = ''
substituteInPlace pyproject.toml --replace "pynitrokey ==" "pynitrokey >="
'';
# The pyproject.toml file seems to be incomplete and does not generate
# resources (i.e. run pyrcc5 and pyuic5) but the Makefile does.
preBuild = ''
make build-ui
'';
nativeBuildInputs = with python3.pkgs; [
flit-core
pyqt5
wrapQtAppsHook
];
@ -41,9 +54,14 @@ python3.pkgs.buildPythonApplication rec {
--set-default CRYPTOGRAPHY_OPENSSL_NO_LEGACY 1
'';
pythonImportsCheck = [
"nitrokeyapp"
];
meta = with lib; {
description = "This application allows to manage Nitrokey 3 devices";
homepage = "https://github.com/Nitrokey/nitrokey-app2";
changelog = "https://github.com/Nitrokey/nitrokey-app2/releases/tag/v${version}";
license = licenses.asl20;
maintainers = with maintainers; [ _999eagle ];
mainProgram = "nitrokeyapp";