#
# Copyright (C) 2018-2024 QuasarApp.
# Distributed under the lgplv3 software license, see the accompanying
# Everyone is permitted to copy and distribute verbatim copies
# of this license document, but changing it is not allowed.
#

name: cqtdeployer # you probably want to 'snapcraft register <name>'
version: '@CQT_DEPLOYER_VERSION@'
summary: deploy your qt or c/c++ projects # 79 char long summary
description: |
  Console app for deploy qt libs.
  Key differences of this program
  Performance-this program deploys the application several times faster (up to 10 seconds)
  Flexibility-this application has flags that will help you configure the deployment as you need and your project

grade: stable # must be 'stable' to release into candidate/stable channels
confinement: strict # use 'strict' once you have the right plugs and slots
base: core22
icon: snap/gui/icon.png
apps:
  cqtdeployer:
    command: bin/bash $SNAP/CQtDeployer.sh
    plugs: [home, removable-media, process-control, system-backup]

  cqt:
    command: bin/bash $SNAP/cqt.sh
    plugs: [home, removable-media, process-control, system-backup]

parts:
  cqtdeployer:
    # See 'snapcraft plugins'

    plugin: dump
    source: Distro/CQtDeployer_@CQT_DEPLOYER_VERSION@_@CMAKE_SYSTEM_NAME@_@CMAKE_SYSTEM_PROCESSOR@.zip

    stage-packages:
      - bash
      - libfreetype6
      - libpng16-16
      - dpkg
      - libwayland-cursor0
      - libxcb-icccm4
      - libxcb-image0
      - libxcb-keysyms1
      - libxcb-render-util0
      - libxcb-xinerama0
      - libfontconfig1
      - libxcb-glx0
      - libx11-xcb1
      - libxcb-randr0
      - libxcb-shape0
      - libxcb-sync1
      - libxcb-xfixes0
      - libxcb-xkb1
      - libxext6
      - libx11-6
      - libxkbcommon-x11-0
      - libxkbcommon0
      - libgl1-mesa-glx

    after: [ cqt-meta ]

    override-stage: |
      snapcraftctl stage
      chmod 777 -R "$SNAPCRAFT_STAGE"

  cqt-meta:
    plugin: dump
    source: src/CQtDeployer/Deploy/snap/

    override-stage: |
      snapcraftctl stage
      chmod 777 -R "$SNAPCRAFT_STAGE"

#  cqt-qifw:
#    plugin: dump
#    source: src/CQtDeployer/Deploy/QIFW/

#    override-stage: |
#      snapcraftctl stage
#      chmod 777 -R "$SNAPCRAFT_STAGE"
