Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow Wine's libdir structure #158

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions d3d9-nine/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ d3d9_dll = shared_library(
dep_user32,
],
install : true,
install_dir : so_dir,
vs_module_defs : 'd3d9.spec',
objects : 'd3d9.spec',
)
Expand All @@ -55,5 +56,20 @@ d3d9_fake = shared_library(
],
name_prefix : '',
name_suffix : 'dll.fake',
install : false,
)

# Hack to rename the installed file
# Starting with Wine 6.22, winegcc recognizes -Wb,--fake-module which should be preferred.
custom_target(
'd3d9-nine.dll',
input : d3d9_fake,
output : 'd3d9-nine.dll',
install : true,
install_dir : pe_dir,
command : [
'cp',
'@INPUT@',
'@OUTPUT@',
],
)
5 changes: 4 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ project(
check : true,
).stdout(),
license : 'LGPL2.1+',
meson_version : '>= 0.46',
meson_version : '>= 0.49',
default_options : [
'buildtype=debugoptimized',
'b_ndebug=if-release',
Expand Down Expand Up @@ -129,6 +129,9 @@ foreach arg : pp_args
add_project_arguments(arg, language : ['c'])
endforeach

pe_dir = get_option('libdir') / 'wine' / meson.get_cross_property('pe_dir')
so_dir = get_option('libdir') / 'wine' / meson.get_cross_property('so_dir')

subdir('common')
subdir('d3d9-nine')
subdir('ninewinecfg')
18 changes: 17 additions & 1 deletion ninewinecfg/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ ninewinecfg_exe = executable(
dep_comctl32,
dep_ole32,
],
install : true
install : true,
install_dir : so_dir,
)

ninewinecfg_fake = executable(
Expand All @@ -41,5 +42,20 @@ ninewinecfg_fake = executable(
],
name_prefix : '',
name_suffix : 'exe.fake',
install : false,
)

# Hack to rename the installed file
# Starting with Wine 6.22, winegcc recognizes -Wb,--fake-module which should be preferred.
custom_target(
'ninewinecfg.exe',
input : ninewinecfg_fake,
output : 'ninewinecfg.exe',
install : true,
install_dir : pe_dir,
command : [
'cp',
'@INPUT@',
'@OUTPUT@',
],
)
17 changes: 13 additions & 4 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ meson \
--cross-file "$SRC/tools/cross-wine64" \
--buildtype "release" \
--prefix "$PREFIX" \
--bindir bin64 \
--libdir lib64 \
--libdir '' \
"$@" \
"$TMP/build64"

Expand All @@ -44,13 +43,23 @@ meson \
--cross-file "$SRC/tools/cross-wine32" \
--buildtype "release" \
--prefix "$PREFIX" \
--bindir bin32 \
--libdir lib32 \
--libdir '' \
"$@" \
"$TMP/build32"

ninja -C "$TMP/build32" install

# winetricks backwards compatibility
# Hard links should be safe here, and avoid bloating up the archive size.
install -d "$PREFIX/lib64"
ln "$PREFIX/wine/x86_64-unix/d3d9-nine.dll.so" "$PREFIX/lib64/d3d9-nine.dll.so"
install -d "$PREFIX/bin64"
ln "$PREFIX/wine/x86_64-unix/ninewinecfg.exe.so" "$PREFIX/bin64/ninewinecfg.exe.so"
install -d "$PREFIX/lib32"
ln "$PREFIX/wine/i386-unix/d3d9-nine.dll.so" "$PREFIX/lib32/d3d9-nine.dll.so"
install -d "$PREFIX/bin32"
ln "$PREFIX/wine/i386-unix/ninewinecfg.exe.so" "$PREFIX/bin32/ninewinecfg.exe.so"

install -m 644 "$SRC/LICENSE" "$PREFIX/"
install -m 644 "$SRC/README.rst" "$PREFIX/"
install -m 755 "$SRC/tools/nine-install.sh" "$PREFIX/"
Expand Down
2 changes: 2 additions & 0 deletions tools/cross-wine32.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pkgconfig = '@PKG_CONFIG@'
c_args = ['-m32']
c_link_args = ['-m32', '-mwindows', '-L@WINE32_LIBDIR@']
needs_exe_wrapper = true
pe_dir = 'i386-windows'
so_dir = 'i386-unix'

[host_machine]
system = 'linux'
Expand Down
2 changes: 2 additions & 0 deletions tools/cross-wine64.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ pkgconfig = '@PKG_CONFIG@'
c_args = ['-m64']
c_link_args = ['-m64', '-mwindows', '-L@WINE64_LIBDIR@']
needs_exe_wrapper = true
pe_dir = 'x86_64-windows'
so_dir = 'x86_64-unix'

[host_machine]
system = 'linux'
Expand Down
12 changes: 8 additions & 4 deletions tools/nine-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ wine --version >/dev/null 2>&1 || die "wine not found"
DST=$(wine winepath -u 'c:\windows\system32')

echo "installing 32bit binaries to $DST"
ln -sf "$BASE/lib32/d3d9-nine.dll.so" "$DST/d3d9-nine.dll"
ln -sf "$BASE/bin32/ninewinecfg.exe.so" "$DST/ninewinecfg.exe"
pe_dir='i386-windows'
so_dir='i386-unix'
ln -sf "$BASE/wine/$so_dir/d3d9-nine.dll.so" "$DST/d3d9-nine.dll"
ln -sf "$BASE/wine/$so_dir/ninewinecfg.exe.so" "$DST/ninewinecfg.exe"

unset HAVE_WINE64
wine64 winepath >/dev/null 2>&1 && HAVE_WINE64=1
Expand All @@ -27,8 +29,10 @@ fi
DST=$(wine64 winepath -u 'c:\windows\system32')

echo "installing 64bit binaries to $DST"
ln -sf "$BASE/lib64/d3d9-nine.dll.so" "$DST/d3d9-nine.dll"
ln -sf "$BASE/bin64/ninewinecfg.exe.so" "$DST/ninewinecfg.exe"
pe_dir='x86_64-windows'
so_dir='x86_64-unix'
ln -sf "$BASE/wine/$so_dir/d3d9-nine.dll.so" "$DST/d3d9-nine.dll"
ln -sf "$BASE/wine/$so_dir/ninewinecfg.exe.so" "$DST/ninewinecfg.exe"

echo "enabling gallium nine"
wine64 ninewinecfg.exe -e
Expand Down