git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #104377 from expipiplus1/joe-dxc

directx-shader-compiler: init at 1.5.2010

commit453c116254abe3d7b6b9938ff8092447333db1aa authorSandro <sandro.jaeckel@gmail.com> dateSat 19 Dec 2020, 08:45 (6 years ago) parenta634c41cb43266
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
@@ -17015,6 +17015,8 @@ in
1701517015
1701617016 diod = callPackage ../servers/diod { lua = lua5_1; };
1701717017
17018+ directx-shader-compiler = callPackage ../tools/graphics/directx-shader-compiler {};
17019+
1701817020 dkimproxy = callPackage ../servers/mail/dkimproxy { };
1701917021
1702017022 do-agent = callPackage ../servers/monitoring/do-agent { };