directx-shader-compiler: move to finalAttrs, cleanup
apply nixfmt-rfc-style
This commit is contained in:
parent
03a7962a42
commit
c841a49518
@ -1,22 +1,38 @@
|
|||||||
{ lib, stdenv, fetchFromGitHub, cmake, ninja, python3, git }:
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
fetchFromGitHub,
|
||||||
|
cmake,
|
||||||
|
ninja,
|
||||||
|
python3,
|
||||||
|
git,
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "directx-shader-compiler";
|
pname = "directx-shader-compiler";
|
||||||
version = "1.8.2407";
|
version = "1.8.2407";
|
||||||
|
|
||||||
# Put headers in dev, there are lot of them which aren't necessary for
|
# Put headers in dev, there are lot of them which aren't necessary for
|
||||||
# using the compiler binary.
|
# using the compiler binary.
|
||||||
outputs = [ "out" "dev" ];
|
outputs = [
|
||||||
|
"out"
|
||||||
|
"dev"
|
||||||
|
];
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "microsoft";
|
owner = "microsoft";
|
||||||
repo = "DirectXShaderCompiler";
|
repo = "DirectXShaderCompiler";
|
||||||
rev = "v${version}";
|
rev = "v${finalAttrs.version}";
|
||||||
hash = "sha256-7quRcuY3SAuGuS4Slz476WxJ7GHMjJmT2Jmb8kdmsI8=";
|
hash = "sha256-7quRcuY3SAuGuS4Slz476WxJ7GHMjJmT2Jmb8kdmsI8=";
|
||||||
fetchSubmodules = true;
|
fetchSubmodules = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake git ninja python3 ];
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
git
|
||||||
|
ninja
|
||||||
|
python3
|
||||||
|
];
|
||||||
|
|
||||||
cmakeFlags = [ "-C../cmake/caches/PredefinedParams.cmake" ];
|
cmakeFlags = [ "-C../cmake/caches/PredefinedParams.cmake" ];
|
||||||
|
|
||||||
@ -27,17 +43,22 @@ stdenv.mkDerivation rec {
|
|||||||
# The following is based on the CI script:
|
# The following is based on the CI script:
|
||||||
# https://github.com/microsoft/DirectXShaderCompiler/blob/master/appveyor.yml#L63-L66
|
# https://github.com/microsoft/DirectXShaderCompiler/blob/master/appveyor.yml#L63-L66
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
|
runHook preInstall
|
||||||
mkdir -p $out/bin $out/lib $dev/include
|
mkdir -p $out/bin $out/lib $dev/include
|
||||||
mv bin/dxc* $out/bin/
|
mv bin/dxc* $out/bin/
|
||||||
mv lib/libdxcompiler.so* lib/libdxcompiler.*dylib $out/lib/
|
mv lib/libdxcompiler.so* lib/libdxcompiler.*dylib $out/lib/
|
||||||
cp -r $src/include/dxc $dev/include/
|
cp -r $src/include/dxc $dev/include/
|
||||||
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = {
|
||||||
description = "Compiler to compile HLSL programs into DXIL and SPIR-V";
|
description = "Compiler to compile HLSL programs into DXIL and SPIR-V";
|
||||||
homepage = "https://github.com/microsoft/DirectXShaderCompiler";
|
homepage = "https://github.com/microsoft/DirectXShaderCompiler";
|
||||||
platforms = with platforms; linux ++ darwin;
|
platforms = with lib.platforms; linux ++ darwin;
|
||||||
license = licenses.ncsa;
|
license = lib.licenses.ncsa;
|
||||||
maintainers = with maintainers; [ expipiplus1 Flakebi ];
|
maintainers = with lib.maintainers; [
|
||||||
|
expipiplus1
|
||||||
|
Flakebi
|
||||||
|
];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user