1{ lib
2, addOpenGLRunpath
3, cmake
4, fetchFromGitHub
5, fmt_9
6, spdlog
7, stdenv
8, substituteAll
9}:
10
11stdenv.mkDerivation rec {
12 pname = "level-zero";
13 version = "1.16.15";
14
15 src = fetchFromGitHub {
16 owner = "oneapi-src";
17 repo = "level-zero";
18 rev = "refs/tags/v${version}";
19 hash = "sha256-J+XIqaV1ThD0RqqcyIkzvTWCkIztjkHzGzUbj0qojJs=";
20 };
21
22 patches = [
23 (substituteAll {
24 src = ./system-spdlog.diff;
25 spdlog = lib.getDev spdlog;
26 })
27 ];
28
29 nativeBuildInputs = [ cmake addOpenGLRunpath ];
30
31 buildInputs = [ fmt_9 ];
32
33 postFixup = ''
34 addOpenGLRunpath $out/lib/libze_loader.so
35 '';
36
37 meta = with lib; {
38 description = "oneAPI Level Zero Specification Headers and Loader";
39 homepage = "https://github.com/oneapi-src/level-zero";
40 changelog = "https://github.com/oneapi-src/level-zero/blob/v${version}/CHANGELOG.md";
41 license = licenses.mit;
42 maintainers = [ maintainers.ziguana ];
43 };
44}
45