如何将插件包含在QT5桌面应用程序中的快照中



我有一个用QT5编写的Linux的桌面应用程序,我想将其部署为SNAP软件包。构建和安装有效,但该应用程序不可执行,并给出以下错误:

This application failed to start because it could not find or load the Qt platform plugin "xcb"
in "".

这是我的snapcraft.yaml

name: animationmaker
version: '1.0'
summary: Create keyframe animation and export them to a movie file
description: |
  This app can be used to create animated movie based on keyframe animations.
grade: stable
confinement: strict
apps:
  animationmaker:
    command: AnimationMaker
parts:
  animationmaker:
    plugin: qmake
    qt-version: qt5
    source: https://github.com/Artanidos/AnimationMaker.git

我认为QT5中的插件缺少,但我不知道如何更改YAML以包括它们。当我构建一个附属物时,有以下插件包括IconEngines,ImageFormats和Platform。有任何想法吗?

插件包含在 libqt5gui5中,您可以将其添加为阶段包,例如:

parts:
  animationmaker:
    plugin: qmake
    qt-version: qt5
    source: https://github.com/Artanidos/AnimationMaker.git
    stage-packages: [libqt5gui5]

但是,Snapcraft支持远程零件,其中之一是一个出色的桌面QT助手:

parts:
  animationmaker:
    plugin: qmake
    qt-version: qt5
    source: https://github.com/Artanidos/AnimationMaker.git
    after: [desktop-qt5]

并使您的应用使用desktop-launch助手:

apps:
  animationmaker:
    command: desktop-launch AnimationMaker

最新更新