Build a package with all dependencies

Hi
I have already built a program with all the dependencies, how can I correctly build a snap package from this files?

my snapcraft.yaml

name: qt-deployer
version: '1.0test3'
summary: app
description: |
 app
grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots

icon: snap/gui/icon.png

apps:
  app:
    command: bin/app

    plugs: [desktop, home, opengl, x11, dbus]
    environment:
      LD_LIBRARY_PATH: $SNAP/lib
      QML_IMPORT_PATH: $SNAP/qml
      QML2_IMPORT_PATH: $SNAP/qml
      QT_PLUGIN_PATH: $SNAP/plugins
      QT_QPA_PLATFORM_PLUGIN_PATH: $SNAP/plugins/platforms


parts:
  app:
    plugin: dump
    source: source
    source-type: local
    
    stage-packages:
      # Here for the plugins-- they're not linked in automatically.
      - libx11-xcb-dev
      - libglu1-mesa-dev
      - libxrender-dev
      - libxi-dev
      - libboost-dev
      


Ithis is an attempt to package an application written using the latest version of qt.
Really need your help

If you have, like, statically linked all the dependencies and the program is relocatable, you’d probably could simply dump all the files into the stage and prime directories, which you’ve already done.

One apparent issue is that you shouldn’t stage the development packages (*-dev) as it only provides the library headers and static libraries, for dynamically linked libraries, stage the packages without the -dev postfix.

here’s what happens during the build:

Files from the build host were migrated into the snap to satisfy dependencies that would otherwise not be met. This feature will be removed in a future release. If these libraries are needed in the final snap, ensure that the following are either satisfied by a stage-packages entry or through a part:
usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.58.0
usr/lib/x86_64-linux-gnu/libboost_system.so.1.58.0
usr/lib/x86_64-linux-gnu/libcapnp-0.5.3.so
usr/lib/x86_64-linux-gnu/libfontconfig.so.1
usr/lib/x86_64-linux-gnu/libgbm.so.1
usr/lib/x86_64-linux-gnu/libkj-0.5.3.so
usr/lib/x86_64-linux-gnu/libmirclient.so.9
usr/lib/x86_64-linux-gnu/libmircommon.so.7
usr/lib/x86_64-linux-gnu/libmircore.so.1
usr/lib/x86_64-linux-gnu/libmirprotobuf.so.3
usr/lib/x86_64-linux-gnu/libprotobuf-lite.so.9
usr/lib/x86_64-linux-gnu/libwayland-client.so.0
usr/lib/x86_64-linux-gnu/libwayland-server.so.0
usr/lib/x86_64-linux-gnu/libxcb-xfixes.so.0
usr/lib/x86_64-linux-gnu/libxkbcommon.so.0
usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so.1
Sorry, Snapcraft ran into an error when trying to running through its
lifecycle that generated the following traceback:
Traceback (most recent call last):
  File "/snap/snapcraft/1594/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.42.1', 'console_scripts', 'snapcraft')()
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 1043, in invoke
    return Command.invoke(self, ctx)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/cli/_runner.py", line 79, in run
    ctx.forward(lifecyclecli.commands['snap'])
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 553, in forward
    return self.invoke(cmd, **kwargs)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/cli/lifecycle.py", line 135, in snap
    project_options, directory=directory, output=output)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_packer.py", line 46, in snap
    execute('prime', project_options)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 79, in execute
    _Executor(config, project_options).run(step, part_names)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 194, in run
    self._create_meta(step, part_names)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/lifecycle/_runner.py", line 245, in _create_meta
    self.config.validator.schema)
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 121, in create_snap_packaging
    packaging.write_snap_yaml()
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 324, in write_snap_yaml
    snap_yaml = self._compose_snap_yaml()
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 480, in _compose_snap_yaml
    snap_yaml['apps'] = self._wrap_apps(self._config_data['apps'])
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 577, in _wrap_apps
    self._wrap_app(app, apps[app])
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 585, in _wrap_app
    app[k] = self._wrap_exe(app[k], '{}-{}'.format(k, name))
  File "/snap/snapcraft/1594/lib/python3.5/site-packages/snapcraft/internal/meta/_snap_packaging.py", line 555, in _wrap_exe
    with open(exepath, 'rb') as exefile:
FileNotFoundError: [Errno 2] No such file or directory: '/media/andrei/D/QtDeployer/prime/bin/qt-deployer'