%global debug_package %{nil} %{?mingw_package_header} %ifarch x86_64 %global winepedir x86_64-windows %global target_x86_type 64 %global mingw_sysroot %mingw64_sysroot %global mingw_build_win64 1 %global mingw_build_win32 0 %else %global winepedir i386-windows %global target_x86_type 32 %global mingw_sysroot %mingw32_sysroot %global mingw_build_win64 0 %global mingw_build_win32 1 %endif Name: dxvk Version: 2.0 Release: 1%{?dist} Summary: Vulkan-based D3D11 and D3D10 implementation for Linux / Wine License: zlib URL: https://github.com/doitsujin/dxvk Source0: %{url}/archive/v%{version}/dxvk-%{version}.tar.gz Source1: dxvk-native.pc.in # Common BRs BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: glslang BuildRequires: meson BuildRequires: wine-devel BuildRequires: vulkan-headers BuildRequires: spirv-headers-devel # Native BRs BuildRequires: glslang BuildRequires: SDL2-devel BuildRequires: vulkan-loader-devel # Wine BRs %ifarch x86_64 BuildRequires: mingw64-filesystem BuildRequires: mingw64-binutils BuildRequires: mingw64-headers BuildRequires: mingw64-cpp BuildRequires: mingw64-gcc BuildRequires: mingw64-gcc-c++ BuildRequires: mingw64-winpthreads-static %else BuildRequires: mingw32-filesystem BuildRequires: mingw32-binutils BuildRequires: mingw32-headers BuildRequires: mingw32-cpp BuildRequires: mingw32-gcc BuildRequires: mingw32-gcc-c++ BuildRequires: mingw32-winpthreads-static %endif %description %{summary} %package native Summary: Vulkan-based D3D11 and D3D9 implementation for Linux Requires: vulkan-loader%{?_isa} Requires: SDL2%{?_isa} # Requires x86-specific headers for now... ExclusiveArch: %{ix86} x86_64 %description native DXVK Native is a port of DXVK to Linux which allows it to be used natively without Wine. This is primarily useful for game and application ports to either avoid having to write another rendering backend, or to help with port bringup during development. %package native-devel Summary: Development files used to build applications using dxvk Requires: dxvk-native%{?_isa} = %{version}-%{release} Requires: SDL2-devel%{?_isa} Requires: vulkan-loader-devel%{?_isa} %description native-devel This package provides the development libraries and other files for building applications that use %{name}. %package wine Summary: Vulkan-based D3D11 and D3D10 implementation for Wine Requires(pre): vulkan-tools Requires: wine-core%{?_isa} >= 6.8 Recommends: wine-dxvk-dxgi%{?_isa} = %{version}-%{release} Requires: vulkan-loader%{?_isa} Provides: wine-dxvk%{?_isa} = %{version}-%{release} Obsoletes: wine-dxvk < 2 # We want x86_64 users to always have also 32 bit lib, it's the same what wine does %ifarch x86_64 Requires: dxvk-wine(x86-32) = %{version}-%{release} %endif # Recommend also the d3d9 (former D9VK) Recommends: dxvk-wine-d3d9%{?_isa} = %{version}-%{release} Requires(posttrans): %{_sbindir}/alternatives wine-core%{?_isa} >= 6.8 Requires(preun): %{_sbindir}/alternatives ExclusiveArch: %{ix86} x86_64 %description wine %{summary} %package wine-dxgi Summary: Wine DXVK DXGI implementation %ifarch x86_64 Requires: dxvk-wine-dxgi(x86-32) = %{version}-%{release} %endif %description wine-dxgi %{summary} This package doesn't enable the use of this DXGI implementation, it should be installed and overridden per prefix. %package wine-d3d9 Summary: Wine DXVK D3D9 implementation Requires: dxvk-wine%{?_isa} = %{version}-%{release} # We want x86_64 users to always have also 32 bit lib, it's the same what wine does %ifarch x86_64 Requires: dxvk-wine-d3d9(x86-32) = %{version}-%{release} %endif %description wine-d3d9 %{summary} %prep %autosetup -n dxvk-%{version} -p1 # Copy out system include directories for spirv, vulkan and DirectX mkdir -p ./include/vulkan/include && cp -R /usr/include/vulkan ./include/vulkan/include mkdir -p ./include/spirv/include && cp -R /usr/include/spirv ./include/spirv/include mkdir -p ./include/native/directx && cp %{mingw_sysroot}/mingw/include/d3d*.h ./include/native/directx cp %{mingw_sysroot}/mingw/include/dx*.h ./include/native/directx %build ### Native %meson -Dbuild_id=true %meson_build ### Wine %mingw_meson --buildtype=plain --wrap-mode=nodownload --auto-features=enabled --cross-file ../build-win%{target_x86_type}.txt --buildtype release %mingw_ninja %install ### Native %meson_install # Install headers mkdir -p %{buildroot}%{_includedir}/%{name} cp -a include/native %{buildroot}%{_includedir}/%{name} # Install pkgconfig files mkdir -p %{buildroot}%{_libdir}/pkgconfig # Install dxvk-native-d3d9 pc file sed -e "s:@prefix@:%{_prefix}:g" \ -e "s:@libdir@:%{_libdir}:g" \ -e "s:@includedir@:%{_includedir}/%{name}:g" \ -e "s:@PACKAGE_VERSION@:%{version}:g" \ -e "s:@D3DVER@:9:g" \ %{SOURCE1} > %{buildroot}%{_libdir}/pkgconfig/%{name}-d3d9.pc # Install dxvk-native-d3d11 pc file sed -e "s:@prefix@:%{_prefix}:g" \ -e "s:@libdir@:%{_libdir}:g" \ -e "s:@includedir@:%{_includedir}/%{name}:g" \ -e "s:@PACKAGE_VERSION@:%{version}:g" \ -e "s:@D3DVER@:11:g" \ %{SOURCE1} > %{buildroot}%{_libdir}/pkgconfig/%{name}-d3d11.pc ### Wine %mingw_ninja_install winebuild --builtin %{buildroot}%{mingw_sysroot}/mingw/bin/dxgi.dll winebuild --builtin %{buildroot}%{mingw_sysroot}/mingw/bin/d3d9.dll winebuild --builtin %{buildroot}%{mingw_sysroot}/mingw/bin/d3d10core.dll winebuild --builtin %{buildroot}%{mingw_sysroot}/mingw/bin/d3d11.dll mkdir -p %{buildroot}%{_libdir}/wine/%{winepedir}/ install -p -m 644 %{buildroot}%{mingw_sysroot}/mingw/bin/dxgi.dll %{buildroot}%{_libdir}/wine/%{winepedir}/dxvk-dxgi.dll install -p -m 644 %{buildroot}%{mingw_sysroot}/mingw/bin/d3d9.dll %{buildroot}%{_libdir}/wine/%{winepedir}/dxvk-d3d9.dll install -p -m 644 %{buildroot}%{mingw_sysroot}/mingw/bin/d3d10core.dll %{buildroot}%{_libdir}/wine/%{winepedir}/dxvk-d3d10core.dll install -p -m 644 %{buildroot}%{mingw_sysroot}/mingw/bin/d3d11.dll %{buildroot}%{_libdir}/wine/%{winepedir}/dxvk-d3d11.dll # Clean-up rm -rf %{buildroot}%{mingw_sysroot}/mingw %posttrans wine if vulkaninfo |& grep "ERROR_INITIALIZATION_FAILED\|ERROR_SURFACE_LOST_KHR\|Vulkan support is incomplete" > /dev/null; then %{_sbindir}/alternatives --install %{_libdir}/wine/%{winepedir}/d3d10core.dll 'wine-d3d10%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d10core.dll 5 %{_sbindir}/alternatives --install %{_libdir}/wine/%{winepedir}/d3d11.dll 'wine-d3d11%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d11.dll 5 else %{_sbindir}/alternatives --install %{_libdir}/wine/%{winepedir}/d3d10core.dll 'wine-d3d10%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d10core.dll 20 %{_sbindir}/alternatives --install %{_libdir}/wine/%{winepedir}/d3d11.dll 'wine-d3d11%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d11.dll 20 fi %posttrans wine-d3d9 if vulkaninfo |& grep "ERROR_INITIALIZATION_FAILED\|ERROR_SURFACE_LOST_KHR\|Vulkan support is incomplete" > /dev/null; then %{_sbindir}/alternatives --install %{_libdir}/wine/%{winepedir}/d3d9.dll 'wine-d3d9%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d9.dll 5 else %{_sbindir}/alternatives --install %{_libdir}/wine/%{winepedir}/d3d9.dll 'wine-d3d9%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d9.dll 5 fi %postun wine %{_sbindir}/alternatives --remove 'wine-d3d10%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d10core.dll %{_sbindir}/alternatives --remove 'wine-d3d11%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d11.dll %postun wine-d3d9 %{_sbindir}/alternatives --remove 'wine-d3d9%{?_isa}' %{_libdir}/wine/%{winepedir}/dxvk-d3d9.dll %files native %license LICENSE %doc README.md # The libraries are ABI stable and match Windows conventions %{_libdir}/libdxvk_d3d9.so %{_libdir}/libdxvk_d3d10core.so %{_libdir}/libdxvk_d3d11.so %{_libdir}/libdxvk_dxgi.so %files native-devel %{_libdir}/pkgconfig/*.pc %{_includedir}/%{name}/ %files wine %license LICENSE %doc README.md %{_libdir}/wine/%{winepedir}/dxvk-d3d10core.dll %{_libdir}/wine/%{winepedir}/dxvk-d3d11.dll %files wine-d3d9 %license LICENSE %{_libdir}/wine/%{winepedir}/dxvk-d3d9.dll %files wine-dxgi %license LICENSE %{_libdir}/wine/%{winepedir}/dxvk-dxgi.dll %changelog * Fri Dec 09 2022 Frantisek Zatloukal - 2.0-1 - Release 2.0 (closes RHBZ#) - Merged dxvk-native and wine-dxvk packages