2024-03-25 18:33:28 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenvNoCC,
|
|
|
|
overrideCC,
|
|
|
|
pkgsCross,
|
|
|
|
bash,
|
2022-02-14 16:08:03 +00:00
|
|
|
}:
|
|
|
|
|
2024-03-25 18:33:28 +00:00
|
|
|
stdenvNoCC.mkDerivation (
|
|
|
|
finalAttrs:
|
2022-06-01 20:21:14 +00:00
|
|
|
let
|
2024-03-25 18:33:28 +00:00
|
|
|
useWin32ThreadModel =
|
|
|
|
stdenv:
|
|
|
|
overrideCC stdenv (
|
|
|
|
stdenv.cc.override (old: {
|
|
|
|
cc = old.cc.override {
|
|
|
|
threadsCross = {
|
|
|
|
model = "win32";
|
|
|
|
package = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
);
|
|
|
|
|
|
|
|
mingw32Stdenv = useWin32ThreadModel pkgsCross.mingw32.stdenv;
|
|
|
|
mingwW64Stdenv = useWin32ThreadModel pkgsCross.mingwW64.stdenv;
|
|
|
|
|
|
|
|
dxvk32 =
|
|
|
|
if stdenvNoCC.isDarwin then
|
|
|
|
pkgsCross.mingw32.dxvk_1.override {
|
|
|
|
stdenv = mingw32Stdenv;
|
|
|
|
enableMoltenVKCompat = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pkgsCross.mingw32.dxvk_2.override { stdenv = mingw32Stdenv; };
|
|
|
|
|
|
|
|
dxvk64 =
|
|
|
|
if stdenvNoCC.isDarwin then
|
|
|
|
pkgsCross.mingwW64.dxvk_1.override {
|
|
|
|
stdenv = mingwW64Stdenv;
|
|
|
|
enableMoltenVKCompat = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pkgsCross.mingwW64.dxvk_2.override { stdenv = mingwW64Stdenv; };
|
2022-06-01 20:21:14 +00:00
|
|
|
in
|
|
|
|
{
|
2023-01-28 04:20:00 +00:00
|
|
|
pname = "dxvk";
|
2023-01-27 04:23:26 +00:00
|
|
|
inherit (dxvk64) version;
|
2022-02-14 16:08:03 +00:00
|
|
|
|
2024-03-25 18:33:28 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"bin"
|
|
|
|
"lib"
|
|
|
|
];
|
2022-02-14 16:08:03 +00:00
|
|
|
|
2024-03-25 18:33:28 +00:00
|
|
|
strictDeps = true;
|
2022-02-14 16:08:03 +00:00
|
|
|
|
2024-03-25 18:33:28 +00:00
|
|
|
buildCommand = ''
|
2022-02-14 16:08:03 +00:00
|
|
|
mkdir -p $out/bin $bin $lib
|
2023-01-27 03:44:30 +00:00
|
|
|
substitute ${./setup_dxvk.sh} $out/bin/setup_dxvk.sh \
|
|
|
|
--subst-var-by bash ${bash} \
|
|
|
|
--subst-var-by dxvk32 ${dxvk32} \
|
|
|
|
--subst-var-by dxvk64 ${dxvk64} \
|
2024-03-25 18:33:28 +00:00
|
|
|
--subst-var-by version ${finalAttrs.version}
|
2022-02-14 16:08:03 +00:00
|
|
|
chmod a+x $out/bin/setup_dxvk.sh
|
|
|
|
declare -A dxvks=( [x32]=${dxvk32} [x64]=${dxvk64} )
|
|
|
|
for arch in "''${!dxvks[@]}"; do
|
|
|
|
ln -s "''${dxvks[$arch]}/bin" $bin/$arch
|
|
|
|
ln -s "''${dxvks[$arch]}/lib" $lib/$arch
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2024-03-25 18:33:28 +00:00
|
|
|
passthru = { inherit dxvk32 dxvk64; };
|
|
|
|
|
|
|
|
__structuredAttrs = true;
|
|
|
|
|
2022-02-14 16:08:03 +00:00
|
|
|
meta = {
|
2023-01-29 17:00:22 +00:00
|
|
|
description = "Setup script for DXVK";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "setup_dxvk.sh";
|
2022-02-14 16:08:03 +00:00
|
|
|
homepage = "https://github.com/doitsujin/dxvk";
|
|
|
|
changelog = "https://github.com/doitsujin/dxvk/releases";
|
|
|
|
maintainers = [ lib.maintainers.reckenrode ];
|
|
|
|
license = lib.licenses.zlib;
|
2024-03-25 18:33:28 +00:00
|
|
|
platforms = [
|
|
|
|
"x86_64-darwin"
|
|
|
|
"i686-linux"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
2022-02-14 16:08:03 +00:00
|
|
|
};
|
2024-03-25 18:33:28 +00:00
|
|
|
}
|
|
|
|
)
|