|
1 | 1 | { |
2 | 2 | lib, |
3 | 3 | stdenv, |
4 | | - fetchurl, |
| 4 | + fetchFromGitLab, |
5 | 5 | meson, |
6 | 6 | ninja, |
7 | 7 | pkg-config, |
|
11 | 11 | libX11, |
12 | 12 | libdrm, |
13 | 13 | libgbm, |
14 | | - nativeContextSupport ? stdenv.hostPlatform.isLinux, |
15 | | - vaapiSupport ? !stdenv.hostPlatform.isDarwin, |
16 | 14 | libva, |
17 | | - vulkanSupport ? stdenv.hostPlatform.isLinux, |
18 | 15 | vulkan-headers, |
19 | 16 | vulkan-loader, |
20 | | - gitUpdater, |
| 17 | + nix-update-script, |
| 18 | + vulkanSupport ? stdenv.hostPlatform.isLinux, |
| 19 | + nativeContextSupport ? stdenv.hostPlatform.isLinux, |
| 20 | + vaapiSupport ? !stdenv.hostPlatform.isDarwin, |
21 | 21 | }: |
22 | 22 |
|
23 | | -stdenv.mkDerivation rec { |
| 23 | +stdenv.mkDerivation (finalAttrs: { |
24 | 24 | pname = "virglrenderer"; |
25 | 25 | version = "1.1.1"; |
26 | 26 |
|
27 | | - src = fetchurl { |
28 | | - url = "https://gitlab.freedesktop.org/virgl/virglrenderer/-/archive/${version}/virglrenderer-${version}.tar.bz2"; |
29 | | - hash = "sha256-D+SJqBL76z1nGBmcJ7Dzb41RvFxU2Ak6rVOwDRB94rM="; |
| 27 | + src = fetchFromGitLab { |
| 28 | + domain = "gitlab.freedesktop.org"; |
| 29 | + owner = "virgl"; |
| 30 | + repo = "virglrenderer"; |
| 31 | + tag = finalAttrs.version; |
| 32 | + hash = "sha256-ah6+AAf7B15rPMb4uO873wieT3+gf/5iGH+ZFoZKAAI="; |
30 | 33 | }; |
31 | 34 |
|
32 | 35 | separateDebugInfo = true; |
33 | 36 |
|
| 37 | + nativeBuildInputs = [ |
| 38 | + meson |
| 39 | + ninja |
| 40 | + pkg-config |
| 41 | + (buildPackages.python3.withPackages (ps: [ |
| 42 | + ps.pyyaml |
| 43 | + ])) |
| 44 | + ]; |
| 45 | + |
34 | 46 | buildInputs = [ |
35 | 47 | libepoxy |
36 | 48 | ] |
37 | | - ++ lib.optionals vaapiSupport [ libva ] |
38 | | - ++ lib.optionals vulkanSupport [ |
39 | | - vulkan-headers |
40 | | - vulkan-loader |
41 | | - ] |
42 | 49 | ++ lib.optionals stdenv.hostPlatform.isLinux [ |
43 | 50 | libGLU |
44 | 51 | libX11 |
45 | 52 | libdrm |
46 | 53 | libgbm |
47 | | - ]; |
48 | | - |
49 | | - nativeBuildInputs = [ |
50 | | - meson |
51 | | - ninja |
52 | | - pkg-config |
53 | | - (buildPackages.python3.withPackages (ps: [ |
54 | | - ps.pyyaml |
55 | | - ])) |
| 54 | + ] |
| 55 | + ++ lib.optionals vaapiSupport [ |
| 56 | + libva |
| 57 | + ] |
| 58 | + ++ lib.optionals vulkanSupport [ |
| 59 | + vulkan-headers |
| 60 | + vulkan-loader |
56 | 61 | ]; |
57 | 62 |
|
58 | 63 | mesonFlags = [ |
59 | 64 | (lib.mesonBool "video" vaapiSupport) |
60 | 65 | (lib.mesonBool "venus" vulkanSupport) |
61 | | - ] |
62 | | - ++ lib.optionals nativeContextSupport [ |
63 | | - (lib.mesonOption "drm-renderers" "amdgpu-experimental,msm") |
| 66 | + (lib.mesonOption "drm-renderers" ( |
| 67 | + lib.optionalString nativeContextSupport ( |
| 68 | + lib.concatStringsSep "," [ |
| 69 | + "amdgpu-experimental" |
| 70 | + "msm" |
| 71 | + ] |
| 72 | + ) |
| 73 | + )) |
64 | 74 | ]; |
65 | 75 |
|
66 | 76 | passthru = { |
67 | | - updateScript = gitUpdater { |
68 | | - url = "https://gitlab.freedesktop.org/virgl/virglrenderer.git"; |
69 | | - rev-prefix = "virglrenderer-"; |
70 | | - }; |
| 77 | + updateScript = nix-update-script { }; |
71 | 78 | }; |
72 | 79 |
|
73 | | - meta = with lib; { |
74 | | - description = "Virtual 3D GPU library that allows a qemu guest to use the host GPU for accelerated 3D rendering"; |
| 80 | + meta = { |
| 81 | + description = "Virtual 3D GPU for use inside QEMU virtual machines"; |
| 82 | + homepage = "https://docs.mesa3d.org/drivers/virgl"; |
| 83 | + license = lib.licenses.mit; |
| 84 | + maintainers = with lib.maintainers; [ |
| 85 | + normalcea |
| 86 | + ]; |
75 | 87 | mainProgram = "virgl_test_server"; |
76 | | - homepage = "https://virgil3d.github.io/"; |
77 | | - license = licenses.mit; |
78 | | - platforms = platforms.unix; |
79 | | - maintainers = [ maintainers.xeji ]; |
| 88 | + platforms = lib.platforms.unix; |
80 | 89 | }; |
81 | | -} |
| 90 | +}) |
0 commit comments