2022-06-16 17:23:12 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, ninja, python3, git }:
|
2020-12-25 13:55:36 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "directx-shader-compiler";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "1.7.2212";
|
2020-12-25 13:55:36 +00:00
|
|
|
|
|
|
|
# Put headers in dev, there are lot of them which aren't necessary for
|
|
|
|
# using the compiler binary.
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "microsoft";
|
|
|
|
repo = "DirectXShaderCompiler";
|
|
|
|
rev = "v${version}";
|
2023-01-11 07:51:40 +00:00
|
|
|
hash = "sha256-/FuG6ThvA3XMlHhnshRJpKC+vf4LM8/hurUoPagpTqA=";
|
2020-12-25 13:55:36 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [ cmake git ninja python3 ];
|
2020-12-25 13:55:36 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
cmakeFlags = [ "-C../cmake/caches/PredefinedParams.cmake" ];
|
2020-12-25 13:55:36 +00:00
|
|
|
|
|
|
|
# The default install target installs heaps of LLVM stuff.
|
|
|
|
#
|
|
|
|
# Upstream issue: https://github.com/microsoft/DirectXShaderCompiler/issues/3276
|
|
|
|
#
|
|
|
|
# The following is based on the CI script:
|
|
|
|
# https://github.com/microsoft/DirectXShaderCompiler/blob/master/appveyor.yml#L63-L66
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/lib $dev/include
|
|
|
|
mv bin/dxc* $out/bin/
|
|
|
|
mv lib/libdxcompiler.so* lib/libdxcompiler.*dylib $out/lib/
|
|
|
|
cp -r $src/include/dxc $dev/include/
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-12-25 13:55:36 +00:00
|
|
|
description = "A compiler to compile HLSL programs into DXIL and SPIR-V";
|
|
|
|
homepage = "https://github.com/microsoft/DirectXShaderCompiler";
|
|
|
|
platforms = with platforms; linux ++ darwin;
|
|
|
|
license = licenses.ncsa;
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ expipiplus1 Flakebi ];
|
2020-12-25 13:55:36 +00:00
|
|
|
};
|
|
|
|
}
|