Build with new vulkan

This commit is contained in:
survolog 2018-06-19 00:10:12 +03:00
parent 1dea6e126e
commit 05b43cec57
3 changed files with 89 additions and 31 deletions

9
README.urpmi Normal file
View file

@ -0,0 +1,9 @@
In order to set up a wine to use DXVK (DirectX11->Vulkan)
instead of wined3d globally, run in terminal dxvk64
For removal DXVK delete d3d11 and dxgi in the tab 'Libraries' of winecfg.
=== Russian ===
Для того, чтобы настроить wine использовать DXVK (DirectX11->Vulkan)
вместо wined3d для всех приложений, запустите в терминале dxvk64
Для устранения DXVK удалите d3d11 и dxgi во вкладке "Библиотеки" winecfg.

39
crossover_hack.patch Normal file
View file

@ -0,0 +1,39 @@
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 0883da5..99e3149 100644
--- a/dlls/kernel32/process.c
+++ b/dlls/kernel32/process.c
@@ -2651,6 +2651,33 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
return FALSE;
if (hFile == INVALID_HANDLE_VALUE) goto done;
+ /* CROSSOVER HACK: bug 13322 (winehq bug 39403)
+ * Insert --no-sandbox in command line of Steam's web helper process to
+ * work around problems hooking our ntdll exports. */
+ {
+ static const WCHAR steamwebhelperexeW[] = {'s','t','e','a','m','w','e','b','h','e','l','p','e','r','.','e','x','e',0};
+ static const WCHAR nosandboxW[] = {' ','-','-','n','o','-','s','a','n','d','b','o','x',0};
+
+ if (strstrW(name, steamwebhelperexeW))
+ {
+ LPWSTR new_command_line;
+
+ new_command_line = HeapAlloc(GetProcessHeap(), 0,
+ sizeof(WCHAR) * (strlenW(tidy_cmdline) + strlenW(nosandboxW) + 1));
+
+ if (!new_command_line) return FALSE;
+
+ strcpyW(new_command_line, tidy_cmdline);
+ strcatW(new_command_line, nosandboxW);
+
+ TRACE("CrossOver hack changing command line to %s\n", debugstr_w(new_command_line));
+
+ if (tidy_cmdline != cmd_line) HeapFree( GetProcessHeap(), 0, tidy_cmdline );
+ tidy_cmdline = new_command_line;
+ }
+ }
+ /* end CROSSOVER HACK */
+
/* Warn if unsupported features are used */
if (flags & (IDLE_PRIORITY_CLASS | HIGH_PRIORITY_CLASS | REALTIME_PRIORITY_CLASS |

View file

@ -17,15 +17,16 @@
%define devname %mklibname %{name} -d
# Switch between systemd-binfmt and sysvinit support
%bcond_without systemd
%define with_systemd 1
%define winetricks_ver 20180603
%define dxvk_ver 0.54
%define d3d9_ver %{version}
Summary: WINE Is Not An Emulator - runs MS Windows programs
Name: wine
Version: 3.10
Release: 2
Release: 3
Epoch: 2
License: LGPLv2+
Group: Emulators
@ -43,12 +44,13 @@ Source4: https://github.com/wine-staging/wine-staging/archive/v%{version}.tar.gz
# Wine Gallium Nine patches for wine-staging %%{version}
# from https://github.com/sarnex/wine-d3d9-patches.
# Install staging-helper before wine-d3d9
Source5: https://github.com/sarnex/wine-d3d9-patches/archive/wine-d3d9-%{version}.tar.gz?/wine-d3d9-patches-wine-d3d9-%{version}.tar.gz
Source5: https://github.com/sarnex/wine-d3d9-patches/archive/wine-d3d9-%{version}.tar.gz?/wine-d3d9-patches-wine-d3d9-%{d3d9_ver}.tar.gz
Source6: https://github.com/Winetricks/winetricks/blob/%{winetricks_ver}/src/winetricks
Source7: http://kegel.com/wine/wisotool
# Vulkan layer for support Direct3D 11 in wine
# https://github.com/doitsujin/dxvk
Source8: https://github.com/doitsujin/dxvk/releases/download/v%{dxvk_ver}/dxvk-%{dxvk_ver}.tar.gz
Source9: README.urpmi
Source10: wine.rpmlintrc
# (Anssi 05/2008) Adds:
@ -60,6 +62,9 @@ Source10: wine.rpmlintrc
# have to substitute @MDKVERSION@ in dlls/ntdll/server.c
Patch0: wine-mdkconf.patch
Patch1: wine-3.6-staging-ru-localization.patch
# Working workaround for Steam troubles
# Also fixed by passing -no-cef-sandbox to the cmd line
Patch2: crossover_hack.patch
BuildRequires: bison
BuildRequires: chrpath
@ -107,8 +112,8 @@ BuildRequires: pkgconfig(librsvg-2.0)
BuildRequires: pkgconfig(libtiff-4)
BuildRequires: pkgconfig(libv4l2)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(libxslt)
BuildRequires: pkgconfig(libvkd3d)
BuildRequires: pkgconfig(libxslt)
BuildRequires: pkgconfig(ncursesw)
BuildRequires: pkgconfig(openal)
BuildRequires: pkgconfig(OpenCL)
@ -151,7 +156,7 @@ Requires: libfreetype.so.6%{mark64}
Requires: libpng16.so.16%{mark64}
Requires: libXi.so.6%{mark64}
Requires: libXrender.so.1%{mark64}
# This one is in Restricted repository so only suggest it
# This one is now part of Mesa
Suggests: libtxc_dxtn.so%{mark64}
%else
# on 32-bit we always want wine32 package
@ -165,17 +170,17 @@ Provides: wine-bin = %{EVRD}
%rename %{libname}
%rename winetricks
Requires: xmessage
Suggests: sane-frontends
Suggests: vkd3d
# for dxvk:
Suggests: vulkan
# for winetricks:
Requires: cabextract
Requires: unzip
Suggests: webcore-fonts
Suggests: %{wine}-binfmt
Requires(post,postun): desktop-common-data
Requires(post,preun): rpm-helper
Suggests: %{wine}-binfmt
Suggests: sane-frontends
# for dxvk:
Suggests: vulkan
Suggests: vkd3d
Suggests: webcore-fonts
%ifarch %{ix86}
Conflicts: wine64
@ -253,9 +258,10 @@ programs.
Summary: Support for launching Windows executables directly
Group: Emulators
Requires: %{wine} = %{EVRD}
Requires(post): rpm-helper
Requires(post): %{wine} = %{EVRD}
%if %{with systemd}
Requires(post,postun): systemd
%if %{with_systemd}
Requires(pre,post,preun,postun): systemd
%endif
Conflicts: %{wine} < 2:2.21-2
@ -265,24 +271,27 @@ Wine is a program which allows running Microsoft Windows programs
This package provides support for launching Windows executables directly.
%files -n %{wine}-binfmt
%if %{with systemd}
%if %{with_systemd}
%{_binfmtdir}/%{name}.conf
%else
%{_initrddir}/%{name}
%endif
%if %{with systemd}
%if %{with_systemd}
# Systemd binfmt support
%pre -n %{wine}-binfmt
systemctl stop systemd-binfmt.service
%post -n %{wine}-binfmt
%binfmt_apply %{name}.conf
%postun -n %{wine}-binfmt
%_postun_unit systemd-binfmt.service
%else
# Old sysvinit
%post -n %{wine}-binfmt
%_post_service %{name}
%preun -n %{wine}-binfmt
%_preun_service %{name}
%endif
@ -340,6 +349,7 @@ Wine is often updated.
%setup -qn %{name}-%{version} -a5 -a8
%patch0 -p1 -b .conf
%patch1 -p1 -b .staging-localization
%patch2 -p1 -b .crossover_hack
# Wine-staging
gzip -dc "%{SOURCE4}" | /bin/tar -xf - --strip-components=1
@ -348,8 +358,8 @@ gzip -dc "%{SOURCE4}" | /bin/tar -xf - --strip-components=1
./patches/patchinstall.sh DESTDIR="%{_builddir}/wine-%{version}" --all
# Gallium Nine support
patch -p1 < wine-d3d9-patches-wine-d3d9-%{version}/staging-helper.patch
patch -p1 < wine-d3d9-patches-wine-d3d9-%{version}/wine-d3d9.patch
patch -p1 < wine-d3d9-patches-wine-d3d9-%{d3d9_ver}/staging-helper.patch
patch -p1 < wine-d3d9-patches-wine-d3d9-%{d3d9_ver}/wine-d3d9.patch
sed -i 's,@MDKVERSION@,%{mdvver},' dlls/ntdll/server.c
@ -385,7 +395,8 @@ autoreconf -vfi
install -m 0755 %{SOURCE6} %{buildroot}%{_bindir}/
install -m 0755 %{SOURCE7} %{buildroot}%{_bindir}/
# Note: binfmt is insecure, see https://nixtux.ru/450
# Note: binfmt is insecure (see https://nixtux.ru/450),
# so we will put it in a separate package
# Allow users to launch Windows programs by just clicking on the .exe file...
%if %{with systemd}
# ... using systemd (>= 230)
@ -496,32 +507,31 @@ sed -i 's,Icon=%{name},Icon=regedit,' %{buildroot}%{_datadir}/applications/rosa-
sed -i 's,Icon=%{name},Icon=winemine,' %{buildroot}%{_datadir}/applications/rosa-wine-winemine.desktop
sed -i 's,Icon=%{name},Icon=msiexec,' "%{buildroot}%{_datadir}/applications/rosa-wine-wine uninstaller.desktop"
# Remove rpaths
%ifarch x86_64
chrpath -d %{buildroot}%{_bindir}/{wine64,wineserver,wmc,wrc} %{buildroot}%{_libdir}/%{name}/*.so
%else
chrpath -d %{buildroot}%{_bindir}/{wine,wineserver,wmc,wrc} %{buildroot}%{_libdir}/%{name}/*.so
%endif
# Some advices to user
cp %{SOURCE9} .
%ifarch x86_64
cat > README.install.urpmi <<EOF
This is the Win64 version of Wine. This version can only be used to run
64-bit Windows applications as is. For running 32-bit Windows applications,
you need to also install the 'wine32' package from the 32-bit repository.
Experimental!
In order to set up a wine prefix to use DXVK instead of wined3d globally, run:
env WINEPREFIX=/your/wineprefix dxvk64
For running dxvk32 you need to also install the 'wine32' package from
the 32-bit repository and run
env WINEPREFIX=/your/wineprefix dxvk32
This is the Win64 version of Wine with Staging but not limited to it.
This version can only be used to run 64-bit Windows applications as is.
For running 32-bit Windows applications or dxvk32, you need to also
install the 'wine32' package from the 32-bit repository.
EOF
%else
cat > README.install.urpmi <<EOF
Experimental!
In order to set up a wine prefix to use DXVK instead of wined3d globally, run:
env WINEPREFIX=/your/wineprefix dxvk32
This is the Win32 version of Wine with Staging but not limited to it.
EOF
sed -i 's/64/32/g' README.urpmi
%endif
# Install dxvk library binary for interfacing Direct3D 11 <-> Vulkan
%ifarch x86_64
mkdir -p %{buildroot}%{_libdir}/%{name}/dxvkdlls/
cp dxvk-%{dxvk_ver}/x64/* %{buildroot}%{_libdir}/%{name}/dxvkdlls/
@ -533,7 +543,7 @@ ln -s %{_libdir}/%{name}/dxvkdlls/setup_dxvk.sh %{buildroot}%{_bindir}/dxvk32
%endif
%files -n %{wine}
%doc ANNOUNCE AUTHORS README README.install.urpmi
%doc ANNOUNCE AUTHORS README README.install.urpmi README.urpmi
%ifarch x86_64
%{_bindir}/wine64
%{_bindir}/wine64-preloader