You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

{ stdenv, lib, fetchFromGitHub, fetchpatch, glslang, buildPackages, writeScriptBin, pkgs, pkgsCross,
async ? false
}:
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 $@
'';
asyncPatch = (fetchpatch {
name = "dxvk-async";
url = "https://raw.githubusercontent.com/Sporif/dxvk-async/8911d6da0f838efc8fbbea805da522be4e1ad6c3/dxvk-async.patch";
sha256 = "0mr43flzim25lfq73pac94ah07yrr86n82fzsx47lxlcmsh9zhrq";
});
in stdenv.mkDerivation rec {
pname = "dxvk";
version = "1.9.1";
patches = []
++ lib.lists.optional async asyncPatch;
src = fetchFromGitHub {
owner = "doitsujin";
repo = "dxvk";
rev = "v${version}";
sha256 = "06j0lcbrq1z5g19jr51mm3virnnmxznh83h57f49pz0wkryy6qrv";
};
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
];
}