forked from Warzone2100/warzone2100
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.snapcraft.yaml
221 lines (209 loc) · 5.88 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
name: warzone2100 # no spaces, all lower-case
# summary, description, and icon are parsed from the appdata/metainfo file
adopt-info: warzone2100
confinement: strict
grade: stable
base: core18
# Enable LZO compression for the snap
compression: lzo
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
plugs:
wz2100-sequences:
interface: content
content: wz2100-sequences
target: $SNAP/usr/share/warzone2100/sequences
default-provider: warzone2100-videos
apps:
warzone2100:
command: usr/bin/warzone2100
command-chain: [bin/desktop-launch]
common-id: warzone2100 # should match the appdata/metainfo file's <id> field
desktop: usr/share/applications/warzone2100.desktop
plugs:
- audio-playback
- desktop
- desktop-legacy
- network
- network-bind
- opengl
- pulseaudio
- unity7
- wayland
- x11
download-videos:
command: bin/download-videos
plugs: [network]
parts:
scripts:
plugin: dump
source: pkg/snap
organize:
download-videos: bin/download-videos
stage-packages:
- curl
desktop-qt5:
source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt5"]
build-packages:
- qtbase5-dev
- dpkg-dev
stage-packages:
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libgdk-pixbuf2.0-0
- libqt5svg5 # for loading icon themes which are svg
- qtwayland5
- try: [appmenu-qt5] # not available on core18
- locales-all
- libgtk2.0-0
sdl:
source: https://www.libsdl.org/release/SDL2-2.0.14.tar.gz
source-checksum: sha512/ebc482585bd565bf3003fbcedd91058b2183e333b9ea566d2f386da0298ff970645d9d25c1aa4459c7c96e9ea839fd1c5f2da0242a56892865b2e456cdd027ee
plugin: autotools
configflags:
- --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
- libxext-dev
- libxi-dev
- libxinerama-dev
- libxkbcommon-dev
- libxrandr-dev
- libxrender-dev
- libxss-dev
- libxxf86vm-dev
stage-packages:
- libdbus-1-3
- libudev1
- fcitx-libs
- libdrm2
- libegl1-mesa
- libgl1
- libgles2
- libibus-1.0-5
- libjack0
- libpulse0
- libsamplerate0
- libts0
- libsndfile1
- libwayland-client0
- libwayland-egl1-mesa
- libvulkan1
- libx11-6
- libxcursor1
- libxext6
- libxi6
- libxinerama1
- libxkbcommon0
- libxrandr2
- libxrender1
- libxss1
- libxxf86vm1
warzone2100:
after: [desktop-qt5, 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/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
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/warzone2100.desktop
build-packages:
- asciidoctor
- g++
- gettext
- libfontconfig1-dev
- libfreetype6-dev
- libfribidi-dev
- libglc-dev
- libharfbuzz-dev
- libopenal-dev
- libphysfs-dev
- libpng-dev
- libtheora-dev
- libvorbis-dev
- libcurl4-gnutls-dev
- libgnutls28-dev
- libsodium-dev
- libsqlite3-dev
- ninja-build
- unzip
- wget
- zip
stage-packages:
- libfontconfig1
- libfreetype6
- libfribidi0
- libglc0
- libharfbuzz0b
- libogg0
- libopenal1
- libphysfs1
- libpng16-16
- libtheora0
- libvorbis0a
- libvorbisenc2
- libvorbisfile3
- libvulkan1
- libcurl3-gnutls
- libsodium23
- libsqlite3-0
- libglu1-mesa
- mesa-vulkan-drivers
- unzip
- zip