From 1264b312da9b98478e16b5a4e5c0dbf831013305 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Mon, 24 Jul 2023 03:12:56 +0400 Subject: [PATCH 1/2] python3Packages.asyncua: fix build on darwin --- pkgs/development/python-modules/asyncua/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/python-modules/asyncua/default.nix b/pkgs/development/python-modules/asyncua/default.nix index 7e36099f186c..0ad561ebfb9b 100644 --- a/pkgs/development/python-modules/asyncua/default.nix +++ b/pkgs/development/python-modules/asyncua/default.nix @@ -1,4 +1,5 @@ { lib +, stdenv , aiofiles , aiosqlite , buildPythonPackage @@ -60,6 +61,17 @@ buildPythonPackage rec { "asyncua" ]; + disabledTests = lib.optionals stdenv.isDarwin [ + # Failed: DID NOT RAISE + "test_publish" + # OSError: [Errno 48] error while attempting to bind on address ('127.0.0.1',... + "test_anonymous_rejection" + "test_certificate_handling_success" + "test_encrypted_private_key_handling_success" + "test_encrypted_private_key_handling_success_with_cert_props" + "test_encrypted_private_key_handling_failure" + ]; + meta = with lib; { description = "OPC UA / IEC 62541 Client and Server for Python"; homepage = "https://github.com/FreeOpcUa/opcua-asyncio"; From fb9dba73f3ef76847c6716a3c0c4a16673e99686 Mon Sep 17 00:00:00 2001 From: Nikolay Korotkiy Date: Mon, 24 Jul 2023 03:17:59 +0400 Subject: [PATCH 2/2] opcua-client-gui: enable on darwin --- pkgs/misc/opcua-client-gui/default.nix | 20 +++++++++++++++----- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pkgs/misc/opcua-client-gui/default.nix b/pkgs/misc/opcua-client-gui/default.nix index 2c684060758f..361b2627c973 100644 --- a/pkgs/misc/opcua-client-gui/default.nix +++ b/pkgs/misc/opcua-client-gui/default.nix @@ -1,22 +1,32 @@ { lib -, python3 +, stdenv +, python3Packages , fetchFromGitHub , makeDesktopItem , copyDesktopItems +, desktopToDarwinBundle +, wrapQtAppsHook }: -python3.pkgs.buildPythonApplication rec { +python3Packages.buildPythonApplication rec { pname = "opcua-client-gui"; version = "0.8.4"; src = fetchFromGitHub { owner = "FreeOpcUa"; - repo = pname; + repo = "opcua-client-gui"; rev = version; hash = "sha256-0BH1Txr3z4a7iFcsfnovmBUreXMvIX2zpZa8QivQVx8="; }; - propagatedBuildInputs = with python3.pkgs; [ + nativeBuildInputs = [ copyDesktopItems wrapQtAppsHook ] + ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ]; + + makeWrapperArgs = [ + "\${qtWrapperArgs[@]}" + ]; + + propagatedBuildInputs = with python3Packages; [ pyqt5 asyncua opcua-widgets @@ -43,7 +53,7 @@ python3.pkgs.buildPythonApplication rec { meta = with lib; { description = "OPC UA GUI Client"; homepage = "https://github.com/FreeOpcUa/opcua-client-gui"; - platforms = platforms.linux; + platforms = platforms.unix; license = licenses.gpl3Only; maintainers = with maintainers; [ janik ]; }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b7b067f71fe7..1e79439d4056 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -33609,7 +33609,7 @@ with pkgs; opcr-policy = callPackage ../development/tools/opcr-policy { }; - opcua-client-gui = callPackage ../misc/opcua-client-gui { }; + opcua-client-gui = libsForQt5.callPackage ../misc/opcua-client-gui { }; open-policy-agent = callPackage ../development/tools/open-policy-agent { };