commit
ba7016d6e6
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
|
|||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Vulkan Header files and API registry";
|
description = "Vulkan Header files and API registry";
|
||||||
homepage = "https://www.lunarg.com";
|
homepage = "https://www.lunarg.com";
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix ++ platforms.windows;
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
maintainers = [ maintainers.ralith ];
|
maintainers = [ maintainers.ralith ];
|
||||||
};
|
};
|
||||||
|
@ -22,12 +22,16 @@ stdenvNoCC.mkDerivation (finalAttrs:
|
|||||||
# platforms diverge (due to the need for Darwin-specific patches that would fail to apply).
|
# 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`.
|
# Should that happen, set `darwin` to the last working `rev` and `hash`.
|
||||||
srcs = rec {
|
srcs = rec {
|
||||||
darwin = { inherit (default) rev hash version; };
|
darwin = {
|
||||||
default = {
|
|
||||||
rev = "v${finalAttrs.version}";
|
rev = "v${finalAttrs.version}";
|
||||||
hash = "sha256-T93ZylxzJGprrP+j6axZwl2d3hJowMCUOKNjIyNzkmE=";
|
hash = "sha256-T93ZylxzJGprrP+j6axZwl2d3hJowMCUOKNjIyNzkmE=";
|
||||||
version = "1.10.3";
|
version = "1.10.3";
|
||||||
};
|
};
|
||||||
|
default = {
|
||||||
|
rev = "v${finalAttrs.version}";
|
||||||
|
hash = "sha256-mboVLdPgZMzmqyeF0jAloEz6xqfIDiY/X98e7l2KZnw=";
|
||||||
|
version = "2.0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
@ -60,10 +64,12 @@ stdenvNoCC.mkDerivation (finalAttrs:
|
|||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mkdir -p $out/bin $bin $lib
|
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 mcfgthreads32 "${pkgsCross.mingw32.windows.mcfgthreads}" \
|
--subst-var-by mcfgthreads32 "${pkgsCross.mingw32.windows.mcfgthreads}" \
|
||||||
--subst-var-by mcfgthreads64 "${pkgsCross.mingwW64.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" \
|
||||||
|
--replace 'basedir="$(dirname "$(readlink -f "$0")")"' "basedir=$bin"
|
||||||
chmod a+x $out/bin/setup_dxvk.sh
|
chmod a+x $out/bin/setup_dxvk.sh
|
||||||
declare -A dxvks=( [x32]=${dxvk32} [x64]=${dxvk64} )
|
declare -A dxvks=( [x32]=${dxvk32} [x64]=${dxvk64} )
|
||||||
for arch in "''${!dxvks[@]}"; do
|
for arch in "''${!dxvks[@]}"; do
|
||||||
|
@ -7,18 +7,31 @@
|
|||||||
, windows
|
, windows
|
||||||
, src
|
, src
|
||||||
, version
|
, version
|
||||||
|
, spirv-headers
|
||||||
|
, vulkan-headers
|
||||||
, dxvkPatches
|
, 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";
|
||||||
|
in
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
pname = "dxvk";
|
pname = "dxvk";
|
||||||
inherit src version;
|
inherit src version;
|
||||||
|
|
||||||
nativeBuildInputs = [ glslang meson ninja ];
|
nativeBuildInputs = [ glslang meson ninja ];
|
||||||
buildInputs = [ windows.pthreads ];
|
buildInputs = [ windows.pthreads ]
|
||||||
|
++ lib.optionals isDxvk2 [ spirv-headers vulkan-headers ];
|
||||||
|
|
||||||
patches = dxvkPatches;
|
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
|
||||||
|
'';
|
||||||
|
|
||||||
mesonFlags =
|
mesonFlags =
|
||||||
let
|
let
|
||||||
arch = if stdenv.is32bit then "32" else "64";
|
arch = if stdenv.is32bit then "32" else "64";
|
||||||
|
Loading…
Reference in New Issue
Block a user