diff --git a/pkgs/development/libraries/pyotherside/default.nix b/pkgs/development/libraries/pyotherside/default.nix index 481093cbe188..33fe7ee169e0 100644 --- a/pkgs/development/libraries/pyotherside/default.nix +++ b/pkgs/development/libraries/pyotherside/default.nix @@ -5,11 +5,15 @@ python3, qmake, qtbase, - qtquickcontrols, + qtdeclarative, + qtquickcontrols ? null, # Qt6: merged into qtdeclarative qtsvg, ncurses, }: +let + withQt6 = lib.strings.versionAtLeast qtbase.version "6"; +in stdenv.mkDerivation rec { pname = "pyotherside"; version = "1.6.2"; @@ -21,11 +25,26 @@ stdenv.mkDerivation rec { sha256 = "sha256-2OYVULNW9EzssqodiVtL2EmhTSbefXpLkub3zFvNwNo="; }; + postPatch = '' + substituteInPlace qtquicktests/run \ + --replace-fail \ + 'exec ./qtquicktests' \ + 'exec ./${ + if stdenv.hostPlatform.isDarwin then + "qtquicktests.app/Contents/MacOS/qtquicktests" + else + "qtquicktests" + }' \ + --replace-fail \ + '-plugins ../src' \ + '-plugins ../src -import $out/${qtbase.qtQmlPrefix} -import ${lib.getBin qtdeclarative}/${qtbase.qtQmlPrefix}' + ''; + nativeBuildInputs = [ qmake ]; buildInputs = [ python3 qtbase - qtquickcontrols + (if withQt6 then qtdeclarative else qtquickcontrols) qtsvg ncurses ]; @@ -35,10 +54,35 @@ stdenv.mkDerivation rec { patches = [ ./qml-path.patch ]; installTargets = [ "sub-src-install_subtargets" ]; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + checkPhase = '' + runHook preCheck + + export QT_QPA_PLATFORM=minimal + export QT_PLUGIN_PATH=${lib.getBin qtbase}/${qtbase.qtPluginPrefix} + ./tests/tests + + runHook postCheck + ''; + + doInstallCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + installCheckPhase = '' + runHook preInstallCheck + + pushd qtquicktests + ./run + popd + + runHook postInstallCheck + ''; + meta = { - description = "Asynchronous Python 3 Bindings for Qt 5"; + description = "Asynchronous Python 3 Bindings for Qt ${lib.versions.major qtbase.version}"; homepage = "https://thp.io/2011/pyotherside/"; license = lib.licenses.isc; maintainers = [ lib.maintainers.mic92 ]; + platforms = lib.platforms.unix ++ lib.platforms.windows; }; } diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a0449bd200b5..7c03c05c46ae 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1738,6 +1738,7 @@ mapAliases { pyCA = warnAlias "'pyCA' was renamed to 'pyca'" pyca; # Added 2026-02-12 pyload-ng = throw "'pyload-ng' has been removed due to vulnerabilities and being unmaintained"; # Added 2026-03-21 pyo3-pack = throw "'pyo3-pack' has been renamed to/replaced by 'maturin'"; # Converted to throw 2025-10-27 + pyotherside = warnAlias "'pyotherside' has been renamed to 'libsForQt5.pyotherside'. A Qt6 build is available at 'qt6Packages.pyotherside'."; # Added 2026-03-27 pypolicyd-spf = throw "'pypolicyd-spf' has been renamed to/replaced by 'spf-engine'"; # Converted to throw 2025-10-27 python3Full = throw "python3Full has been removed. Bluetooth support is now enabled by default. The tkinter package is available within the package set."; # Added 2025-08-30 python311Full = throw "python311Full has been removed. Bluetooth support is now enabled by default. The tkinter package is available within the package set."; # Added 2025-08-30 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9b4018f7b1a9..c100cad36f44 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7117,8 +7117,6 @@ with pkgs; pth = if stdenv.hostPlatform.isMusl then npth else gnupth; - pyotherside = libsForQt5.callPackage ../development/libraries/pyotherside { }; - qbs = libsForQt5.callPackage ../development/tools/build-managers/qbs { }; qdjango = libsForQt5.callPackage ../development/libraries/qdjango { }; diff --git a/pkgs/top-level/qt5-packages.nix b/pkgs/top-level/qt5-packages.nix index 1a52c4faa1be..cc23ae2fbb92 100644 --- a/pkgs/top-level/qt5-packages.nix +++ b/pkgs/top-level/qt5-packages.nix @@ -154,6 +154,8 @@ makeScopeWithSplicing' { pulseaudio-qt = callPackage ../development/libraries/pulseaudio-qt { }; + pyotherside = callPackage ../development/libraries/pyotherside { }; + qca = callPackage ../development/libraries/qca { inherit (libsForQt5) qtbase; }; diff --git a/pkgs/top-level/qt6-packages.nix b/pkgs/top-level/qt6-packages.nix index cc1b5fec45b7..d17adae73183 100644 --- a/pkgs/top-level/qt6-packages.nix +++ b/pkgs/top-level/qt6-packages.nix @@ -92,6 +92,8 @@ makeScopeWithSplicing' { maplibre-native-qt = callPackage ../development/libraries/maplibre-native-qt { }; + pyotherside = callPackage ../development/libraries/pyotherside { }; + qca = callPackage ../development/libraries/qca { inherit (qt6) qtbase qt5compat; };