app-builder-lib 26.13.1 → 26.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/helpers/dynamic-import.js +24 -7
  2. package/out/asar/asarFileChecker.js.map +1 -1
  3. package/out/configuration.d.ts +11 -0
  4. package/out/configuration.js.map +1 -1
  5. package/out/electron/ElectronFramework.js +1 -5
  6. package/out/electron/ElectronFramework.js.map +1 -1
  7. package/out/frameworks/LibUiFramework.d.ts +25 -0
  8. package/out/frameworks/LibUiFramework.js +107 -19
  9. package/out/frameworks/LibUiFramework.js.map +1 -1
  10. package/out/mac/MacTargetHelper.d.ts +7 -2
  11. package/out/mac/MacTargetHelper.js +13 -10
  12. package/out/mac/MacTargetHelper.js.map +1 -1
  13. package/out/macPackager.js +2 -3
  14. package/out/macPackager.js.map +1 -1
  15. package/out/node-module-collector/moduleManager.d.ts +6 -0
  16. package/out/node-module-collector/moduleManager.js +65 -55
  17. package/out/node-module-collector/moduleManager.js.map +1 -1
  18. package/out/node-module-collector/nodeModulesCollector.d.ts +17 -8
  19. package/out/node-module-collector/nodeModulesCollector.js +87 -61
  20. package/out/node-module-collector/nodeModulesCollector.js.map +1 -1
  21. package/out/node-module-collector/pnpmNodeModulesCollector.js +7 -5
  22. package/out/node-module-collector/pnpmNodeModulesCollector.js.map +1 -1
  23. package/out/options/linuxOptions.d.ts +10 -0
  24. package/out/options/linuxOptions.js.map +1 -1
  25. package/out/options/macOptions.d.ts +41 -2
  26. package/out/options/macOptions.js.map +1 -1
  27. package/out/packager.d.ts +0 -4
  28. package/out/packager.js +0 -19
  29. package/out/packager.js.map +1 -1
  30. package/out/platformPackager.d.ts +1 -5
  31. package/out/platformPackager.js +9 -31
  32. package/out/platformPackager.js.map +1 -1
  33. package/out/targets/FpmTarget.js +6 -5
  34. package/out/targets/FpmTarget.js.map +1 -1
  35. package/out/targets/LinuxTargetHelper.d.ts +2 -1
  36. package/out/targets/LinuxTargetHelper.js +23 -0
  37. package/out/targets/LinuxTargetHelper.js.map +1 -1
  38. package/out/targets/MsiTarget.js +2 -1
  39. package/out/targets/MsiTarget.js.map +1 -1
  40. package/out/targets/appimage/AppImageTarget.js +6 -1
  41. package/out/targets/appimage/AppImageTarget.js.map +1 -1
  42. package/out/targets/appimage/appImageUtil.d.ts +4 -2
  43. package/out/targets/appimage/appImageUtil.js +2 -2
  44. package/out/targets/appimage/appImageUtil.js.map +1 -1
  45. package/out/targets/archive.d.ts +0 -1
  46. package/out/targets/archive.js +60 -88
  47. package/out/targets/archive.js.map +1 -1
  48. package/out/targets/blockmap/blockmap.d.ts +16 -0
  49. package/out/targets/blockmap/blockmap.js +153 -0
  50. package/out/targets/blockmap/blockmap.js.map +1 -0
  51. package/out/targets/differentialUpdateInfoBuilder.js +3 -3
  52. package/out/targets/differentialUpdateInfoBuilder.js.map +1 -1
  53. package/out/targets/nsis/NsisTarget.js +6 -12
  54. package/out/targets/nsis/NsisTarget.js.map +1 -1
  55. package/out/targets/nsis/nsisValidation.js +5 -4
  56. package/out/targets/nsis/nsisValidation.js.map +1 -1
  57. package/out/targets/pkg.d.ts +13 -0
  58. package/out/targets/pkg.js +34 -9
  59. package/out/targets/pkg.js.map +1 -1
  60. package/out/targets/snap/core24.js +4 -3
  61. package/out/targets/snap/core24.js.map +1 -1
  62. package/out/targets/snap/coreLegacy.d.ts +23 -0
  63. package/out/targets/snap/coreLegacy.js +161 -23
  64. package/out/targets/snap/coreLegacy.js.map +1 -1
  65. package/out/toolsets/7zip.d.ts +2 -0
  66. package/out/toolsets/7zip.js +72 -0
  67. package/out/toolsets/7zip.js.map +1 -0
  68. package/out/toolsets/icons.d.ts +8 -0
  69. package/out/toolsets/icons.js +37 -0
  70. package/out/toolsets/icons.js.map +1 -0
  71. package/out/toolsets/wine.d.ts +5 -0
  72. package/out/toolsets/wine.js +100 -0
  73. package/out/toolsets/wine.js.map +1 -0
  74. package/out/util/electronGet.js +36 -5
  75. package/out/util/electronGet.js.map +1 -1
  76. package/out/util/iconConverter.d.ts +25 -0
  77. package/out/util/iconConverter.js +260 -0
  78. package/out/util/iconConverter.js.map +1 -0
  79. package/out/util/packageDependencies.d.ts +0 -6
  80. package/out/util/packageDependencies.js +0 -17
  81. package/out/util/packageDependencies.js.map +1 -1
  82. package/out/util/yarn.d.ts +0 -3
  83. package/out/util/yarn.js +3 -15
  84. package/out/util/yarn.js.map +1 -1
  85. package/out/version.d.ts +1 -1
  86. package/out/version.js +1 -1
  87. package/out/version.js.map +1 -1
  88. package/out/vm/WineVm.d.ts +5 -2
  89. package/out/vm/WineVm.js +19 -5
  90. package/out/vm/WineVm.js.map +1 -1
  91. package/out/vm/vm.js.map +1 -1
  92. package/package.json +10 -9
  93. package/scheme.json +39 -4
  94. package/templates/snap/desktop-common.sh +444 -0
  95. package/templates/snap/desktop-gnome-specific.sh +31 -0
  96. package/templates/snap/desktop-init.sh +52 -0
  97. package/out/util/appBuilder.d.ts +0 -4
  98. package/out/util/appBuilder.js +0 -36
  99. package/out/util/appBuilder.js.map +0 -1
  100. package/out/wine.d.ts +0 -5
  101. package/out/wine.js +0 -31
  102. package/out/wine.js.map +0 -1
