From 16e9b550259092803b1d7fcf9f98863060c22862 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 26 Jan 2023 22:44:30 -0500 Subject: [PATCH 1/5] dxvk: vendor `setup_dxvk.sh` Upstream will remove the `setup_dxvk.sh` in DXVK 2.1. To avoid breaking users of the current derivation, vendor `setup_dxvk.sh`. This script is based on the upstream script with some modifications: - Update command-line parsing; and - Reorganized action processing logic. --- pkgs/misc/dxvk/default.nix | 14 +- pkgs/misc/dxvk/mcfgthread.patch | 34 ---- pkgs/misc/dxvk/setup_dxvk.sh | 265 ++++++++++++++++++++++++++++++++ 3 files changed, 271 insertions(+), 42 deletions(-) delete mode 100644 pkgs/misc/dxvk/mcfgthread.patch create mode 100644 pkgs/misc/dxvk/setup_dxvk.sh diff --git a/pkgs/misc/dxvk/default.nix b/pkgs/misc/dxvk/default.nix index 2c55b6b50cef..817014e192b1 100644 --- a/pkgs/misc/dxvk/default.nix +++ b/pkgs/misc/dxvk/default.nix @@ -3,6 +3,7 @@ , stdenvNoCC , fetchFromGitHub , pkgsCross +, bash }: stdenvNoCC.mkDerivation (finalAttrs: @@ -56,20 +57,17 @@ stdenvNoCC.mkDerivation (finalAttrs: outputs = [ "out" "bin" "lib" ]; - # Also copy `mcfgthread-12.dll` due to DXVK’s being built in a MinGW cross environment. - patches = [ ./mcfgthread.patch ]; - dontConfigure = true; dontBuild = true; installPhase = '' mkdir -p $out/bin $bin $lib - # Replace both basedir forms to support both DXVK 2.0 and older versions. - substitute setup_dxvk.sh $out/bin/setup_dxvk.sh \ + substitute ${./setup_dxvk.sh} $out/bin/setup_dxvk.sh \ + --subst-var-by bash ${bash} \ + --subst-var-by dxvk32 ${dxvk32} \ + --subst-var-by dxvk64 ${dxvk64} \ --subst-var-by mcfgthreads32 "${pkgsCross.mingw32.windows.mcfgthreads}" \ - --subst-var-by mcfgthreads64 "${pkgsCross.mingwW64.windows.mcfgthreads}" \ - --replace 'basedir=$(dirname "$(readlink -f $0)")' "basedir=$bin" \ - --replace 'basedir="$(dirname "$(readlink -f "$0")")"' "basedir=$bin" + --subst-var-by mcfgthreads64 "${pkgsCross.mingwW64.windows.mcfgthreads}" chmod a+x $out/bin/setup_dxvk.sh declare -A dxvks=( [x32]=${dxvk32} [x64]=${dxvk64} ) for arch in "''${!dxvks[@]}"; do diff --git a/pkgs/misc/dxvk/mcfgthread.patch b/pkgs/misc/dxvk/mcfgthread.patch deleted file mode 100644 index 037071630172..000000000000 --- a/pkgs/misc/dxvk/mcfgthread.patch +++ /dev/null @@ -1,34 +0,0 @@ -diff --git a/setup_dxvk.sh b/setup_dxvk.sh -index 3e63ecf0..87c04f23 100755 ---- a/setup_dxvk.sh -+++ b/setup_dxvk.sh -@@ -133,6 +133,8 @@ - rm -v "${dstfile}" - fi - $file_cmd "${srcfile}" "${dstfile}" -+ elif [ "${4}" = "--force" ]; then -+ $file_cmd "${srcfile}" "${dstfile}" - else - echo "${dstfile}: File not found in wine prefix" >&2 - return 1 -@@ -170,12 +172,12 @@ - } - - install() { -- installFile "$win64_sys_path" "$dxvk_lib64" "$1" -+ installFile "$win64_sys_path" "$dxvk_lib64" "$1" "${2-}" - inst64_ret="$?" - - inst32_ret=-1 - if $wow64; then -- installFile "$win32_sys_path" "$dxvk_lib32" "$1" -+ installFile "$win32_sys_path" "$dxvk_lib32" "$1" "${2-}" - inst32_ret="$?" - fi - -@@ -214,3 +216,5 @@ - - $action d3d10core - $action d3d11 -+ -+basedir="" dxvk_lib32=@mcfgthreads32@/bin dxvk_lib64=@mcfgthreads64@/bin $action mcfgthread-12 --force diff --git a/pkgs/misc/dxvk/setup_dxvk.sh b/pkgs/misc/dxvk/setup_dxvk.sh new file mode 100644 index 000000000000..8fadb264fd3d --- /dev/null +++ b/pkgs/misc/dxvk/setup_dxvk.sh @@ -0,0 +1,265 @@ +#!@bash@/bin/bash -e + +set -eu -o pipefail + +dxvk32_dir=@dxvk32@/bin +dxvk64_dir=@dxvk64@/bin + +mcfgthreads32_dir=@mcfgthreads32@/bin +mcfgthreads64_dir=@mcfgthreads64@/bin + +## Defaults + +declare -A dlls=( + [d3d9]="dxvk/d3d9.dll" + [d3d10]="dxvk/d3d10.dll dxvk/d3d10_1.dll dxvk/d3d10core.dll" + [d3d11]="dxvk/d3d11.dll" + [dxgi]="dxvk/dxgi.dll" + [mcfgthreads]="mcfgthreads/mcfgthread-12.dll" +) + +declare -A targets=([d3d9]=1 [d3d11]=1 [dxgi]=1 [mcfgthreads]=1) + +## Command-line Parsing + +usage() { + echo "DXVK @version@" + echo "Set up Wine prefix with DXVK DLLs" + echo + echo "USAGE" + echo " $0 [install|uninstall] [OPTIONS]" + echo + echo "COMMANDS" + echo " install Copy the DXVK DLLs into the prefix" + echo " uninstall Restore the backed up Wine DLLs in the prefix" + echo + echo "OPTIONS" + echo " --with(out)-dxgi Copy DXVK DXGI DLL into prefix (default: with DXGI)" + echo " --with(out)-d3d10 Copy D3D10 DLLs into prefix (default: without D3D10)" + echo " -s, --symlink Symlink instead of copy" + echo " -f, --force Create a Wine prefix even if it does not exist" + echo " -p, --prefix Wine prefix to manage (default: \$WINEPREFIX)" + exit 1 +} + +case "$1" in + uninstall|install) + action=$1 + shift + ;; + -h|--help) + usage + ;; + *) + if [ ! -z "${1:-}" ]; then + echo "Unrecognized command: $1" + fi + usage + ;; +esac + + +do_symlink=false +do_makeprefix=false + +while [ ! -z "${1:-}" ]; do + case "$1" in + --with-dxgi) + targets[dxgi]=1 + ;; + --without-dxgi) + unset targets[dxgi] + ;; + --with-d3d10) + targets[d3d10]=1 + ;; + --without-d3d10) + unset targets[d3d10] + ;; + -s|--symlink) + do_symlink=true + ;; + --no-symlink) + do_symlink=false + ;; + -f|--force) + do_makeprefix=true + ;; + --no-force) + do_makeprefix=false + ;; + -p|--prefix) + shift + if [ ! -z "${1:-}" ]; then + WINEPREFIX=$1 + else + echo "Required PREFIX missing" + usage + fi + ;; + -h|--help) + usage + ;; + *) + echo "Unrecognized option: $1" + usage + ;; + esac + shift +done + +## Get information on the Wine environment + +export WINEPREFIX=${WINEPREFIX:-"$HOME/.wine"} + +# check wine prefix before invoking wine, so that we +# don't accidentally create one if the user screws up +if ! $do_makeprefix && [ -n "$WINEPREFIX" ] && ! [ -f "$WINEPREFIX/system.reg" ]; then + echo "$WINEPREFIX: Not a valid wine prefix." >&2 + exit 1 +fi + +export WINEDEBUG=-all +# disable mscoree and mshtml to avoid downloading +# wine gecko and mono +export WINEDLLOVERRIDES="mscoree,mshtml=" + +wine="wine" +wine64="wine64" +wineboot="wineboot" + +# $PATH is the way for user to control where wine is located (including custom Wine versions). +# Pure 64-bit Wine (non Wow64) requries skipping 32-bit steps. +# In such case, wine64 and winebooot will be present, but wine binary will be missing, +# however it can be present in other PATHs, so it shouldn't be used, to avoid versions mixing. +wine_path=$(dirname "$(command -v $wineboot)") +wow64=true +if ! [ -f "$wine_path/$wine" ]; then + wine=$wine64 + wow64=false +fi + +# resolve 32-bit and 64-bit system32 path +winever=$($wine --version | grep wine) +if [ -z "$winever" ]; then + echo "$wine: Not a wine executable. Check your $wine." >&2 + exit 1 +fi + +# ensure wine placeholder dlls are recreated +# if they are missing +$wineboot -u + +win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null) +win64_sys_path="${win64_sys_path/$'\r'/}" +if $wow64; then + win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null) + win32_sys_path="${win32_sys_path/$'\r'/}" +fi + +if [ -z "${win32_sys_path:-}" ] && [ -z "${win64_sys_path:-}" ]; then + echo 'Failed to resolve C:\windows\system32.' >&2 + exit 1 +fi + +## Utility functions + +install_file() { + $do_symlink && file_cmd="ln -sv" || file_cmd="install -m 755 -v" + + srcfile=$1 + dstfile=$2 + + if [ -f "${srcfile}.so" ]; then + srcfile="${srcfile}.so" + fi + + if ! [ -f "${srcfile}" ]; then + echo "${srcfile}: File not found. Skipping." >&2 + return 1 + fi + + if [ -n "$1" ]; then + if [ -f "${dstfile}" ] || [ -h "${dstfile}" ]; then + if ! [ -f "${dstfile}.old" ]; then + mv -v "${dstfile}" "${dstfile}.old" + else + rm -v "${dstfile}" + fi + fi + $file_cmd "${srcfile}" "${dstfile}" + else + echo "${dstfile}: File not found in wine prefix" >&2 + return 1 + fi +} + +uninstall_file() { + srcfile=$1 + dstfile=$2 + + if [ -f "${srcfile}.so" ]; then + srcfile="${srcfile}.so" + fi + + if ! [ -f "${srcfile}" ]; then + echo "${srcfile}: File not found. Skipping." >&2 + return 1 + fi + + if ! [ -f "${dstfile}" ] && ! [ -h "${dstfile}" ]; then + echo "${dstfile}: File not found. Skipping." >&2 + return 1 + fi + + if [ -f "${dstfile}.old" ]; then + rm -v "${dstfile}" + mv -v "${dstfile}.old" "${dstfile}" + return 0 + else + return 1 + fi +} + +install_override() { + dll=$(basename "$1") + $wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$dll" /d native /f >/dev/null 2>&1 + if [ $? -ne 0 ]; then + echo -e "Failed to add override for $dll" + exit 1 + fi +} + +uninstall_override() { + dll=$(basename "$1") + $wine reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v "$dll" /f > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo "Failed to remove override for $dll" + fi +} + +## Perform the requested command + +declare -A paths + +for target in "${!targets[@]}"; do + [ ${targets[$target]} -eq 1 ] || continue + for dll in ${dlls[$target]}; do + dllname=$(basename "$dll") + basedir=$(dirname "$dll") + + if [ ! -z "${win32_sys_path:-}" ]; then + basedir32=${basedir}32_dir + paths["${!basedir32}/$dllname"]="$win32_sys_path/$dllname" + fi + if [ ! -z "${win64_sys_path:-}" ]; then + basedir64=${basedir}64_dir + paths["${!basedir64}/$dllname"]="$win64_sys_path/$dllname" + fi + done +done + +for srcpath in "${!paths[@]}"; do + ${action}_file "$srcpath" "${paths["$srcpath"]}" + ${action}_override "$(basename srcpath)" +done From 403fe21323e4d33021ef296d0057cdd08f6c3c17 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 26 Jan 2023 23:23:26 -0500 Subject: [PATCH 2/5] dxvk: expose Windows derivations This is in preparation for native builds of DXVK, but it also allows users to choose to use an older version if that is more compatible with their hardware. --- pkgs/misc/dxvk/default.nix | 49 ++++----------------------------- pkgs/misc/dxvk/dxvk.nix | 42 +++++++++++++++++++++++----- pkgs/top-level/all-packages.nix | 2 ++ 3 files changed, 42 insertions(+), 51 deletions(-) diff --git a/pkgs/misc/dxvk/default.nix b/pkgs/misc/dxvk/default.nix index 817014e192b1..cf1f12a2b71f 100644 --- a/pkgs/misc/dxvk/default.nix +++ b/pkgs/misc/dxvk/default.nix @@ -1,62 +1,23 @@ { lib -, pkgs , stdenvNoCC , fetchFromGitHub , pkgsCross +, stdenv , bash }: stdenvNoCC.mkDerivation (finalAttrs: let - system = lib.toLower stdenvNoCC.targetPlatform.uname.system; - - # DXVK needs to be a separate derivation because it’s actually a set of DLLs for Windows that - # needs to be built with a cross-compiler. - dxvk32 = pkgsCross.mingw32.callPackage ./dxvk.nix { - inherit (finalAttrs) src version dxvkPatches; - }; - dxvk64 = pkgsCross.mingwW64.callPackage ./dxvk.nix { - inherit (finalAttrs) src version dxvkPatches; - }; - - # Split out by platform to make maintenance easy in case supported versions on Darwin and other - # platforms diverge (due to the need for Darwin-specific patches that would fail to apply). - # Should that happen, set `darwin` to the last working `rev` and `hash`. - srcs = rec { - darwin = { - rev = "v${finalAttrs.version}"; - hash = "sha256-T93ZylxzJGprrP+j6axZwl2d3hJowMCUOKNjIyNzkmE="; - version = "1.10.3"; - }; - default = { - rev = "v${finalAttrs.version}"; - hash = "sha256-mboVLdPgZMzmqyeF0jAloEz6xqfIDiY/X98e7l2KZnw="; - version = "2.0"; - }; - }; + dxvk32 = if stdenv.isDarwin then pkgsCross.mingw32.dxvk_1 else pkgsCross.mingw32.dxvk_2; + dxvk64 = if stdenv.isDarwin then pkgsCross.mingwW64.dxvk_1 else pkgsCross.mingwW64.dxvk_2; in { name = "dxvk"; - inherit (srcs."${system}" or srcs.default) version; - - src = fetchFromGitHub { - owner = "doitsujin"; - repo = "dxvk"; - inherit (srcs."${system}" or srcs.default) rev hash; - }; - - # Override this to patch DXVK itself (rather than the setup script). - dxvkPatches = lib.optionals stdenvNoCC.isDarwin [ - # Patch DXVK to work with MoltenVK even though it doesn’t support some required features. - # Some games work poorly (particularly Unreal Engine 4 games), but others work pretty well. - ./darwin-dxvk-compat.patch - # Use synchronization primitives from the C++ standard library to avoid deadlocks on Darwin. - # See: https://www.reddit.com/r/macgaming/comments/t8liua/comment/hzsuce9/ - ./darwin-thread-primitives.patch - ]; + inherit (dxvk64) version; outputs = [ "out" "bin" "lib" ]; + dontUnpack = true; dontConfigure = true; dontBuild = true; diff --git a/pkgs/misc/dxvk/dxvk.nix b/pkgs/misc/dxvk/dxvk.nix index 7607c9ee4412..9e00ecc343a7 100644 --- a/pkgs/misc/dxvk/dxvk.nix +++ b/pkgs/misc/dxvk/dxvk.nix @@ -5,28 +5,56 @@ , meson , ninja , windows -, src -, version +, dxvkVersion , spirv-headers , vulkan-headers -, dxvkPatches }: let # DXVK 2.0+ no longer vendors certain dependencies. This derivation also needs to build on Darwin, # which does not currently support DXVK 2.0, so adapt conditionally for this situation. - isDxvk2 = lib.versionAtLeast version "2.0"; + isDxvk2 = lib.versionAtLeast (srcs.${dxvkVersion}.version) "2.0"; + + # DXVK has effectively the same build script regardless of platform. + srcs = { + "1.10" = rec { + version = "1.10.3"; + src = fetchFromGitHub { + owner = "doitsujin"; + repo = "dxvk"; + rev = "v${version}"; + hash = "sha256-T93ZylxzJGprrP+j6axZwl2d3hJowMCUOKNjIyNzkmE="; + }; + # These patches are required when using DXVK with Wine on Darwin. + patches = lib.optionals stdenv.buildPlatform.isDarwin [ + # Patch DXVK to work with MoltenVK even though it doesn’t support some required features. + # Some games work poorly (particularly Unreal Engine 4 games), but others work pretty well. + ./darwin-dxvk-compat.patch + # Use synchronization primitives from the C++ standard library to avoid deadlocks on Darwin. + # See: https://www.reddit.com/r/macgaming/comments/t8liua/comment/hzsuce9/ + ./darwin-thread-primitives.patch + ]; + }; + "2.0" = rec { + version = "2.0"; + src = fetchFromGitHub { + owner = "doitsujin"; + repo = "dxvk"; + rev = "v${version}"; + hash = "sha256-mboVLdPgZMzmqyeF0jAloEz6xqfIDiY/X98e7l2KZnw="; + }; + patches = [ ]; + }; + }; in stdenv.mkDerivation { pname = "dxvk"; - inherit src version; + inherit (srcs.${dxvkVersion}) version src patches; nativeBuildInputs = [ glslang meson ninja ]; buildInputs = [ windows.pthreads ] ++ lib.optionals isDxvk2 [ spirv-headers vulkan-headers ]; - patches = dxvkPatches; - preConfigure = lib.optionalString isDxvk2 '' ln -s ${lib.getDev spirv-headers}/include include/spirv/include ln -s ${lib.getDev vulkan-headers}/include include/vulkan/include diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 235b6c1229b3..0d09810ef2ff 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37209,6 +37209,8 @@ with pkgs; dump = callPackage ../tools/backup/dump { }; dxvk = callPackage ../misc/dxvk { }; + dxvk_1 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "1.10"; }; + dxvk_2 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "2.0"; }; ecdsatool = callPackage ../tools/security/ecdsatool { }; From 67a2ceab6a9529413304cfe5ffed7c6383d88334 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Thu, 26 Jan 2023 23:38:10 -0500 Subject: [PATCH 3/5] dxvk: add native Linux build --- pkgs/misc/dxvk/dxvk.nix | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/pkgs/misc/dxvk/dxvk.nix b/pkgs/misc/dxvk/dxvk.nix index 9e00ecc343a7..e0a104ff354e 100644 --- a/pkgs/misc/dxvk/dxvk.nix +++ b/pkgs/misc/dxvk/dxvk.nix @@ -8,6 +8,7 @@ , dxvkVersion , spirv-headers , vulkan-headers +, SDL2 }: let @@ -41,23 +42,31 @@ let owner = "doitsujin"; repo = "dxvk"; rev = "v${version}"; - hash = "sha256-mboVLdPgZMzmqyeF0jAloEz6xqfIDiY/X98e7l2KZnw="; + hash = "sha256-mSNFvoILsvm+CpWV7uRlb7DkjV7ctClSUdteNcF5EAY="; + fetchSubmodules = true; # Needed for the DirectX headers and libdisplay-info }; patches = [ ]; }; }; + + isWindows = stdenv.targetPlatform.uname.system == "Windows"; + isCross = stdenv.hostPlatform != stdenv.targetPlatform; in stdenv.mkDerivation { pname = "dxvk"; inherit (srcs.${dxvkVersion}) version src patches; nativeBuildInputs = [ glslang meson ninja ]; - buildInputs = [ windows.pthreads ] - ++ lib.optionals isDxvk2 [ spirv-headers vulkan-headers ]; + buildInputs = lib.optional isWindows [ windows.pthreads ] + ++ lib.optionals isDxvk2 ( + [ spirv-headers vulkan-headers ] + ++ lib.optional (!isWindows && sdl2Support) SDL2 + ); - preConfigure = lib.optionalString isDxvk2 '' - ln -s ${lib.getDev spirv-headers}/include include/spirv/include - ln -s ${lib.getDev vulkan-headers}/include include/vulkan/include + # Build with the Vulkan SDK in nixpkgs. + preConfigure = '' + rm -rf include/spirv/include include/vulkan/include + mkdir -p include/spirv/include include/vulkan/include ''; mesonFlags = @@ -66,9 +75,11 @@ stdenv.mkDerivation { in [ "--buildtype" "release" - "--cross-file" "build-win${arch}.txt" "--prefix" "${placeholder "out"}" - ]; + ] + ++ lib.optionals isCross [ "--cross-file" "build-win${arch}.txt" ]; + + doCheck = isDxvk2 && !isCross; meta = { description = "A Vulkan-based translation layer for Direct3D 9/10/11"; @@ -76,6 +87,6 @@ stdenv.mkDerivation { changelog = "https://github.com/doitsujin/dxvk/releases"; maintainers = [ lib.maintainers.reckenrode ]; license = lib.licenses.zlib; - platforms = lib.platforms.windows; + platforms = lib.platforms.windows ++ lib.optionals isDxvk2 lib.platforms.linux; }; } From 81a86d07e6d9e237004461c2f8de256f4ed83e3e Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Fri, 27 Jan 2023 00:50:05 -0500 Subject: [PATCH 4/5] dxvk: 2.0 -> 2.1 https://github.com/doitsujin/dxvk/releases/tag/v2.1 --- pkgs/misc/dxvk/dxvk.nix | 22 ++++++++++++++++++---- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/pkgs/misc/dxvk/dxvk.nix b/pkgs/misc/dxvk/dxvk.nix index e0a104ff354e..793264f9b30b 100644 --- a/pkgs/misc/dxvk/dxvk.nix +++ b/pkgs/misc/dxvk/dxvk.nix @@ -9,8 +9,15 @@ , spirv-headers , vulkan-headers , SDL2 +, glfw +, pkgsBuildHost +, sdl2Support ? true +, glfwSupport ? false }: +# SDL2 and GLFW support are mutually exclusive. +assert !sdl2Support || !glfwSupport; + let # DXVK 2.0+ no longer vendors certain dependencies. This derivation also needs to build on Darwin, # which does not currently support DXVK 2.0, so adapt conditionally for this situation. @@ -36,13 +43,13 @@ let ./darwin-thread-primitives.patch ]; }; - "2.0" = rec { - version = "2.0"; + "2.1" = rec { + version = "2.1"; src = fetchFromGitHub { owner = "doitsujin"; repo = "dxvk"; rev = "v${version}"; - hash = "sha256-mSNFvoILsvm+CpWV7uRlb7DkjV7ctClSUdteNcF5EAY="; + hash = "sha256-A4KR11brfQbR56dGt371MRwMN/H6HFAU8TlFC97/bRs="; fetchSubmodules = true; # Needed for the DirectX headers and libdisplay-info }; patches = [ ]; @@ -61,8 +68,14 @@ stdenv.mkDerivation { ++ lib.optionals isDxvk2 ( [ spirv-headers vulkan-headers ] ++ lib.optional (!isWindows && sdl2Support) SDL2 + ++ lib.optional (!isWindows && glfwSupport) glfw ); + postPatch = lib.optionalString isDxvk2 '' + substituteInPlace "subprojects/libdisplay-info/tool/gen-search-table.py" \ + --replace "/usr/bin/env python3" "${lib.getBin pkgsBuildHost.python3}/bin/python3" + ''; + # Build with the Vulkan SDK in nixpkgs. preConfigure = '' rm -rf include/spirv/include include/vulkan/include @@ -77,7 +90,8 @@ stdenv.mkDerivation { "--buildtype" "release" "--prefix" "${placeholder "out"}" ] - ++ lib.optionals isCross [ "--cross-file" "build-win${arch}.txt" ]; + ++ lib.optionals isCross [ "--cross-file" "build-win${arch}.txt" ] + ++ lib.optional glfwSupport "-Ddxvk_native_wsi=glfw"; doCheck = isDxvk2 && !isCross; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0d09810ef2ff..cbc10e07eb80 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -37210,7 +37210,7 @@ with pkgs; dxvk = callPackage ../misc/dxvk { }; dxvk_1 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "1.10"; }; - dxvk_2 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "2.0"; }; + dxvk_2 = callPackage ../misc/dxvk/dxvk.nix { dxvkVersion = "2.1"; }; ecdsatool = callPackage ../tools/security/ecdsatool { }; From 5c31d2d23bf2d70ac6c6f75df0ec5a9713500344 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Sun, 29 Jan 2023 12:00:22 -0500 Subject: [PATCH 5/5] dxvk: improve description of `dxvk` derivation --- pkgs/misc/dxvk/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/misc/dxvk/default.nix b/pkgs/misc/dxvk/default.nix index cf1f12a2b71f..0e46011e7e10 100644 --- a/pkgs/misc/dxvk/default.nix +++ b/pkgs/misc/dxvk/default.nix @@ -38,7 +38,7 @@ stdenvNoCC.mkDerivation (finalAttrs: ''; meta = { - description = "A Vulkan-based translation layer for Direct3D 9/10/11"; + description = "Setup script for DXVK"; homepage = "https://github.com/doitsujin/dxvk"; changelog = "https://github.com/doitsujin/dxvk/releases"; maintainers = [ lib.maintainers.reckenrode ];