From 1ce7106b9e49a0abb9e83a84454a4a4af66c0374 Mon Sep 17 00:00:00 2001 From: Sophie Tauchert Date: Tue, 18 Jul 2023 21:29:11 +0200 Subject: [PATCH 1/3] python3Packages.pyqt5-stubs: init at 5.15.6.0 --- pkgs/development/python-modules/pyqt/5.x.nix | 4 ++ .../python-modules/pyqt5-stubs/default.nix | 61 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 3 files changed, 67 insertions(+) create mode 100644 pkgs/development/python-modules/pyqt5-stubs/default.nix diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix index 6bb268d21995..12d2ea182af0 100644 --- a/pkgs/development/python-modules/pyqt/5.x.nix +++ b/pkgs/development/python-modules/pyqt/5.x.nix @@ -117,6 +117,10 @@ buildPythonPackage rec { multimediaEnabled = withMultimedia; webKitEnabled = withWebKit; WebSocketsEnabled = withWebSockets; + connectivityEnabled = withConnectivity; + locationEnabled = withLocation; + serialPortEnabled = withSerialPort; + toolsEnabled = withTools; }; dontConfigure = true; diff --git a/pkgs/development/python-modules/pyqt5-stubs/default.nix b/pkgs/development/python-modules/pyqt5-stubs/default.nix new file mode 100644 index 000000000000..505c64253971 --- /dev/null +++ b/pkgs/development/python-modules/pyqt5-stubs/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5840c7d3bbef..6d789ddbbfa7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9342,6 +9342,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 { From ee8b4482ab02747f8a21f40f9a825e2e854b7dc2 Mon Sep 17 00:00:00 2001 From: Sophie Tauchert Date: Tue, 18 Jul 2023 21:29:53 +0200 Subject: [PATCH 2/3] python3Packages.qt-material: init at 2.14 --- .../python-modules/qt-material/default.nix | 30 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/qt-material/default.nix diff --git a/pkgs/development/python-modules/qt-material/default.nix b/pkgs/development/python-modules/qt-material/default.nix new file mode 100644 index 000000000000..c7c195cdfc48 --- /dev/null +++ b/pkgs/development/python-modules/qt-material/default.nix @@ -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 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 6d789ddbbfa7..3e4e531ecacb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10545,6 +10545,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 { }; qtawesome = callPackage ../development/python-modules/qtawesome { }; From 246013fb25376a2f8131779319123c2fbc5d283b Mon Sep 17 00:00:00 2001 From: Sophie Tauchert Date: Tue, 18 Jul 2023 21:30:54 +0200 Subject: [PATCH 3/3] nitrokey-app2: init at 2.1.2 --- pkgs/tools/security/nitrokey-app2/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 53 insertions(+) create mode 100644 pkgs/tools/security/nitrokey-app2/default.nix diff --git a/pkgs/tools/security/nitrokey-app2/default.nix b/pkgs/tools/security/nitrokey-app2/default.nix new file mode 100644 index 000000000000..935838a5d60a --- /dev/null +++ b/pkgs/tools/security/nitrokey-app2/default.nix @@ -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"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cc3904692e41..375d5de0022e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -40922,6 +40922,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 { };