@@ -0,0 +1,444 @@
1
+ #!/bin/bash -e
2
+
3
+ ###############################################
4
+ # Launcher common exports for any desktop app #
5
+ ###############################################
6
+
7
+ function prepend_dir() {
8
+ local var="$1"
9
+ local dir="$2"
10
+ if [ -d "$dir" ]; then
11
+ eval "export $var=\"\$dir\${$var:+:\$$var}\""
12
+ fi
13
+ }
14
+
15
+ function append_dir() {
16
+ local var="$1"
17
+ local dir="$2"
18
+ if [ -d "$dir" ]; then
19
+ eval "export $var=\"\${$var:+\$$var:}\$dir\""
20
+ fi
21
+ }
22
+
23
+ function can_open_file() {
24
+ head -c0 "$1" &> /dev/null
25
+ }
26
+
27
+ function update_xdg_dirs_values() {
28
+ local save_initial_values=false
29
+ local XDG_DIRS="DOCUMENTS DESKTOP DOWNLOAD MUSIC PICTURES VIDEOS PUBLICSHARE TEMPLATES"
30
+ unset XDG_SPECIAL_DIRS_PATHS
31
+
32
+ if [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs" ]; then
33
+ # shellcheck source=/dev/null
34
+ source "${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
35
+ fi
36
+
37
+ if [ -z ${XDG_SPECIAL_DIRS+x} ]; then
38
+ save_initial_values=true
39
+ fi
40
+
41
+ for d in $XDG_DIRS; do
42
+ var="XDG_${d}_DIR"
43
+ value="${!var}"
44
+
45
+ if [ "$save_initial_values" = true ]; then
46
+ XDG_SPECIAL_DIRS+=("$var")
47
+ if [ -n "$value" ]; then
48
+ XDG_SPECIAL_DIRS_INITIAL_PATHS+=("$value")
49
+ fi
50
+ fi
51
+
52
+ if [ -n "$value" ]; then
53
+ XDG_SPECIAL_DIRS_PATHS+=("$value")
54
+ fi
55
+ done
56
+ }
57
+
58
+ function is_subpath() {
59
+ dir="$(realpath "$1")"
60
+ parent="$(realpath "$2")"
61
+ [ "${dir##$parent/}" != "$dir" ] && return 0 || return 1
62
+ }
63
+
64
+ if [ -n "$SNAP_DESKTOP_RUNTIME" ]; then
65
+ # add general paths not added by snapcraft due to runtime snap
66
+ append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/lib/$SNAP_DESKTOP_ARCH_TRIPLET"
67
+ append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET"
68
+ append_dir PATH "$SNAP_DESKTOP_RUNTIME/usr/bin"
69
+ fi
70
+
71
+ # XKB config
72
+ export XKB_CONFIG_ROOT="$SNAP_DESKTOP_RUNTIME/usr/share/X11/xkb"
73
+
74
+ # Give XOpenIM a chance to locate locale data.
75
+ # This is required for text input to work in SDL2 games.
76
+ export XLOCALEDIR="$SNAP_DESKTOP_RUNTIME/usr/share/X11/locale"
77
+
78
+ # Set XCursors path
79
+ export XCURSOR_PATH="$SNAP_DESKTOP_RUNTIME/usr/share/icons"
80
+ prepend_dir XCURSOR_PATH "$SNAP/data-dir/icons"
81
+
82
+ # Mesa Libs for OpenGL support
83
+ append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/mesa"
84
+ append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/mesa-egl"
85
+
86
+ # Tell libGL where to find the drivers
87
+ export LIBGL_DRIVERS_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/dri"
88
+ append_dir LD_LIBRARY_PATH "$LIBGL_DRIVERS_PATH"
89
+ export LIBVA_DRIVERS_PATH=$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/dri
90
+
91
+ # Workaround in snapd for proprietary nVidia drivers mounts the drivers in
92
+ # /var/lib/snapd/lib/gl that needs to be in LD_LIBRARY_PATH
93
+ # Without that OpenGL using apps do not work with the nVidia drivers.
94
+ # Ref.: https://bugs.launchpad.net/snappy/+bug/1588192
95
+ append_dir LD_LIBRARY_PATH /var/lib/snapd/lib/gl
96
+
97
+ # Unity7 export (workaround for https://launchpad.net/bugs/1638405)
98
+ append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/libunity"
99
+
100
+ # Pulseaudio export
101
+ append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/pulseaudio"
102
+
103
+ # EGL vendor files on glvnd enabled systems
104
+ [ -d /var/lib/snapd/lib/glvnd/egl_vendor.d ] && \
105
+ append_dir __EGL_VENDOR_LIBRARY_DIRS /var/lib/snapd/lib/glvnd/egl_vendor.d
106
+
107
+ # Tell GStreamer where to find its plugins
108
+ export GST_PLUGIN_PATH="$SNAP/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gstreamer-1.0"
109
+ export GST_PLUGIN_SYSTEM_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gstreamer-1.0"
110
+ # gst plugin scanner doesn't install in the correct path: https://github.com/ubuntu/snapcraft-desktop-helpers/issues/43
111
+ export GST_PLUGIN_SCANNER="$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
112
+
113
+ # XDG Config
114
+ [ -n "$SNAP_DESKTOP_RUNTIME" ] && prepend_dir XDG_CONFIG_DIRS "$SNAP_DESKTOP_RUNTIME/etc/xdg"
115
+ prepend_dir XDG_CONFIG_DIRS "$SNAP/etc/xdg"
116
+
117
+ # Define snaps' own data dir
118
+ [ -n "$SNAP_DESKTOP_RUNTIME" ] && prepend_dir XDG_DATA_DIRS "$SNAP_DESKTOP_RUNTIME/usr/share"
119
+ prepend_dir XDG_DATA_DIRS "$SNAP/usr/share"
120
+ prepend_dir XDG_DATA_DIRS "$SNAP/share"
121
+ prepend_dir XDG_DATA_DIRS "$SNAP/data-dir"
122
+ prepend_dir XDG_DATA_DIRS "$SNAP_USER_DATA"
123
+
124
+ # Set XDG_DATA_HOME to local path
125
+ export XDG_DATA_HOME="$SNAP_USER_DATA/.local/share"
126
+ mkdir -p "$XDG_DATA_HOME"
127
+
128
+ # Workaround for GLib < 2.53.2 not searching for schemas in $XDG_DATA_HOME:
129
+ # https://bugzilla.gnome.org/show_bug.cgi?id=741335
130
+ prepend_dir XDG_DATA_DIRS "$XDG_DATA_HOME"
131
+
132
+ # Set cache folder to local path
133
+ export XDG_CACHE_HOME="$SNAP_USER_COMMON/.cache"
134
+ if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$XDG_CACHE_HOME" ]]; then
135
+ # the .cache directory used to be stored under $SNAP_USER_DATA, migrate it
136
+ mv "$SNAP_USER_DATA/.cache" "$SNAP_USER_COMMON/"
137
+ fi
138
+ mkdir -p "$XDG_CACHE_HOME"
139
+
140
+ # Set config folder to local path
141
+ export XDG_CONFIG_HOME="$SNAP_USER_DATA/.config"
142
+ mkdir -p "$XDG_CONFIG_HOME"
143
+
144
+ # Create $XDG_RUNTIME_DIR if not exists (to be removed when LP: #1656340 is fixed)
145
+ if [ -n "$XDG_RUNTIME_DIR" ]; then
146
+ mkdir -p "$XDG_RUNTIME_DIR"
147
+ chmod 700 "$XDG_RUNTIME_DIR"
148
+ fi
149
+
150
+ # Ensure the app finds locale definitions (requires locales-all to be installed)
151
+ append_dir LOCPATH "$SNAP_DESKTOP_RUNTIME/usr/lib/locale"
152
+
153
+ # If any, keep track of where XDG dirs were so we can potentially migrate the content later
154
+ update_xdg_dirs_values
155
+
156
+ # Setup user-dirs.* or run xdg-user-dirs-update if needed
157
+ needs_xdg_update=false
158
+ needs_xdg_reload=false
159
+ needs_xdg_links=false
160
+
161
+ if [ "$HOME" != "$SNAP_USER_DATA" ] && ! is_subpath "$XDG_CONFIG_HOME" "$HOME"; then
162
+ for f in user-dirs.dirs user-dirs.locale; do
163
+ if [ -f "$HOME/.config/$f" ]; then
164
+ mv "$HOME/.config/$f" "$XDG_CONFIG_HOME"
165
+ needs_xdg_reload=true
166
+ fi
167
+ done
168
+ fi
169
+
170
+ if can_open_file "$REALHOME/.config/user-dirs.dirs" && can_open_file "$REALHOME/.config/user-dirs.locale"; then
171
+ if [ "$SNAP_DESKTOP_COMPONENTS_NEED_UPDATE" = "true" ] || [ $needs_xdg_reload = true ]; then
172
+ sed "/^#/!s#\$HOME#${REALHOME}#g" "$REALHOME/.config/user-dirs.dirs" > "$XDG_CONFIG_HOME/user-dirs.dirs"
173
+ cp -a "$REALHOME/.config/user-dirs.locale" "$XDG_CONFIG_HOME"
174
+ for f in user-dirs.dirs user-dirs.locale; do
175
+ md5sum < "$REALHOME/.config/$f" > "$XDG_CONFIG_HOME/$f.md5sum"
176
+ done
177
+ needs_xdg_reload=true
178
+ fi
179
+ else
180
+ needs_xdg_update=true
181
+ needs_xdg_links=true
182
+ fi
183
+
184
+ if [ $needs_xdg_reload = true ]; then
185
+ update_xdg_dirs_values
186
+ needs_xdg_reload=false
187
+ fi
188
+
189
+ # Check if we can actually read the contents of each xdg dir
190
+ for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do
191
+ if ! can_open_file "${XDG_SPECIAL_DIRS_PATHS[$i]}"; then
192
+ needs_xdg_update=true
193
+ needs_xdg_links=true
194
+ break
195
+ fi
196
+ done
197
+
198
+ # If needs XDG update and xdg-user-dirs-update exists in $PATH, run it
199
+ if [ $needs_xdg_update = true ] && command -v xdg-user-dirs-update >/dev/null; then
200
+ xdg-user-dirs-update
201
+ update_xdg_dirs_values
202
+ fi
203
+
204
+ # Create links for user-dirs.dirs
205
+ if [ $needs_xdg_links = true ]; then
206
+ for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do
207
+ b="$(realpath "${XDG_SPECIAL_DIRS_PATHS[$i]}" --relative-to="$HOME")"
208
+ if [ -e "$REALHOME/$b" ]; then
209
+ if [ -d "$HOME/$b" ]; then
210
+ rmdir "$HOME/$b" 2> /dev/null
211
+ fi
212
+ if [ ! -e "$HOME/$b" ]; then
213
+ ln -s "$REALHOME/$b" "$HOME/$b"
214
+ fi
215
+ fi
216
+ done
217
+ else
218
+ # If we aren't creating new links, check if we have content saved in old locations and move it
219
+ for ((i = 0; i < ${#XDG_SPECIAL_DIRS[@]}; i++)); do
220
+ old="${XDG_SPECIAL_DIRS_INITIAL_PATHS[$i]}"
221
+ new="${XDG_SPECIAL_DIRS_PATHS[$i]}"
222
+ if [ -L "$old" ] && [ -d "$new" ] && [ "$(readlink "$old")" != "$new" ] &&
223
+ (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then
224
+ mv -vn "$old"/* "$new"/ 2>/dev/null
225
+ elif [ -d "$old" ] && [ -d "$new" ] && [ "$old" != "$new" ] &&
226
+ (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then
227
+ mv -vn "$old"/* "$new"/ 2>/dev/null
228
+ fi
229
+ done
230
+ fi
231
+
232
+ # If detect wayland server socket, then set environment so applications prefer
233
+ # wayland, and setup compat symlink (until we use user mounts. Remember,
234
+ # XDG_RUNTIME_DIR is /run/user/<uid>/snap.$SNAP so look in the parent directory
235
+ # for the socket. For details:
236
+ # https://forum.snapcraft.io/t/wayland-dconf-and-xdg-runtime-dir/186/10
237
+ # Applications that don't support wayland natively may define DISABLE_WAYLAND
238
+ # (to any non-empty value) to skip that logic entirely.
239
+ SNAP_DESKTOP_WAYLAND_AVAILABLE=false
240
+ if [[ -n "$XDG_RUNTIME_DIR" && -z "$DISABLE_WAYLAND" ]]; then
241
+ wdisplay="wayland-0"
242
+ if [ -n "$WAYLAND_DISPLAY" ]; then
243
+ # Reject values containing '/' to prevent path traversal in the symlink paths below.
244
+ # A legitimate WAYLAND_DISPLAY is always a plain socket name (e.g. "wayland-0").
245
+ if [[ "$WAYLAND_DISPLAY" != */* ]]; then
246
+ wdisplay="$WAYLAND_DISPLAY"
247
+ fi
248
+ fi
249
+ wayland_sockpath="$XDG_RUNTIME_DIR/../$wdisplay"
250
+ wayland_snappath="$XDG_RUNTIME_DIR/$wdisplay"
251
+ if [ -S "$wayland_sockpath" ]; then
252
+ # if running under wayland, use it
253
+ #export WAYLAND_DEBUG=1
254
+ SNAP_DESKTOP_WAYLAND_AVAILABLE=true
255
+ # create the compat symlink for now
256
+ if [ ! -e "$wayland_snappath" ]; then
257
+ ln -s "$wayland_sockpath" "$wayland_snappath"
258
+ fi
259
+ fi
260
+ fi
261
+
262
+ # Make PulseAudio socket available inside the snap-specific $XDG_RUNTIME_DIR
263
+ if [ -n "$XDG_RUNTIME_DIR" ]; then
264
+ pulsenative="pulse/native"
265
+ pulseaudio_sockpath="$XDG_RUNTIME_DIR/../$pulsenative"
266
+ if [ -S "$pulseaudio_sockpath" ]; then
267
+ export PULSE_SERVER="unix:${pulseaudio_sockpath}"
268
+ fi
269
+ fi
270
+
271
+ # GI repository
272
+ [ -n "$SNAP_DESKTOP_RUNTIME" ] && prepend_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/girepository-1.0"
273
+ [ -n "$SNAP_DESKTOP_RUNTIME" ] && prepend_dir GI_TYPELIB_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/girepository-1.0"
274
+ prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/girepository-1.0"
275
+ prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/girepository-1.0"
276
+ prepend_dir GI_TYPELIB_PATH "$SNAP/usr/lib/gjs/girepository-1.0"
277
+
278
+ # Keep an array of data dirs, for looping through them
279
+ IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS"
280
+
281
+ # Font Config and themes
282
+ export FONTCONFIG_PATH="$SNAP_DESKTOP_RUNTIME/etc/fonts"
283
+ export FONTCONFIG_FILE="$SNAP_DESKTOP_RUNTIME/etc/fonts/fonts.conf"
284
+
285
+ function make_user_fontconfig {
286
+ echo "<fontconfig>"
287
+ if [ -d "$REALHOME/.local/share/fonts" ]; then
288
+ echo " <dir>$REALHOME/.local/share/fonts</dir>"
289
+ fi
290
+ if [ -d "$REALHOME/.fonts" ]; then
291
+ echo " <dir>$REALHOME/.fonts</dir>"
292
+ fi
293
+ for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do
294
+ if [ -d "${data_dirs_array[$i]}/fonts" ]; then
295
+ echo " <dir>${data_dirs_array[$i]}/fonts</dir>"
296
+ fi
297
+ done
298
+ echo ' <include ignore_missing="yes">conf.d</include>'
299
+ # We need to include this default cachedir first so that caching
300
+ # works: without it, fontconfig will try to write to the real user home
301
+ # cachedir and be blocked by AppArmor.
302
+ echo ' <cachedir prefix="xdg">fontconfig</cachedir>'
303
+ if [ -d "$REALHOME/.cache/fontconfig" ]; then
304
+ echo " <cachedir>$REALHOME/.cache/fontconfig</cachedir>"
305
+ fi
306
+ echo "</fontconfig>"
307
+ }
308
+
309
+ if [ "$SNAP_DESKTOP_COMPONENTS_NEED_UPDATE" = "true" ]; then
310
+ rm -rf "$XDG_DATA_HOME"/{fontconfig,fonts,fonts-*,themes,.themes}
311
+
312
+ # This fontconfig fragment is installed in a location that is
313
+ # included by the system fontconfig configuration: namely the
314
+ # etc/fonts/conf.d/50-user.conf file.
315
+ mkdir -p "$XDG_CONFIG_HOME/fontconfig"
316
+ make_user_fontconfig > "$XDG_CONFIG_HOME/fontconfig/fonts.conf"
317
+
318
+ # the themes symlink are needed for GTK 3.18 when the prefix isn't changed
319
+ # GTK 3.20 looks into XDG_DATA_DIR which has connected themes.
320
+ ln -sf "$SNAP/data-dir/themes" "$XDG_DATA_HOME"
321
+ ln -sfn "$SNAP/data-dir/themes" "$SNAP_USER_DATA/.themes"
322
+ fi
323
+
324
+ # Build mime.cache
325
+ # needed for gtk and qt icon
326
+ if [ "$SNAP_DESKTOP_COMPONENTS_NEED_UPDATE" = "true" ]; then
327
+ rm -rf "$XDG_DATA_HOME/mime"
328
+ if [ ! -f "$SNAP_DESKTOP_RUNTIME/usr/share/mime/mime.cache" ]; then
329
+ if command -v update-mime-database >/dev/null; then
330
+ cp --preserve=timestamps -dR "$SNAP_DESKTOP_RUNTIME/usr/share/mime" "$XDG_DATA_HOME"
331
+ update-mime-database "$XDG_DATA_HOME/mime"
332
+ fi
333
+ fi
334
+ fi
335
+
336
+ # Gio modules and cache (including gsettings module)
337
+ export GIO_MODULE_DIR="$XDG_CACHE_HOME/gio-modules"
338
+ if [ "$SNAP_DESKTOP_COMPONENTS_NEED_UPDATE" = "true" ]; then
339
+ if [ -f "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/glib-2.0/gio-querymodules" ]; then
340
+ rm -rf "$GIO_MODULE_DIR"
341
+ mkdir -p "$GIO_MODULE_DIR"
342
+ ln -sf "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gio/modules/"*.so "$GIO_MODULE_DIR"
343
+ ln -sf "$SNAP/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gio/modules/"*.so "$GIO_MODULE_DIR"
344
+ "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/glib-2.0/gio-querymodules" "$GIO_MODULE_DIR"
345
+ fi
346
+ fi
347
+
348
+ # Setup compiled gsettings schema
349
+ GS_SCHEMA_DIR="$XDG_DATA_HOME/glib-2.0/schemas"
350
+ function compile_schemas {
351
+ if [ -f "$1" ]; then
352
+ rm -rf "$GS_SCHEMA_DIR"
353
+ mkdir -p "$GS_SCHEMA_DIR"
354
+ for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do
355
+ schema_dir="${data_dirs_array[$i]}/glib-2.0/schemas"
356
+ if [ -f "$schema_dir/gschemas.compiled" ]; then
357
+ # This directory already has compiled schemas
358
+ continue
359
+ fi
360
+ if [ -n "$(ls -A "$schema_dir"/*.xml 2>/dev/null)" ]; then
361
+ ln -s "$schema_dir"/*.xml "$GS_SCHEMA_DIR"
362
+ fi
363
+ if [ -n "$(ls -A "$schema_dir"/*.override 2>/dev/null)" ]; then
364
+ ln -s "$schema_dir"/*.override "$GS_SCHEMA_DIR"
365
+ fi
366
+ done
367
+ # Only compile schemas if we copied anything
368
+ if [ -n "$(ls -A "$GS_SCHEMA_DIR"/*.xml "$GS_SCHEMA_DIR"/*.override 2>/dev/null)" ]; then
369
+ "$1" "$GS_SCHEMA_DIR"
370
+ fi
371
+ fi
372
+ }
373
+ if [ "$SNAP_DESKTOP_COMPONENTS_NEED_UPDATE" = "true" ]; then
374
+ compile_schemas "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/glib-2.0/glib-compile-schemas"
375
+ fi
376
+
377
+ # Enable gsettings user changes
378
+ # symlink the dconf file if home plug is connected for read
379
+ DCONF_DEST_USER_DIR="$SNAP_USER_DATA/.config/dconf"
380
+ if [ ! -f "$DCONF_DEST_USER_DIR/user" ]; then
381
+ if [ -f "$REALHOME/.config/dconf/user" ]; then
382
+ mkdir -p "$DCONF_DEST_USER_DIR"
383
+ ln -s "$REALHOME/.config/dconf/user" "$DCONF_DEST_USER_DIR"
384
+ fi
385
+ fi
386
+
387
+ # Testability support
388
+ append_dir LD_LIBRARY_PATH "$SNAP/testability"
389
+ append_dir LD_LIBRARY_PATH "$SNAP/testability/$SNAP_DESKTOP_ARCH_TRIPLET"
390
+ append_dir LD_LIBRARY_PATH "$SNAP/testability/$SNAP_DESKTOP_ARCH_TRIPLET/mesa"
391
+
392
+ # Gdk-pixbuf loaders
393
+ export GDK_PIXBUF_MODULE_FILE=$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache
394
+ export GDK_PIXBUF_MODULEDIR=$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gdk-pixbuf-2.0/2.10.0/loaders
395
+ if [ "$SNAP_DESKTOP_COMPONENTS_NEED_UPDATE" = "true" ]; then
396
+ rm -f "$GDK_PIXBUF_MODULE_FILE"
397
+ if [ -f "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" ]; then
398
+ "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" > "$GDK_PIXBUF_MODULE_FILE"
399
+ fi
400
+ fi
401
+
402
+ # Icon themes cache
403
+ if [ "$SNAP_DESKTOP_COMPONENTS_NEED_UPDATE" = "true" ]; then
404
+ rm -rf "$XDG_DATA_HOME/icons"
405
+ mkdir -p "$XDG_DATA_HOME/icons"
406
+ for ((i = 0; i < ${#data_dirs_array[@]}; i++)); do
407
+ for theme in "${data_dirs_array[$i]}/icons/"*; do
408
+ if [ -f "$theme/index.theme" ] && [ ! -f "$theme/icon-theme.cache" ]; then
409
+ theme_dir="$XDG_DATA_HOME/icons/$(basename "$theme")"
410
+ if [ ! -d "$theme_dir" ]; then
411
+ mkdir -p "$theme_dir"
412
+ ln -s "$theme"/* "$theme_dir"
413
+ if [ -f "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-caches" ]; then
414
+ "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-caches" "$theme_dir"
415
+ elif [ -f "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-cache.gtk2" ]; then
416
+ "$SNAP_DESKTOP_RUNTIME/usr/sbin/update-icon-cache.gtk2" "$theme_dir"
417
+ fi
418
+ fi
419
+ fi
420
+ done
421
+ done
422
+ fi
423
+
424
+ # GTK theme and behavior modifier
425
+ # Those can impact the theme engine used by Qt as well
426
+ gtk_configs=(gtk-3.0/settings.ini gtk-3.0/bookmarks gtk-2.0/gtkfilechooser.ini)
427
+ for f in "${gtk_configs[@]}"; do
428
+ dest="$XDG_CONFIG_HOME/$f"
429
+ if [ ! -L "$dest" ]; then
430
+ mkdir -p "$(dirname "$dest")"
431
+ ln -s "$REALHOME/.config/$f" "$dest"
432
+ fi
433
+ done
434
+
435
+ # create symbolic link to ibus socket path for ibus to look up its socket files
436
+ # (see comments #3 and #6 on https://launchpad.net/bugs/1580463)
437
+ IBUS_CONFIG_PATH="$XDG_CONFIG_HOME/ibus"
438
+ mkdir -p "$IBUS_CONFIG_PATH"
439
+ [ -d "$IBUS_CONFIG_PATH/bus" ] && rm -rf "$IBUS_CONFIG_PATH/bus"
440
+ ln -sfn "$REALHOME/.config/ibus/bus" "$IBUS_CONFIG_PATH"
441
+
442
+ export SNAP_DESKTOP_WAYLAND_AVAILABLE
443
+
444
+ exec "$@"
@@ -0,0 +1,31 @@
1
+ #!/bin/bash -e
2
+
3
+ ##############################
4
+ # GTK launcher specific part #
5
+ ##############################
6
+
7
+ if [ "$SNAP_DESKTOP_WAYLAND_AVAILABLE" = "true" ]; then
8
+ export GDK_BACKEND="wayland"
9
+ export CLUTTER_BACKEND="wayland"
10
+ # Does not hurt to specify this as well, just in case
11
+ export QT_QPA_PLATFORM=wayland-egl
12
+ fi
13
+
14
+ export GTK_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gtk-3.0"
15
+
16
+ # ibus and fcitx integration
17
+ GTK_IM_MODULE_DIR=$XDG_CACHE_HOME/immodules
18
+ export GTK_IM_MODULE_FILE=$GTK_IM_MODULE_DIR/immodules.cache
19
+ if [ "$SNAP_DESKTOP_COMPONENTS_NEED_UPDATE" = "true" ]; then
20
+ rm -rf "$GTK_IM_MODULE_DIR"
21
+ mkdir -p "$GTK_IM_MODULE_DIR"
22
+ if [ -x "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/libgtk-3-0/gtk-query-immodules-3.0" ]; then
23
+ ln -sf "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gtk-3.0/3.0.0/immodules"/*.so "$GTK_IM_MODULE_DIR"
24
+ "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/libgtk-3-0/gtk-query-immodules-3.0" > "$GTK_IM_MODULE_FILE"
25
+ elif [ -x "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/libgtk2.0-0/gtk-query-immodules-2.0" ]; then
26
+ ln -sf "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/gtk-2.0/2.10.0/immodules"/*.so "$GTK_IM_MODULE_DIR"
27
+ "$SNAP_DESKTOP_RUNTIME/usr/lib/$SNAP_DESKTOP_ARCH_TRIPLET/libgtk2.0-0/gtk-query-immodules-2.0" > "$GTK_IM_MODULE_FILE"
28
+ fi
29
+ fi
30
+
31
+ exec "$@"
@@ -0,0 +1,52 @@
1
+ #!/bin/bash -e
2
+
3
+ #################
4
+ # Launcher init #
5
+ #################
6
+
7
+ SNAP_DESKTOP_COMPONENTS_NEED_UPDATE="true"
8
+
9
+ # shellcheck source=/dev/null
10
+ . "$SNAP_USER_DATA/.last_revision" 2>/dev/null || true
11
+ if [ "$SNAP_DESKTOP_LAST_REVISION" = "$SNAP_REVISION" ]; then
12
+ SNAP_DESKTOP_COMPONENTS_NEED_UPDATE="false"
13
+ else
14
+ echo "SNAP_DESKTOP_LAST_REVISION=$SNAP_REVISION" > "$SNAP_USER_DATA/.last_revision"
15
+ fi
16
+
17
+ # Set $REALHOME to the users real home directory
18
+ REALHOME="$(getent passwd $UID | cut -d ':' -f 6)"
19
+
20
+ # If the user has modified their user-dirs settings, force an update
21
+ if [[ -f "$XDG_CONFIG_HOME/user-dirs.dirs.md5sum" && -f "$XDG_CONFIG_HOME/user-dirs.locale.md5sum" ]]; then
22
+ if [[ "$(md5sum < "$REALHOME/.config/user-dirs.dirs")" != "$(cat "$XDG_CONFIG_HOME/user-dirs.dirs.md5sum")" ||
23
+ "$(md5sum < "$REALHOME/.config/user-dirs.locale")" != "$(cat "$XDG_CONFIG_HOME/user-dirs.locale.md5sum")" ]]; then
24
+ SNAP_DESKTOP_COMPONENTS_NEED_UPDATE="true"
25
+ fi
26
+ fi
27
+
28
+ if [ "$SNAP_ARCH" == "amd64" ]; then
29
+ ARCH="x86_64-linux-gnu"
30
+ elif [ "$SNAP_ARCH" == "armhf" ]; then
31
+ ARCH="arm-linux-gnueabihf"
32
+ elif [ "$SNAP_ARCH" == "arm64" ]; then
33
+ ARCH="aarch64-linux-gnu"
34
+ elif [ "$SNAP_ARCH" == "ppc64el" ]; then
35
+ ARCH="powerpc64le-linux-gnu"
36
+ else
37
+ ARCH="$SNAP_ARCH-linux-gnu"
38
+ fi
39
+
40
+ SNAP_DESKTOP_ARCH_TRIPLET="$ARCH"
41
+
42
+ if [ -f "$SNAP/lib/bindtextdomain.so" ]; then
43
+ # Use :+ to avoid a leading ':' when LD_PRELOAD is empty.
44
+ # A bare leading ':' makes the dynamic linker search CWD before snap paths.
45
+ export LD_PRELOAD="${LD_PRELOAD:+$LD_PRELOAD:}$SNAP/lib/bindtextdomain.so"
46
+ fi
47
+
48
+ export REALHOME
49
+ export SNAP_DESKTOP_COMPONENTS_NEED_UPDATE
50
+ export SNAP_DESKTOP_ARCH_TRIPLET
51
+
52
+ exec "$@"
@@ -1,4 +0,0 @@
1
- import { SpawnOptions } from "child_process";
2
- export declare function executeAppBuilderAsJson<T>(args: Array<string>): Promise<T>;
3
- export declare function executeAppBuilderAndWriteJson(args: Array<string>, data: any, extraOptions?: SpawnOptions): Promise<string>;
4
- export declare function objectToArgs(to: Array<string>, argNameToValue: Record<string, string | null>): void;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.executeAppBuilderAsJson = executeAppBuilderAsJson;
4
- exports.executeAppBuilderAndWriteJson = executeAppBuilderAndWriteJson;
5
- exports.objectToArgs = objectToArgs;
6
- const builder_util_1 = require("builder-util");
7
- function executeAppBuilderAsJson(args) {
8
- return (0, builder_util_1.executeAppBuilder)(args).then(rawResult => {
9
- if (rawResult === "") {
10
- return Object.create(null);
11
- }
12
- try {
13
- return JSON.parse(rawResult);
14
- }
15
- catch (e) {
16
- throw new Error(`Cannot parse result: ${e.message}: "${rawResult}"`);
17
- }
18
- });
19
- }
20
- function executeAppBuilderAndWriteJson(args, data, extraOptions = {}) {
21
- return (0, builder_util_1.executeAppBuilder)(args, childProcess => {
22
- childProcess.stdin.end(JSON.stringify(data));
23
- }, {
24
- ...extraOptions,
25
- stdio: ["pipe", "pipe", builder_util_1.shouldDisableNonErrorLoggingVitest ? "pipe" : process.stdout],
26
- });
27
- }
28
- function objectToArgs(to, argNameToValue) {
29
- for (const name of Object.keys(argNameToValue)) {
30
- const value = argNameToValue[name];
31
- if (value != null) {
32
- to.push(`--${name}`, value);
33
- }
34
- }
35
- }
36
- //# sourceMappingURL=appBuilder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"appBuilder.js","sourceRoot":"","sources":["../../src/util/appBuilder.ts"],"names":[],"mappings":";;AAGA,0DAYC;AAED,sEAWC;AAED,oCAOC;AArCD,+CAAoF;AAGpF,SAAgB,uBAAuB,CAAI,IAAmB;IAC5D,OAAO,IAAA,gCAAiB,EAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;QAC9C,IAAI,SAAS,KAAK,EAAE,EAAE,CAAC;YACrB,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAM,CAAA;QACjC,CAAC;QAED,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAM,CAAA;QACnC,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC,OAAO,MAAM,SAAS,GAAG,CAAC,CAAA;QACtE,CAAC;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAgB,6BAA6B,CAAC,IAAmB,EAAE,IAAS,EAAE,eAA6B,EAAE;IAC3G,OAAO,IAAA,gCAAiB,EACtB,IAAI,EACJ,YAAY,CAAC,EAAE;QACb,YAAY,CAAC,KAAM,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAA;IAC/C,CAAC,EACD;QACE,GAAG,YAAY;QACf,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,iDAAkC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;KACtF,CACF,CAAA;AACH,CAAC;AAED,SAAgB,YAAY,CAAC,EAAiB,EAAE,cAA6C;IAC3F,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,cAAc,CAAC,IAAI,CAAC,CAAA;QAClC,IAAI,KAAK,IAAI,IAAI,EAAE,CAAC;YAClB,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { executeAppBuilder, shouldDisableNonErrorLoggingVitest } from \"builder-util\"\nimport { SpawnOptions } from \"child_process\"\n\nexport function executeAppBuilderAsJson<T>(args: Array<string>): Promise<T> {\n return executeAppBuilder(args).then(rawResult => {\n if (rawResult === \"\") {\n return Object.create(null) as T\n }\n\n try {\n return JSON.parse(rawResult) as T\n } catch (e: any) {\n throw new Error(`Cannot parse result: ${e.message}: \"${rawResult}\"`)\n }\n })\n}\n\nexport function executeAppBuilderAndWriteJson(args: Array<string>, data: any, extraOptions: SpawnOptions = {}): Promise<string> {\n return executeAppBuilder(\n args,\n childProcess => {\n childProcess.stdin!.end(JSON.stringify(data))\n },\n {\n ...extraOptions,\n stdio: [\"pipe\", \"pipe\", shouldDisableNonErrorLoggingVitest ? \"pipe\" : process.stdout],\n }\n )\n}\n\nexport function objectToArgs(to: Array<string>, argNameToValue: Record<string, string | null>): void {\n for (const name of Object.keys(argNameToValue)) {\n const value = argNameToValue[name]\n if (value != null) {\n to.push(`--${name}`, value)\n }\n }\n}\n"]}
package/out/wine.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { ExecFileOptions } from "child_process";
2
- /** @private */
3
- export declare function execWine(file: string, file64?: string | null, appArgs?: Array<string>, options?: ExecFileOptions): Promise<string>;
4
- /** @private */
5
- export declare function prepareWindowsExecutableArgs(args: Array<string>, exePath: string): string[];
package/out/wine.js DELETED
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.execWine = execWine;
4
- exports.prepareWindowsExecutableArgs = prepareWindowsExecutableArgs;
5
- const builder_util_1 = require("builder-util");
6
- /** @private */
7
- function execWine(file, file64 = null, appArgs = [], options = {}) {
8
- if (process.platform === "win32") {
9
- if (options.timeout == null) {
10
- // 2 minutes
11
- options.timeout = 120 * 1000;
12
- }
13
- return (0, builder_util_1.exec)(file, appArgs, options);
14
- }
15
- const commandArgs = ["wine", "--ia32", file];
16
- if (file64 != null) {
17
- commandArgs.push("--x64", file64);
18
- }
19
- if (appArgs.length > 0) {
20
- commandArgs.push("--args", JSON.stringify(appArgs));
21
- }
22
- return (0, builder_util_1.executeAppBuilder)(commandArgs, undefined, options);
23
- }
24
- /** @private */
25
- function prepareWindowsExecutableArgs(args, exePath) {
26
- if (process.platform !== "win32") {
27
- args.unshift(exePath);
28
- }
29
- return args;
30
- }
31
- //# sourceMappingURL=wine.js.map
package/out/wine.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"wine.js","sourceRoot":"","sources":["../src/wine.ts"],"names":[],"mappings":";;AAIA,4BAiBC;AAGD,oEAKC;AA7BD,+CAAsD;AAGtD,eAAe;AACf,SAAgB,QAAQ,CAAC,IAAY,EAAE,SAAwB,IAAI,EAAE,UAAyB,EAAE,EAAE,UAA2B,EAAE;IAC7H,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;YAC5B,YAAY;YACZ,OAAO,CAAC,OAAO,GAAG,GAAG,GAAG,IAAI,CAAA;QAC9B,CAAC;QACD,OAAO,IAAA,mBAAI,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;IACrC,CAAC;IAED,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAA;IAC5C,IAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACnB,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IACnC,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACrD,CAAC;IACD,OAAO,IAAA,gCAAiB,EAAC,WAAW,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3D,CAAC;AAED,eAAe;AACf,SAAgB,4BAA4B,CAAC,IAAmB,EAAE,OAAe;IAC/E,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IACvB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC","sourcesContent":["import { exec, executeAppBuilder } from \"builder-util\"\nimport { ExecFileOptions } from \"child_process\"\n\n/** @private */\nexport function execWine(file: string, file64: string | null = null, appArgs: Array<string> = [], options: ExecFileOptions = {}): Promise<string> {\n if (process.platform === \"win32\") {\n if (options.timeout == null) {\n // 2 minutes\n options.timeout = 120 * 1000\n }\n return exec(file, appArgs, options)\n }\n\n const commandArgs = [\"wine\", \"--ia32\", file]\n if (file64 != null) {\n commandArgs.push(\"--x64\", file64)\n }\n if (appArgs.length > 0) {\n commandArgs.push(\"--args\", JSON.stringify(appArgs))\n }\n return executeAppBuilder(commandArgs, undefined, options)\n}\n\n/** @private */\nexport function prepareWindowsExecutableArgs(args: Array<string>, exePath: string) {\n if (process.platform !== \"win32\") {\n args.unshift(exePath)\n }\n return args\n}\n"]}