-
Notifications
You must be signed in to change notification settings - Fork 8
/
snapcraft.yaml
276 lines (265 loc) · 8.71 KB
/
snapcraft.yaml
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
name: tmnationsforever
version: '2.11.26'
summary: Track Mania Nations Forever
description: |
The most popular online PC racing game. It fuels 7 different racing
environments; hundreds of thousands of tracks and millions of players to
compete with. You can download the car you are dreaming of, paint it, drive it
through insane tracks made of loopings, ramps and off roads. It is all about
you, your driving skills and the track in front of you.
.
Just to make sure we understand each other: this is pure arcade driving
madness.
grade: stable
confinement: strict
architectures:
- build-on: amd64
run-on: [amd64, i386]
apps:
tmnationsforever:
command: bin/sommelier "$WINEPREFIX/drive_c/Program Files/TmNationsForever/TmForever.exe"
environment:
WINEPREFIX: "$SNAP_USER_COMMON/.wine"
DLLOVERRIDES: "mscoree,mshtml=" # Prevent pop-ups about Wine Mono and Wine Gecko
INSTALL_URL: "http:https://files.trackmaniaforever.com/tmnationsforever_setup.exe"
VIRTDESKTOP: 1
LC_ALL: "C.UTF-8"
plugs:
- desktop
- desktop-legacy
- hardware-observe
- home
- joystick
- network
- network-bind
- opengl
- pulseaudio
- wayland
- x11
launcher:
command: bin/sommelier "$WINEPREFIX/drive_c/Program Files/TmNationsForever/TmForeverLauncher.exe"
environment:
WINEPREFIX: "$SNAP_USER_COMMON/.wine"
DLLOVERRIDES: "mscoree,mshtml=" # Prevent pop-ups about Wine Mono and Wine Gecko
INSTALL_URL: "http:https://files.trackmaniaforever.com/tmnationsforever_setup.exe"
VIRTDESKTOP: 1
LC_ALL: "C.UTF-8"
plugs:
- desktop
- desktop-legacy
- hardware-observe
- home
- joystick
- network
- network-bind
- opengl
- pulseaudio
- wayland
- x11
wineboot:
command: bin/sommelier $SNAP/bin/wineboot
environment:
WINEPREFIX: "$SNAP_USER_COMMON/.wine"
plugs:
- desktop
- desktop-legacy
- pulseaudio
- wayland
- x11
winecfg:
command: bin/sommelier $SNAP/bin/winecfg
environment:
WINEPREFIX: "$SNAP_USER_COMMON/.wine"
plugs:
- desktop
- desktop-legacy
- pulseaudio
- wayland
- x11
winetricks:
command: bin/sommelier $SNAP/bin/winetricks prefix="$WINEPREFIX"
environment:
WINEPREFIX: "$SNAP_USER_COMMON/.wine"
LC_ALL: "C.UTF-8"
plugs:
- desktop
- desktop-legacy
- network
- pulseaudio
- wayland
- x11
parts:
enable-i386:
plugin: nil
build-attributes:
- no-system-libraries
build-packages:
# This snap is build on amd64 only
- on amd64:
- apt
- dpkg
- else fail
override-build: |
snapcraftctl build
dpkg --add-architecture i386
apt update
wine:
plugin: nil
build-attributes:
- no-system-libraries
build-packages:
- dpkg
- wget
override-build: |
snapcraftctl build
WINE_REL="wine-devel"
WINE_ARCH="i386"
WINE_VER="3.10.0"
# wget and dpkg extract the wine debs
DEB_URLS="https://dl.winehq.org/wine-builds/ubuntu/pool/main/${WINE_REL}-${WINE_ARCH}_${WINE_VER}~xenial_${WINE_ARCH}.deb \
https://dl.winehq.org/wine-builds/ubuntu/pool/main/${WINE_REL}_${WINE_VER}~xenial_${WINE_ARCH}.deb"
for DEB_URL in ${DEB_URLS}; do
DEB=$(basename "${DEB_URL}")
echo "Downloading ${DEB_URL}..."
wget --quiet "${DEB_URL}" -O "${SNAPCRAFT_PART_INSTALL}/${DEB}"
echo "Unpacking ${DEB}..."
dpkg -x "${SNAPCRAFT_PART_INSTALL}/${DEB}" ${SNAPCRAFT_PART_INSTALL}
rm -f "${SNAPCRAFT_PART_INSTALL}/${DEB}"
done
# Organise
cp -a ${SNAPCRAFT_PART_INSTALL}/opt/${WINE_REL}/* ${SNAPCRAFT_PART_INSTALL}/
# Cleanup
rm -rf ${SNAPCRAFT_PART_INSTALL}/opt
rm -rf ${SNAPCRAFT_PART_INSTALL}/share/applications
rm -rf ${SNAPCRAFT_PART_INSTALL}/share/man
rm -rf ${SNAPCRAFT_PART_INSTALL}/usr/share/doc
rm -rf ${SNAPCRAFT_PART_INSTALL}/usr/share/lintian
after:
- enable-i386
wine-runtime:
plugin: nil
build-attributes:
- no-system-libraries
stage-packages:
### Depends from wine-devel-i386_x.y.z~xenial_i386.deb debian/control
- libasound2:i386
- libc6:i386
- libglib2.0-0:i386
#- libgphoto2-6:i386
- libgstreamer-plugins-base1.0-0:i386
- liblcms2-2:i386
- libldap-2.4-2:i386
- libmpg123-0:i386
- libncurses5:i386
- libopenal1:i386
- libpcap0.8:i386
- libpulse0:i386
- libudev1:i386
- libxext6:i386
- libxml2:i386
- zlib1g:i386
### Recommends from wine-devel-i386_x.y.z~xenial_i386.deb debian/control
#- libcapi20-3:i386
#- libcups2:i386
- libdbus-1-3:i386
- libfontconfig1:i386
- libfreetype6:i386
- libglu1-mesa:i386
- libgnutls30:i386
- libgsm1:i386
- libgssapi-krb5-2:i386
- libjpeg8:i386
#- libodbc1:i386
- libosmesa6:i386
- libpng12-0:i386
#- libsane:i386
- libsdl2-2.0-0:i386
- libtiff5:i386
- libv4l-0:i386
- libvulkan1:i386
- libxcomposite1:i386
- libxcursor1:i386
- libxfixes3:i386
- libxi6:i386
- libxinerama1:i386
- libxrandr2:i386
- libxrender1:i386
- libxslt1.1:i386
- libxxf86vm1:i386
# Required for authentication - Observed in Steam and Track Mania
- winbind:i386
- samba-libs:i386
override-build: |
snapcraftctl build
rm -rf $SNAPCRAFT_PART_INSTALL/etc/init
rm -rf $SNAPCRAFT_PART_INSTALL/etc/init.d
rm -rf $SNAPCRAFT_PART_INSTALL/etc/logrotate.d
rm -rf $SNAPCRAFT_PART_INSTALL/lib/x86_64-linux-gnu
rm -rf $SNAPCRAFT_PART_INSTALL/usr/lib/x86_64-linux-gnu
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/apps
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/applications
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/bug
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/doc
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/doc-base
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/debhelper
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/lintian
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/man
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/pkgconfig
after:
- enable-i386
tmnationsforever:
plugin: dump
build-attributes:
- no-system-libraries
source: snap/scripts
organize:
'sommelier': bin/
'winetricks': bin/
'zenity': bin/
stage-packages:
- cabextract:i386 # winetricks
- libgdk-pixbuf2.0-0:i386 # yad
- libgtk-3-0:i386 # yad
- libnotify4:i386 # yad
- libnotify-bin:i386 # sommelier
- perl-base:i386 # winetricks
- shared-mime-info:i386
- unzip:i386 # winetricks
- wget:i386 # winetricks
- x11-xserver-utils:i386 # sommelier
- yad:i386 # winetricks
override-build: |
snapcraftctl build
rm -rf $SNAPCRAFT_PART_INSTALL/etc/init
rm -rf $SNAPCRAFT_PART_INSTALL/etc/init.d
rm -rf $SNAPCRAFT_PART_INSTALL/etc/logrotate.d
rm -rf $SNAPCRAFT_PART_INSTALL/usr/bin/fc-*
rm -rf $SNAPCRAFT_PART_INSTALL/usr/bin/gtk-*
rm -rf $SNAPCRAFT_PART_INSTALL/usr/lib/dconf/dconf-service
rm -rf $SNAPCRAFT_PART_INSTALL/usr/lib/glib-networking/glib-pacrunner
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/GConf
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/aclocal
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/apport
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/apps
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/bash-completion
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/bug
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/debhelper
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/doc
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/doc-base
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/icons/Adwaita
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/icons/Humanity*
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/icons/LoginIcons
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/icons/ubuntu-mono*
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/info
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/kde4
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/lintian
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/menu
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/man
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/perl5
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps
rm -rf $SNAPCRAFT_PART_INSTALL/usr/share/pkgconfig
rm -rf $SNAPCRAFT_PART_INSTALL/lib/x86_64-linux-gnu
rm -rf $SNAPCRAFT_PART_INSTALL/usr/lib/x86_64-linux-gnu
after:
- enable-i386