~sameersharma2006/lutris-snap/lutris-snap

« back to all changes in this revision

Viewing changes to snapcraft.yaml

  • Committer: Sameer Sharma
  • Date: 2023-07-29 16:31:47 UTC
  • Revision ID: noreply@user.com-20230729163147-6l28695aq9x4j0ti
Start Preservation

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
name: lutris
 
2
confinement: strict
 
3
base: core18
 
4
grade: stable
 
5
adopt-info: lutris
 
6
 
 
7
architectures:
 
8
  - build-on: amd64
 
9
  - build-on: i386
 
10
 
 
11
# package-repositories:
 
12
#   - type: apt
 
13
#     deb-types: [deb]
 
14
#     components: [main]
 
15
#     suites: [$SNAPCRAFT_APT_RELEASE]
 
16
#     key-id: 76F1A20FF987672F
 
17
#     url: https://dl.winehq.org/wine-builds/ubuntu/
 
18
 
 
19
parts:
 
20
  extensible-hooks:
 
21
    plugin: dump
 
22
    source: https://github.com/diddlesnaps/snapcraft-utils-library.git
 
23
    source-subdir: snapcraft-assets/extensible-hooks
 
24
 
 
25
  ld-precache:
 
26
    after:
 
27
      - extensible-hooks
 
28
      - gnome-extension-hack
 
29
      - lutris
 
30
      - lutris-runtime
 
31
    plugin: dump
 
32
    source: https://github.com/diddlesnaps/snapcraft-utils-library.git
 
33
    source-subdir: snapcraft-assets/ld-precache
 
34
 
 
35
  enable-i386:
 
36
    plugin: nil
 
37
    override-build: |
 
38
      snapcraftctl build
 
39
      if [ "$SNAPCRAFT_ARCH_TRIPLET" = "x86_64-linux-gnu" ]; then
 
40
        dpkg --add-architecture i386
 
41
        apt update
 
42
      fi
 
43
 
 
44
  gnome-extension-hack:
 
45
    plugin: dump
 
46
    source: .
 
47
    override-pull: |
 
48
      cat <<'EOF' > gnome-extension-hack
 
49
      #!/bin/sh
 
50
      rm -f "$XDG_DATA_HOME/icons/hicolor/"* || true
 
51
      if [ "$SNAP_ARCH" = "amd64" ]; then
 
52
        export LD_LIBRARY_PATH="$SNAP/usr/lib/i386-linux-gnu:$SNAP/lib/i386-linux-gnu:$LD_LIBRARY_PATH"
 
53
 
 
54
        export LIBGL_DRIVERS_PATH="$LIBGL_DRIVERS_PATH:$SNAP/usr/lib/i386-linux-gnu/dri"
 
55
        export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$LIBGL_DRIVERS_PATH"
 
56
        export LIBVA_DRIVERS_PATH="$SNAP/usr/lib/i386-linux-gnu/dri"
 
57
      fi
 
58
      exec "$@"
 
59
      EOF
 
60
      chmod +x gnome-extension-hack
 
61
    organize:
 
62
      gnome-extension-hack: bin/gnome-extension-hack
 
63
 
 
64
  lutris:
 
65
    after: [enable-i386]
 
66
    plugin: python
 
67
    python-version: python3
 
68
    source: https://github.com/lutris/lutris.git
 
69
    parse-info: [share/metainfo/net.lutris.Lutris.metainfo.xml]
 
70
    override-pull: |
 
71
      snapcraftctl pull
 
72
      sed -i 's|Icon=.*|Icon=${SNAP}/share/icons/hicolor/scalable/apps/lutris.svg|' share/applications/net.lutris.Lutris.desktop
 
73
    build-packages:
 
74
      - gobject-introspection
 
75
      - libgirepository1.0-dev
 
76
      - python3
 
77
      - python3-gi
 
78
      - python3-pil
 
79
      - python3-requests
 
80
      - python3-setproctitle
 
81
      - python3-yaml
 
82
  
 
83
  lutris-runtime:
 
84
    after: [enable-i386]
 
85
    plugin: nil
 
86
    stage-packages:
 
