1{
2 lib,
3 stdenv,
4 fetchzip,
5 meson,
6 ninja,
7 pkg-config,
8 python3,
9 python3Packages,
10 wayland-scanner,
11 libxkbcommon,
12 libgbm,
13 pixman,
14 xorg,
15 wayland,
16 gtest,
17}:
18
19stdenv.mkDerivation {
20 pname = "sommelier";
21 version = "126.0";
22
23 src = fetchzip rec {
24 url = "https://chromium.googlesource.com/chromiumos/platform2/+archive/${passthru.rev}/vm_tools/sommelier.tar.gz";
25 passthru.rev = "fd3798efe23f2edbc48f86f2fbd82ba5059fd875";
26 stripRoot = false;
27 sha256 = "BmWZnMcK7IGaEAkVPulyb3hngsmuI0D1YtQEbqMjV5c=";
28 };
29
30 nativeBuildInputs = [
31 meson
32 ninja
33 pkg-config
34 python3
35 python3Packages.jinja2
36 wayland-scanner
37 ];
38 buildInputs = [
39 libxkbcommon
40 libgbm
41 pixman
42 wayland
43 xorg.libxcb
44 ];
45
46 preConfigure = ''
47 patchShebangs gen-shim.py
48 '';
49
50 doCheck = true;
51 nativeCheckInputs = [ gtest ];
52
53 postInstall = ''
54 rm $out/bin/sommelier_test # why does it install the test binary? o_O
55 '';
56
57 passthru.updateScript = ./update.py;
58
59 meta = with lib; {
60 homepage = "https://chromium.googlesource.com/chromiumos/platform2/+/refs/heads/main/vm_tools/sommelier/";
61 description = "Nested Wayland compositor with support for X11 forwarding";
62 maintainers = with maintainers; [ qyliss ];
63 license = licenses.bsd3;
64 platforms = platforms.linux;
65 mainProgram = "sommelier";
66 };
67}