Merge pull request #243049 from 999eagle/feat/nitrokey-app2

This commit is contained in:
Ryan Lahfa 2023-10-06 17:28:02 +02:00 committed by GitHub
commit 1d91d95ecf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 152 additions and 0 deletions

View file

@ -117,6 +117,10 @@ buildPythonPackage rec {
multimediaEnabled = withMultimedia;
webKitEnabled = withWebKit;
WebSocketsEnabled = withWebSockets;
connectivityEnabled = withConnectivity;
locationEnabled = withLocation;
serialPortEnabled = withSerialPort;
toolsEnabled = withTools;
};
dontConfigure = true;

View file

@ -0,0 +1,61 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, pytestCheckHook
, pyqt5
, pyqt3d
, pyqtchart
, pyqtdatavisualization
, pyqtwebengine
}:
buildPythonPackage rec {
pname = "PyQt5-stubs";
version = "5.15.6.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "python-qt-tools";
repo = "PyQt5-stubs";
rev = version;
hash = "sha256-qWnvlHnFRy8wbZJ28C0pYqAxod623Epe5z5FZufheDc=";
};
postPatch = ''
# pulls in a dependency to mypy, but we don't want to run linters
rm tests/test_stubs.py
'' + lib.optionalString (!pyqt5.connectivityEnabled) ''
rm tests/qflags/test_QtBluetooth_*
rm tests/qflags/test_QtNfc_*
'' + lib.optionalString (!pyqt5.locationEnabled) ''
rm tests/qflags/test_QtLocation_*
rm tests/qflags/test_QtPositioning_*
'' + lib.optionalString (!pyqt5.multimediaEnabled) ''
rm tests/qflags/test_QtMultimedia_*
'' + lib.optionalString (!pyqt5.serialPortEnabled) ''
rm tests/qflags/test_QtSerialPort_*
'' + lib.optionalString (!pyqt5.toolsEnabled) ''
rm tests/qflags/test_QtDesigner_*
'';
pythonImportsCheck = [
"PyQt5-stubs"
];
nativeCheckInputs = [
pytestCheckHook
pyqt5
pyqt3d
pyqtchart
pyqtdatavisualization
pyqtwebengine
];
meta = with lib; {
description = "Stubs for PyQt5 ";
homepage = "https://github.com/python-qt-tools/PyQt5-stubs";
license = licenses.gpl3;
maintainers = with maintainers; [ _999eagle ];
};
}

View file

@ -0,0 +1,30 @@
{ lib
, buildPythonPackage
, fetchPypi
, jinja2
}:
buildPythonPackage rec {
pname = "qt-material";
version = "2.14";
src = fetchPypi {
inherit pname version;
hash = "sha256-tdu1relyF8964za7fAR8kL6zncfyBIpJjJFq1fL3riM=";
};
propagatedBuildInputs = [
jinja2
];
pythonImportsCheck = [
"qt_material"
];
meta = with lib; {
description = "Material inspired stylesheet for PySide2, PySide6, PyQt5 and PyQt6";
homepage = "https://github.com/UN-GCPDS/qt-material";
license = licenses.bsd2;
maintainers = with maintainers; [ _999eagle ];
};
}

View file

@ -0,0 +1,51 @@
{ lib
, python3
, fetchFromGitHub
, pynitrokey
, wrapQtAppsHook
}:
python3.pkgs.buildPythonApplication rec {
pname = "nitrokey-app2";
version = "2.1.2";
format = "flit";
src = fetchFromGitHub {
owner = "Nitrokey";
repo = "nitrokey-app2";
rev = "v${version}";
hash = "sha256-VyhIFNXxH/FohgjhBeZXoQYppP7PEz+ei0qzsWz1xhk=";
};
preBuild = ''
make build-ui
'';
nativeBuildInputs = with python3.pkgs; [
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
'';
meta = with lib; {
description = "This application allows to manage Nitrokey 3 devices";
homepage = "https://github.com/Nitrokey/nitrokey-app2";
license = licenses.asl20;
maintainers = with maintainers; [ _999eagle ];
mainProgram = "nitrokeyapp";
};
}

View file

@ -41870,6 +41870,8 @@ with pkgs;
nitrokey-app = libsForQt5.callPackage ../tools/security/nitrokey-app { };
nitrokey-app2 = libsForQt5.callPackage ../tools/security/nitrokey-app2 { };
fpm2 = callPackage ../tools/security/fpm2 { };
simplenote = callPackage ../applications/misc/simplenote { };

View file

@ -10600,6 +10600,8 @@ self: super: with self; {
pyqt5 = callPackage ../development/python-modules/pyqt/5.x.nix { };
pyqt5-stubs = callPackage ../development/python-modules/pyqt5-stubs { };
pyqt5_sip = callPackage ../development/python-modules/pyqt/sip.nix { };
pyqt5_with_qtmultimedia = self.pyqt5.override {
@ -11821,6 +11823,8 @@ self: super: with self; {
qstylizer = callPackage ../development/python-modules/qstylizer { };
qt-material = callPackage ../development/python-modules/qt-material { };
qt5reactor = callPackage ../development/python-modules/qt5reactor { };
qt6 = pkgs.qt6.override {