forked from Warzone2100/warzone2100
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.snapcraft.yaml
233 lines (222 loc) · 7.24 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
name: warzone2100 # no spaces, all lower-case
# summary, description, and icon are parsed from the appdata/metainfo file
adopt-info: warzone2100 # specify the *part* name
confinement: strict
grade: stable
base: core20
# Enable LZO compression for the snap
compression: lzo
# Limit architectures to those supported by the gnome extension (and future core20)
# NOTE: Specify these as separate build-on lines to ensure separate architecture builds that each support a single architecture
architectures:
- build-on: amd64
- build-on: arm64
- build-on: armhf
layout:
/usr/share/vulkan:
symlink: $SNAP/usr/share/vulkan
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_intel.so:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_intel.so
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_radeon.so:
symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_radeon.so
# # Try the following once base is updated to core22
# /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_broadcom.so:
# symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_broadcom.so
# /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_freedreno.so:
# symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_freedreno.so
# /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_lvp.so:
# symlink: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libvulkan_lvp.so
plugs:
wz2100-sequences:
interface: content
content: wz2100-sequences
target: $SNAP/usr/share/warzone2100/sequences
default-provider: warzone2100-videos
apps:
warzone2100:
extensions: [gnome-3-38]
command: usr/bin/warzone2100
common-id: net.wz2100.warzone2100 # should match the appdata/metainfo file's <id> field
desktop: usr/share/applications/net.wz2100.warzone2100.desktop
plugs:
- audio-playback
- desktop
- desktop-legacy
- network
- network-bind
- opengl
- pulseaudio
- unity7
- wayland
- x11
parts:
sdl:
source: https://www.libsdl.org/release/SDL2-2.0.20.tar.gz
source-checksum: sha512/4889949eaa674948bdb0a01bb2a842a0943b15b08ff27ec0079b0fd4f79d071ffb32488a5a51c12ad7c74ed5fe73b608cdf6336a44c95dae8a0fb3f47d0f01de
plugin: autotools
autotools-configure-parameters:
- --prefix=/usr
- --disable-alsa
- --disable-arts
- --disable-esd
- --disable-nas
- --disable-oss
override-build: |
snapcraftctl build
sed -i 's|"/usr"|"'"$SNAPCRAFT_STAGE/usr"'"|g' "$SNAPCRAFT_PART_INSTALL/usr/lib/cmake/SDL2/sdl2-config.cmake"
build-packages:
- git
- libdbus-1-dev
- libudev-dev
- fcitx-libs-dev
- libegl1-mesa-dev
- libgl1-mesa-dev
- libgles2-mesa-dev
- libibus-1.0-dev
- libjack-dev
- libpulse-dev
- libsamplerate0-dev
- libsndfile1-dev
- libts-dev
- libvulkan-dev
- libwayland-dev
- libx11-dev
- libxcursor-dev
- libxfixes-dev
- libxext-dev
- libxi-dev
- libxinerama-dev
- libxkbcommon-dev
- libxrandr-dev
- libxrender-dev
- libxss-dev
- libxxf86vm-dev
- libgbm-dev
stage-packages:
- libdbus-1-3
- libudev1
- fcitx-libs
- libdrm2
- libgbm1
- libegl1-mesa
- libgl1
- libgles2
- libibus-1.0-5
- libjack0
- libpulse0
- libsamplerate0
- libts0
- libsndfile1
- libwayland-client0
- libwayland-cursor0
- libwayland-egl1-mesa
- libvulkan1
- libx11-6
- libxcursor1
- libxext6
- libxfixes3
- libxi6
- libxinerama1
- libxkbcommon0
- libxrandr2
- libxrender1
- libxss1
- libxxf86vm1
warzone2100:
after: [sdl]
plugin: cmake
source: .
parse-info:
# Parse this appdata/metainfo file for summary, description,
# and icon. Use the installed path relative to the Snap's root
- usr/share/metainfo/net.wz2100.warzone2100.appdata.xml
override-pull: |
snapcraftctl pull
SNAP_VERSION_DESC=$(git describe --always | sed 's/[^a-zA-Z0-9\.\:\+\~\-]/~/g')
snapcraftctl set-version "${SNAP_VERSION_DESC}"
git submodule update --init
override-build: |
echo "SNAPCRAFT_TARGET_ARCH=${SNAPCRAFT_TARGET_ARCH}"
echo "SNAPCRAFT_ARCH_TRIPLET=${SNAPCRAFT_ARCH_TRIPLET}"
# Install Vulkan SDK
. "${SNAPCRAFT_PART_SRC}/.ci/snap/install_vulkan_sdk.sh"
if [ -f ".snapenv" ]; then set -a; source .snapenv; set +a; fi
set +u
if [ -z "$WZ_DISTRIBUTOR" ]; then export WZ_DISTRIBUTOR="UNKNOWN"; fi
cmake -S "$SNAPCRAFT_PART_SRC" -B. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DWZ_ENABLE_WARNINGS:BOOL=ON -DWZ_DISTRIBUTOR:STRING="${WZ_DISTRIBUTOR}" -DWZ_OUTPUT_NAME_SUFFIX="${WZ_OUTPUT_NAME_SUFFIX}" -DWZ_NAME_SUFFIX="${WZ_NAME_SUFFIX}" -G"Ninja"
cmake --build . -- -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
DESTDIR=$SNAPCRAFT_PART_INSTALL cmake --build . -- install
# Include the icon's path in the desktop file, not just the name.
# This needs to happen post-build or the build versioning will show as "modified locally"
sed -i -E 's|Icon=(.*)|Icon=/usr/share/icons/\1.png|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/net.wz2100.warzone2100.desktop
build-packages:
- asciidoctor
- g++
- gettext
- libfontconfig1-dev
- libfreetype-dev
- libfribidi-dev
- libharfbuzz-dev
- libopenal-dev
- libphysfs-dev
- libpng-dev
- libtheora-dev
- libogg-dev
- libopus-dev
- libvorbis-dev
- libcurl4-gnutls-dev
- libgnutls28-dev
- libsodium-dev
- libsqlite3-dev
- ninja-build
- unzip
- wget
- zip
stage-packages:
- libfontconfig1
- libfreetype6
- libfribidi0
- libharfbuzz0b
- libogg0
- libopenal1
- libopus0
- libphysfs1
- libpng16-16
- libtheora0
- libvorbis0a
- libvorbisenc2
- libvorbisfile3
- libvulkan1
- libcurl3-gnutls
- libsodium23
- libsqlite3-0
- libglu1-mesa
- mesa-vulkan-drivers
- unzip
- zip
# This part removes all the files in this snap which already exist in
# connected content and base snaps. Since these files will be available
# at runtime from the content and base snaps, they do not need to be
# included in this snap itself.
#
# More info: https://forum.snapcraft.io/t/reducing-the-size-of-desktop-snaps/17280#heading--cleanup-part
#
cleanup:
after: # Make this part run last; list all your other parts here
- sdl
- warzone2100
plugin: nil
build-snaps: # List all content-snaps and base snaps you're using here
- core20
- gtk-common-themes
- gnome-3-38-2004
override-prime: |
set -eux
for snap in "core20" "gtk-common-themes" "gnome-3-38-2004"; do # List all content-snaps and base snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
done
# The following is required while using core18 + gnome-3-34
# See: https://forum.snapcraft.io/t/undefined-symbol-hb-buffer-set-invisible-glyph-with-gnome-3-34/24287
rm -f $SNAPCRAFT_PRIME/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libharfbuzz.so.0*
rm -f $SNAPCRAFT_PRIME/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libgio-2.0.so.0*
rm -f $SNAPCRAFT_PRIME/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libglib-2.0.so.0*