Skip to content

Commit

Permalink
Follow Wine's libdir structure
Browse files Browse the repository at this point in the history
Not only is this friendlier to packagers, but it enables usage via
WINEDLLPATH.

Fixes #123
  • Loading branch information
9ary committed Mar 18, 2023
1 parent 60f5a52 commit 5e01acb
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 12 deletions.
7 changes: 6 additions & 1 deletion 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 @@ -54,6 +55,10 @@ d3d9_fake = shared_library(
d3d9_res,
],
name_prefix : '',
name_suffix : 'dll.fake',
name_suffix : 'dll',
install : true,
install_dir : pe_dir,
link_args : [
'-Wb,--fake-module',
],
)
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.54',
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_external_property('pe_dir')
so_dir = get_option('libdir') / 'wine' / meson.get_external_property('so_dir')

subdir('common')
subdir('d3d9-nine')
subdir('ninewinecfg')
9 changes: 7 additions & 2 deletions 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 @@ -40,6 +41,10 @@ ninewinecfg_fake = executable(
ninewinecfg_res,
],
name_prefix : '',
name_suffix : 'exe.fake',
name_suffix : 'exe',
install : true,
install_dir : pe_dir,
link_args : [
'-Wb,--fake-module',
],
)
6 changes: 2 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,8 +43,7 @@ meson \
--cross-file "$SRC/tools/cross-wine32" \
--buildtype "release" \
--prefix "$PREFIX" \
--bindir bin32 \
--libdir lib32 \
--libdir '' \
"$@" \
"$TMP/build32"

Expand Down
2 changes: 2 additions & 0 deletions tools/cross-wine32.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ c_link_args = ['-m32', '-mwindows', '-L@WINE32_LIBDIR@']

[properties]
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 @@ -10,6 +10,8 @@ c_link_args = ['-m64', '-mwindows', '-L@WINE64_LIBDIR@']

[properties]
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

0 comments on commit 5e01acb

Please sign in to comment.