1name: spotify-qt
2summary: Lightweight Spotify client using Qt
3description: A Spotify client using Qt as a simpler, lighter alternative to the official client, inspired by spotify-tui.
4adopt-info: spotify-qt
5license: GPL-3.0
6grade: stable
7confinement: strict
8base: core18
9icon: snap/gui/icon.png
10
11parts:
12  spotify-qt:
13    plugin: cmake
14    source: .
15    build-packages:
16      - g++
17      - make
18      - cmake
19      - qt5-default
20      - libqt5svg5-dev
21    stage-packages:
22      - qt5-default
23      - libqt5svg5-dev
24    override-pull: |
25      snapcraftctl pull
26      snapcraftctl set-version "$(git describe --tags --abbrev=0)"
27    override-build: |
28            snapcraftctl build
29            sed -i 's|Icon=.*|Icon=${SNAP}/meta/gui/icon.png|g' ${SNAPCRAFT_PART_SRC}/res/app/spotify-qt.desktop
30            mkdir -p ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/
31            cp -rf ${SNAPCRAFT_PART_SRC}/res/app/spotify-qt.desktop ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/spotify-qt.desktop
32    after: [desktop-qt5]
33  # Snapcraft Qt5 desktop launcher
34  desktop-qt5:
35    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
36    source-subdir: qt
37    plugin: make
38    make-parameters: ["FLAVOR=qt5"]
39    build-packages:
40      - build-essential
41      - qtbase5-dev
42      - dpkg-dev
43    stage-packages:
44      - libxkbcommon0
45      - ttf-ubuntu-font-family
46      - dmz-cursor-theme
47      - light-themes
48      - adwaita-icon-theme
49      - gnome-themes-standard
50      - shared-mime-info
51      - libqt5gui5
52      - libgdk-pixbuf2.0-0
53      - libqt5svg5 # for loading icon themes which are svg
54      - try: [appmenu-qt5] # not available on core18
55      - locales-all
56      - xdg-user-dirs
57      - fcitx-frontend-qt5
58      - qt5-gtk-platformtheme #Platform themes plugin
59
60slots:
61  dbus-mpris:
62    interface: dbus
63    bus: session
64    name: org.mpris.MediaPlayer2.spotify-qt
65
66plugs:
67  gsettings:
68  gtk-3-themes:
69    interface: content
70    target: $SNAP/data-dir/themes
71    default-provider: gtk-common-themes
72  icon-themes:
73    interface: content
74    target: $SNAP/data-dir/icons
75    default-provider: gtk-common-themes
76  sound-themes:
77    interface: content
78    target: $SNAP/data-dir/sounds
79    default-provider: gtk-common-themes
80
81apps:
82  spotify-qt:
83    command: bin/desktop-launch spotify-qt
84    environment:
85      DISABLE_WAYLAND: 1
86    desktop: usr/share/applications/spotify-qt.desktop
87    plugs: [home, opengl, network, network-bind, unity7, gsettings, desktop, audio-playback]
88    slots: [dbus-mpris]
89