name: nymea-app
version: developer-build
summary: Control app for nymea
description: | 
  The nymea daemon is a plugin based IoT (Internet of Things) server. 
  The server works like a translator for devices, things and services 
  and allows them to interact. With the powerful rule engine you are 
  able to connect any device available in the system and create individual 
  scenes and behaviors for your environment.

grade: stable
base: core18
confinement: strict

apps:
  nymea-app:
    command: desktop-launch nymea-app
    desktop: usr/share/applications/nymea-app.desktop
    environment:
        DISABLE_WAYLAND: 1    
    plugs:
    - avahi-observe
    - bluez
    - network
    - opengl
    - x11
    - desktop
    - desktop-legacy

parts:
  desktop-qt5:
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: qt
    plugin: make
    make-parameters: ["FLAVOR=qt5"]
    build-packages:
      - build-essential
      - qtbase5-dev
      - dpkg-dev
    stage-packages:
      - libxkbcommon0
      - ttf-ubuntu-font-family
      - dmz-cursor-theme
      - light-themes
      - adwaita-icon-theme
      - gnome-themes-standard
      - shared-mime-info
      - libqt5gui5
      - libgdk-pixbuf2.0-0
      - libqt5svg5 # for loading icon themes which are svg
      - try: [appmenu-qt5] # not available on core18
      - locales-all
      - xdg-user-dirs
      - fcitx-frontend-qt5

  nymea-app:
    plugin: qmake
    source: .
    after: [desktop-qt5]
    project-files: [ nymea-app.pro ]
    build-packages:
      - execstack
      - qt5-default
      - qt5-qmake
      - qtbase5-dev
      - libavahi-client-dev
      - libavahi-common-dev
      - libqt5charts5-dev
      - libqt5svg5-dev
      - libqt5websockets5-dev
      - libqt5webview5-dev
      - qtconnectivity5-dev
      - qtdeclarative5-dev
      - qtquickcontrols2-5-dev
      - qttools5-dev-tools
    stage-packages:
      - libqt5gui5
      - libqt5websockets5
      - libqt5bluetooth5
      - libqt5nfc5
      - libgl1-mesa-dri
      - qml-module-qtcharts
      - qml-module-qtgraphicaleffects
      - qml-module-qtquick2
      - qml-module-qtquick-controls2
      - qml-module-qtquick-layouts
      - qml-module-qtquick-window2
      - qml-module-qt-labs-calendar
      - qml-module-qt-labs-settings
      - qml-module-qt-labs-folderlistmodel
      - libavahi-client3
      - libavahi-common3
      - qtvirtualkeyboard-plugin
      - qtwayland5
