From a34b66acfa671b1e58fd8a531ee4bb1c18f84d71 Mon Sep 17 00:00:00 2001 From: Quoc Anh Nguyen Date: Tue, 4 Aug 2026 16:46:46 +0300 Subject: [PATCH] mouser: qt6 is added --- pkgs/by-name/mo/mouser/package.nix | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/mo/mouser/package.nix b/pkgs/by-name/mo/mouser/package.nix index e51d8b9c2544..aa1df49cb9b4 100644 --- a/pkgs/by-name/mo/mouser/package.nix +++ b/pkgs/by-name/mo/mouser/package.nix @@ -3,6 +3,7 @@ stdenv, fetchFromGitHub, python3Packages, + qt6, copyDesktopItems, makeDesktopItem, nix-update-script, @@ -24,10 +25,25 @@ python3Packages.buildPythonApplication (finalAttrs: { hash = "sha256-Pjcx7YChgu7R8Kdv8fOJcxq98nwh/izpjbOO+4/cdk4="; }; - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ + nativeBuildInputs = [ + qt6.wrapQtAppsHook + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ copyDesktopItems ]; + # pyside6 does not bundle Qt's QML modules or plugins the way the PyPI + # wheel does, so the QtQuick imports and the SVG image/icon plugins must be + # provided here for wrapQtAppsHook to pick up. + buildInputs = [ + qt6.qtbase + qt6.qtdeclarative + qt6.qtsvg + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + qt6.qtwayland + ]; + dependencies = (with python3Packages; [ pyside6 @@ -89,8 +105,11 @@ python3Packages.buildPythonApplication (finalAttrs: { runHook postInstall ''; + # The wrapper is created manually below; there is no binary for the hook to wrap. + dontWrapQtApps = true; + postFixup = '' - makeWrapper ${python3Packages.python.interpreter} $out/bin/mouser \ + makeQtWrapper ${python3Packages.python.interpreter} $out/bin/mouser \ --prefix PYTHONPATH : "$PYTHONPATH" \ '' + lib.optionalString stdenv.hostPlatform.isLinux ''