2021-07-24 16:46:34 +02:00
|
|
|
{ stdenv, lib, fetchFromGitHub, fetchpatch, glslang, buildPackages, writeScriptBin, pkgs, pkgsCross,
|
|
|
|
async ? false
|
|
|
|
}:
|
2021-07-21 19:46:25 +02:00
|
|
|
|
|
|
|
let
|
|
|
|
fix = writeScriptBin "x86_64-w64-mingw32-windres" ''
|
|
|
|
#!${stdenv.shell}
|
|
|
|
exec ${pkgsCross.mingwW64.buildPackages.binutils.bintools}/bin/x86_64-w64-mingw32-windres --preprocessor=x86_64-w64-mingw32-gcc --preprocessor-arg=-E --preprocessor-arg=-xc --preprocessor-arg=-DRC_INVOKED $@
|
|
|
|
'';
|
2021-07-24 16:46:34 +02:00
|
|
|
asyncPatch = (fetchpatch {
|
|
|
|
name = "dxvk-async";
|
2022-05-22 10:32:34 +02:00
|
|
|
url = "https://raw.githubusercontent.com/Sporif/dxvk-async/2c41ae818236dcfdf37e7262360dd9eea42ee5d6/dxvk-async.patch";
|
|
|
|
sha256 = "sha256-fWGd0a54C2kQ8slvgGu/6PE3RcReW1yF7mPaBPaW1Fw=";
|
2021-07-24 16:46:34 +02:00
|
|
|
});
|
2021-07-21 19:46:25 +02:00
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "dxvk";
|
2022-05-22 10:32:34 +02:00
|
|
|
version = "1.10.1";
|
2021-07-21 19:46:25 +02:00
|
|
|
|
2022-05-22 10:32:34 +02:00
|
|
|
patches = [ asyncPatch ];
|
2021-07-24 16:46:34 +02:00
|
|
|
|
2021-07-21 19:46:25 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "doitsujin";
|
|
|
|
repo = "dxvk";
|
|
|
|
rev = "v${version}";
|
2022-05-22 10:32:34 +02:00
|
|
|
sha256 = "sha256-+6PkrkamSvhCaGj2tq+RXri/yQ7vs0cAqgdRAFtU8UA=";
|
2021-07-21 19:46:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
CFLAGS="-fstack-protector";
|
|
|
|
CPPFLAGS="-fstack-protector";
|
|
|
|
mesonFlags = [ "--cross-file build-win64.txt" "--buildtype release" ];
|
|
|
|
depsBuildBuild = [
|
|
|
|
fix
|
|
|
|
buildPackages.gcc
|
|
|
|
buildPackages.meson
|
|
|
|
buildPackages.ninja
|
|
|
|
glslang
|
|
|
|
];
|
|
|
|
depsBuildTarget = [
|
|
|
|
pkgs.windows.pthreads
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|