87
      - cabextract
 
88
      - curl
 
89
      - fluid-soundfont-gs
 
90
      - gir1.2-glib-2.0
 
91
      - gir1.2-gnomedesktop-3.0
 
92
      - gir1.2-gtk-3.0
 
93
      - gir1.2-notify-0.7
 
94
      - gir1.2-webkit2-4.0
 
95
      - libgnutls30
 
96
      - libvulkan1
 
97
      - libxrandr2
 
98
      - mesa-utils
 
99
      - p7zip
 
100
      - psmisc
 
101
      - python3
 
102
      - python3-dbus
 
103
      - python3-gi
 
104
      - python3-pil
 
105
      - python3-requests
 
106
      - python3-setproctitle
 
107
      - python3-yaml
 
108
      - unzip
 
109
      - wine
 
110
      - x11-xserver-utils
 
111
      - xterm
 
112
      - xz-utils
 
113
      - on amd64:
 
114
          - lib32gcc1
 
115
          - libc6-i386
 
116
          - libglu1-mesa:i386
 
117
          - libglvnd0:i386
 
118
          - libglx-mesa0:i386
 
119
          - libgnutls30:i386
 
120
          - libvulkan1:i386
 
121
          - libx11-6:i386
 
122
          - x11-xserver-utils:i386
 
123
    stage:
 
124
      - -lib/ld-linux.so.2
 
125
      - -usr/bin/cpp-7
 
126
      - -usr/lib/*/libjavascript*
 
127
      - -usr/lib/*/libwebkit*
 
128
      - -usr/share/doc/cpp/README.Debian
 
129
      - -usr/share/man/man1/cpp-7.1.gz
 
130
 
 
131
hooks:
 
132
  install:
 
133
    command-chain:
 
134
      - snap/command-chain/snapcraft-runner
 
135
      - snap/command-chain/desktop-launch
 
136
      - bin/gnome-extension-hack
 
137
  post-refresh:
 
138
    command-chain:
 
139
      - snap/command-chain/snapcraft-runner
 
140
      - snap/command-chain/desktop-launch
 
141
      - bin/gnome-extension-hack
 
142
 
 
143
layout:
 
144
  /etc/ld.so.cache:
 
145
    bind-file: $SNAP_DATA/etc/ld.so.cache
 
146
 
 
147
slots:
 
148
  dbus-lutris:
 
149
    interface: dbus
 
150
    bus: session
 
151
    name: net.lutris.Lutris
 
152
 
 
153
environment:
 
154
  HOME: $SNAP_USER_COMMON
 
155
 
 
156
apps:
 
157
  lutris:
 
158
    command: bin/gnome-extension-hack $SNAP/usr/bin/python3 $SNAP/bin/lutris -d
 
159
    extensions: [gnome-3-28]
 
160
    desktop: share/applications/net.lutris.Lutris.desktop
 
161
    common-id: net.lutris.Lutris
 
162
    plugs:
 
163
      - audio-playback
 
164
      - browser-support
 
165
      - daemon-notify
 
166
      - desktop
 
167
      - desktop-legacy
 
168
      - gsettings
 
169
      - hardware-observe
 
170
      - home
 
171
      - io-ports-control
 
172
      - joystick
 
173
      - kvm
 
174
      - libvirt
 
175
      - mount-observe
 
176
      - network
 
177
      - network-bind
 
178
      - network-manager
 
179
      - opengl
 
180
      - pulseaudio
 
181
      - removable-media
 
182
      - screen-inhibit-control
 
183
      - unity7
 
184
      - wayland
 
185
      - x11
 
186
    slots:
 
187
      - dbus-lutris
 
188
 
 
189
  # wine:
 
190
  #   extensions: [gnome-3-28]
 
191
  #   command: usr/bin/wine-stable
 
192
  
 
193
  # wine64:
 
194
  #   extensions: [gnome-3-28]
 
195
  #   command: usr/bin/wine64-stable
 
196
  
 
197
  # winecfg:
 
198
  #   extensions: [gnome-3-28]
 
199
  #   command: usr/bin/winecfg-stable