aboutsummaryrefslogtreecommitdiff
path: root/snap/snapcraft.yaml
blob: 19ce2f37e05444e9353f5d06bb698dbdc1c8fa37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
name: whatsie
version: '4.3'
summary: Qt Based WhatsApp Client
description: |
  Fast Light weight WhatsApp Client based on Qt's WebEngine, With lots of settings and packed goodies.

grade: stable
confinement: strict
icon: snap/gui/icon.png
base: core20
compression: lzo

architectures:
  - build-on: amd64
    run-on: amd64

environment:
  SNAP_DESKTOP_RUNTIME: $SNAP/qt515-core20

package-repositories:
  - type: apt
    formats: [deb]
    components: [main]
    suites: [focal]
    key-id: C65D51784EDC19A871DBDBB710C56D0DE9977759
    url: https://ppa.launchpadcontent.net/beineri/opt-qt-5.15.2-focal/ubuntu

apps:
  whatsie:
    command: bin/desktop-launch $SNAP/usr/bin/whatsie
    environment:
       IS_SNAP: 1
       XDG_CURRENT_DESKTOP: $XDG_CURRENT_DESKTOP:Unity:Unity7
       LANG: en_US.UTF-8 # issue 7,21
       QT_QPA_PLATFORMTHEME: gtk3
       NO_AT_BRIDGE: 1 #delay ATK Bridge initialization
    desktop: usr/share/applications/whatsie.desktop
    plugs:
        - browser-support
        - camera
        - desktop
        - desktop-legacy
        - gsettings
        - home
        - opengl
        - audio-playback
        - audio-record
        - removable-media
        - screen-inhibit-control
        - unity7
        - x11
        - network
        - wayland
        - hardware-observe # to assist geoclue & qtpositioning
        - network-observe  # to assist geoclue & qtpositioning
        - network-bind  # to assist geoclue & qtpositioning

plugs:
  gsettings:
  gtk-3-themes:
    interface: content
    target: $SNAP/data-dir/themes
    default-provider: gtk-common-themes
  icon-themes:
    interface: content
    target: $SNAP/data-dir/icons
    default-provider: gtk-common-themes
  sound-themes:
    interface: content
    target: $SNAP/data-dir/sounds
    default-provider: gtk-common-themes
  qt515-core20:
    interface: content
    target: $SNAP/qt515-core20
    default-provider: qt515-core20

parts:
   build-src:
     plugin: nil
     source: https://github.com/keshavbhatt/whatsie.git
     source-subdir: src/
     override-build: |
            snapcraftctl build

            apt install -y build-essential qt515base qt515tools qt515webengine qt515location qt515xmlpatterns libgl1-mesa-dev

            QT_BASE_DIR=/opt/qt515
            export QTDIR=$QT_BASE_DIR
            export PATH=$QT_BASE_DIR/bin:$PATH
            export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/$SNAPCRAFT_ARCH_TRIPLET:$QT_BASE_DIR/lib:${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
            export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}

            mkdir -p ${SNAPCRAFT_PART_INSTALL}/usr/bin/

            /opt/qt515/bin/qmake src

            make -j4

            /opt/qt515/bin/qmake -install qinstall -exe whatsie ${SNAPCRAFT_PART_INSTALL}/usr/bin/whatsie

            strip ${SNAPCRAFT_PART_INSTALL}/usr/bin/whatsie
            
            cp -rf ${SNAPCRAFT_PART_BUILD}/qtwebengine_dictionaries ${SNAPCRAFT_PART_INSTALL}/usr/bin/
            
            sed -i 's|Icon=.*|Icon=${SNAP}/meta/gui/icon.png|g' ${SNAPCRAFT_PART_SRC}/src/whatsie.desktop
            
            mkdir -p ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/
            
            cp -rf ${SNAPCRAFT_PART_SRC}/src/whatsie.desktop ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/whatsie.desktop

   desktop-launch:
     plugin: nil
     source: https://github.com/keshavbhatt/qt515-core20.git
     after: [build-src]
     override-build: |
            snapcraftctl build
            
            mkdir -p ${SNAPCRAFT_PART_INSTALL}/bin/
            
            cp -rf ${SNAPCRAFT_PART_SRC}/snap_launcher/bin/desktop-launch ${SNAPCRAFT_PART_INSTALL}/bin/