nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 fetchpatch2,
6 meson,
7 ninja,
8 pkg-config,
9 python3,
10 wayland-scanner,
11 cairo,
12 libGL,
13 libdisplay-info_0_2,
14 libdrm,
15 libevdev,
16 libinput,
17 libxkbcommon,
18 libgbm,
19 seatd,
20 wayland,
21 wayland-protocols,
22 xcbutilcursor,
23
24 demoSupport ? true,
25 jpegSupport ? true,
26 libjpeg,
27 lcmsSupport ? true,
28 lcms2,
29 pangoSupport ? true,
30 pango,
31 pipewireSupport ? true,
32 pipewire,
33 rdpSupport ? true,
34 freerdp,
35 remotingSupport ? true,
36 gst_all_1,
37 vaapiSupport ? true,
38 libva,
39 vncSupport ? true,
40 aml,
41 neatvnc,
42 pam,
43 webpSupport ? true,
44 libwebp,
45 xwaylandSupport ? true,
46 libXcursor,
47 xwayland,
48}:
49
50stdenv.mkDerivation (finalAttrs: {
51 pname = "weston";
52 version = "14.0.1";
53
54 src = fetchurl {
55 url = "https://gitlab.freedesktop.org/wayland/weston/-/releases/${finalAttrs.version}/downloads/weston-${finalAttrs.version}.tar.xz";
56 hash = "sha256-qBUFBbEmpZ33gf6MMMjm+H2nAT4XkDnrhEpbu8x8ebM=";
57 };
58
59 patches = [
60 (fetchpatch2 {
61 # vnc: Allow neatvnc in version 0.9.0
62 # https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1649
63 url = "https://gitlab.freedesktop.org/wayland/weston/-/commit/b4386289d614f26e89e1c6eb17e048826e925ed1.patch";
64 hash = "sha256-mkIOup44C9Kp42tFMXz8Sis4URmPi4t605MQG672nJU=";
65 })
66 ];
67
68 depsBuildBuild = [ pkg-config ];
69 nativeBuildInputs = [
70 meson
71 ninja
72 pkg-config
73 python3
74 wayland-scanner
75 ];
76 buildInputs = [
77 cairo
78 libGL
79 libdisplay-info_0_2
80 libdrm
81 libevdev
82 libinput
83 libxkbcommon
84 libgbm
85 seatd
86 wayland
87 wayland-protocols
88 ]
89 ++ lib.optional jpegSupport libjpeg
90 ++ lib.optional lcmsSupport lcms2
91 ++ lib.optional pangoSupport pango
92 ++ lib.optional pipewireSupport pipewire
93 ++ lib.optional rdpSupport freerdp
94 ++ lib.optionals remotingSupport [
95 gst_all_1.gstreamer
96 gst_all_1.gst-plugins-base
97 ]
98 ++ lib.optional vaapiSupport libva
99 ++ lib.optionals vncSupport [
100 aml
101 neatvnc
102 pam
103 ]
104 ++ lib.optional webpSupport libwebp
105 ++ lib.optionals xwaylandSupport [
106 libXcursor
107 xcbutilcursor
108 xwayland
109 ];
110
111 mesonFlags = [
112 (lib.mesonBool "backend-drm-screencast-vaapi" vaapiSupport)
113 (lib.mesonBool "backend-pipewire" pipewireSupport)
114 (lib.mesonBool "backend-rdp" rdpSupport)
115 (lib.mesonBool "backend-vnc" vncSupport)
116 (lib.mesonBool "color-management-lcms" lcmsSupport)
117 (lib.mesonBool "demo-clients" demoSupport)
118 (lib.mesonBool "image-jpeg" jpegSupport)
119 (lib.mesonBool "image-webp" webpSupport)
120 (lib.mesonBool "pipewire" pipewireSupport)
121 (lib.mesonBool "remoting" remotingSupport)
122 (lib.mesonOption "simple-clients" "")
123 (lib.mesonBool "test-junit-xml" false)
124 (lib.mesonBool "xwayland" xwaylandSupport)
125 ]
126 ++ lib.optionals xwaylandSupport [
127 (lib.mesonOption "xwayland-path" (lib.getExe xwayland))
128 ];
129
130 passthru.providedSessions = [ "weston" ];
131
132 meta = {
133 description = "Lightweight and functional Wayland compositor";
134 longDescription = ''
135 Weston is the reference implementation of a Wayland compositor, as well
136 as a useful environment in and of itself.
137 Out of the box, Weston provides a very basic desktop, or a full-featured
138 environment for non-desktop uses such as automotive, embedded, in-flight,
139 industrial, kiosks, set-top boxes and TVs. It also provides a library
140 allowing other projects to build their own full-featured environments on
141 top of Weston's core. A small suite of example or demo clients are also
142 provided.
143 '';
144 homepage = "https://gitlab.freedesktop.org/wayland/weston";
145 license = lib.licenses.mit; # Expat version
146 platforms = lib.platforms.linux;
147 mainProgram = "weston";
148 maintainers = with lib.maintainers; [
149 qyliss
150 ];
151 };
152})