Add wine executable wrapper for macos

This commit is contained in:
mid-kid 2025-04-24 21:05:52 +02:00
parent 2486f1bc14
commit 7c4f22a37d
4 changed files with 19 additions and 2 deletions

View File

@ -107,4 +107,4 @@ $(build_trace)/build.ninja:
$(build_windows)/build.ninja:
@mkdir -p $(build)
$(MESON) setup --cross-file meson/i686-w64-mingw32.ini $(build_windows) \
--prefix / -Dtrace=true
--prefix / -Dtrace=true -Dwine_wrap=true

View File

@ -1 +1,4 @@
option('trace', type: 'boolean', value: false)
option('trace', type: 'boolean', value: false,
description: 'Enables tracing messages')
option('wine_wrap', type: 'boolean', value: false,
description: 'Installs shell scripts to call wine')

View File

@ -32,6 +32,9 @@ if is_windows
link_args += '-municode'
endif
assert(get_option('wine_wrap') ? is_windows : true,
'The wine_wrap option is only relevant for windows builds')
wrap_progs = ['skrewrap', 'mwccarm', 'mwldarm', 'mwasmarm']
wrap = []
foreach wrap_prog : wrap_progs
@ -42,6 +45,15 @@ foreach wrap_prog : wrap_progs
],
link_args: link_args,
install: true)
if get_option('wine_wrap')
configure_file(
input: 'wine_wrap.in',
output: wrap_prog,
configuration: {'WRAP': wrap_prog + '.exe'},
install: true,
install_dir: get_option('bindir'),
install_mode: 'rwxr-xr-x')
endif
endforeach
# test() requires a cross-compiled target in its argument list

2
wrap/wine_wrap.in Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
WINEDEBUG=-all exec "${WINE:-wine}" "$(dirname "$(realpath "$0")")/@WRAP@" "$@"