2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, python3
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "nitrokey-app2";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "2.1.4";
|
2023-10-19 13:55:26 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = python3.pythonOlder "3.9";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Nitrokey";
|
|
|
|
repo = "nitrokey-app2";
|
|
|
|
rev = "v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-loOCa6XlLx1YEfqR0SUUalVIEPCoYsNEHFo2MIKexeA=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
# 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.
|
2023-10-09 19:29:22 +00:00
|
|
|
preBuild = ''
|
|
|
|
make build-ui
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = with python3.pkgs; [
|
2023-10-19 13:55:26 +00:00
|
|
|
flit-core
|
2023-10-09 19:29:22 +00:00
|
|
|
pyqt5
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
|
|
|
pynitrokey
|
|
|
|
pyudev
|
|
|
|
pyqt5
|
|
|
|
pyqt5-stubs
|
|
|
|
qt-material
|
|
|
|
];
|
|
|
|
|
|
|
|
preFixup = ''
|
|
|
|
wrapQtApp "$out/bin/nitrokeyapp" \
|
|
|
|
--set-default CRYPTOGRAPHY_OPENSSL_NO_LEGACY 1
|
|
|
|
'';
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"nitrokeyapp"
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "This application allows to manage Nitrokey 3 devices";
|
|
|
|
homepage = "https://github.com/Nitrokey/nitrokey-app2";
|
2023-10-19 13:55:26 +00:00
|
|
|
changelog = "https://github.com/Nitrokey/nitrokey-app2/releases/tag/v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
license = licenses.asl20;
|
2024-01-02 11:29:13 +00:00
|
|
|
maintainers = with maintainers; [ _999eagle panicgh ];
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "nitrokeyapp";
|
|
|
|
};
|
|
|
|
}
|