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 ''