git.iko.soy/typeable/nixpkgs
on master help sign in
directx-shader-compiler: init at 1.5.2010
commitcb43266d22d6b0f52313c5ac5e28ef66dfeca90c authorJoe Hermaszewski <git@monoid.al> dateFri 20 Nov 2020, 16:24 (6 years ago) parent41c8f3c
2 files changed+52
pkgs/tools/graphics/directx-shader-compiler/default.nix+50 pkgs/top-level/all-packages.nix+2
pkgs/tools/graphics/directx-shader-compiler/default.nixnew file+50
@@ -0,0 +1,50 @@
1+{ stdenv, fetchFromGitHub, cmake, python3, git }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "directx-shader-compiler";
5+ version = "1.5.2010";
6+
7+ # Put headers in dev, there are lot of them which aren't necessary for
8+ # using the compiler binary.
9+ outputs = [ "out" "dev" ];
10+
11+ src = fetchFromGitHub {
12+ owner = "microsoft";
13+ repo = "DirectXShaderCompiler";
14+ rev = "v${version}";
15+ sha256 = "0ccfy1bfp0cm0pq63ri4yl1sr3fdn1a526bsnakg4bl6z4fwrnnj";
16+ # We rely on the side effect of leaving the .git directory here for the
17+ # version-grabbing functionality of the build system.
18+ fetchSubmodules = true;
19+ };
20+
21+ nativeBuildInputs = [ cmake git python3 ];
22+
23+ configurePhase = ''
24+ # Requires some additional flags to cmake from a file in the repo
25+ additionalCMakeFlags=$(< utils/cmake-predefined-config-params)
26+ cmakeFlags="$additionalCMakeFlags''${cmakeFlags:+ $cmakeFlags}"
27+ cmakeConfigurePhase
28+ '';
29+
30+ # The default install target installs heaps of LLVM stuff.
31+ #
32+ # Upstream issue: https://github.com/microsoft/DirectXShaderCompiler/issues/3276
33+ #
34+ # The following is based on the CI script:
35+ # https://github.com/microsoft/DirectXShaderCompiler/blob/master/appveyor.yml#L63-L66
36+ installPhase = ''
37+ mkdir -p $out/bin $out/lib $dev/include
38+ mv bin/dxc* $out/bin/
39+ mv lib/libdxcompiler.so* $out/lib/
40+ cp -r $src/include/dxc $dev/include/
41+ '';
42+
43+ meta = with stdenv.lib; {
44+ description = "A compiler to compile HLSL programs into DXIL and SPIR-V";
45+ homepage = "https://github.com/microsoft/DirectXShaderCompiler";
46+ platforms = platforms.linux;
47+ license = licenses.ncsa;
48+ maintainers = with maintainers; [ expipiplus1 ];
49+ };
50+}
pkgs/top-level/all-packages.nix+2
@@ -16982,6 +16982,8 @@ in
1698216982
1698316983 diod = callPackage ../servers/diod { lua = lua5_1; };
1698416984
16985+ directx-shader-compiler = callPackage ../tools/graphics/directx-shader-compiler {};
16986+
1698516987 dkimproxy = callPackage ../servers/mail/dkimproxy { };
1698616988
1698716989 do-agent = callPackage ../servers/monitoring/do-agent { };