narsil: bbc8fc5efd779ec885045f9b8d903d0df1bec1b2 -> f5ec6bd6b8013f2a2b74fc45b6f4c5374...
[NixPkgs.git] / pkgs / by-name / wl / wlx-overlay-s / package.nix
blobdf7f483bf1aa1052a2e5530a0045966cdbcc3dc1
2   alsa-lib,
3   dbus,
4   fetchFromGitHub,
5   fontconfig,
6   lib,
7   libGL,
8   libuuid,
9   libX11,
10   libXext,
11   libXrandr,
12   libxkbcommon,
13   makeWrapper,
14   nix-update-script,
15   openvr,
16   openxr-loader,
17   pipewire,
18   pkg-config,
19   pulseaudio,
20   rustPlatform,
21   shaderc,
22   stdenv,
23   testers,
24   vulkan-loader,
25   wayland,
26   wlx-overlay-s,
29 rustPlatform.buildRustPackage rec {
30   pname = "wlx-overlay-s";
31   version = "0.6";
33   src = fetchFromGitHub {
34     owner = "galister";
35     repo = "wlx-overlay-s";
36     rev = "v${version}";
37     hash = "sha256-Gk/3m4eWFZqeQBphBUTGAUqe8SspXqut8n4JM8tTe6o=";
38   };
40   cargoLock = {
41     lockFile = ./Cargo.lock;
42     outputHashes = {
43       "libmonado-rs-0.1.0" = "sha256-ja7OW/YSmfzaQoBhu6tec9v8fyNDknLekE2eY7McLPE=";
44       "openxr-0.18.0" = "sha256-ktkbhmExstkNJDYM/HYOwAwv3acex7P9SP0KMAOKhQk=";
45       "ovr_overlay-0.0.0" = "sha256-5IMEI0IPTacbA/1gibYU7OT6r+Bj+hlQjDZ3Kg0L2gw=";
46       "vulkano-0.34.0" = "sha256-0ZIxU2oItT35IFnS0YTVNmM775x21gXOvaahg/B9sj8=";
47       "wlx-capture-0.3.12" = "sha256-32WnAnNUSfsAA8WB9da3Wqb4acVlXh6HWsY9tPzCHEE=";
48     };
49   };
51   nativeBuildInputs = [
52     makeWrapper
53     pkg-config
54     rustPlatform.bindgenHook
55   ];
57   buildInputs = [
58     alsa-lib
59     dbus
60     fontconfig
61     libxkbcommon
62     openvr
63     openxr-loader
64     pipewire
65     libX11
66     libXext
67     libXrandr
68   ];
70   env.SHADERC_LIB_DIR = "${lib.getLib shaderc}/lib";
72   postPatch = ''
73     substituteAllInPlace src/res/watch.yaml \
74       --replace '"pactl"' '"${lib.getExe' pulseaudio "pactl"}"'
76     # TODO: src/res/keyboard.yaml references 'whisper_stt'
77   '';
79   postInstall = ''
80     patchelf $out/bin/wlx-overlay-s \
81       --add-needed ${lib.getLib wayland}/lib/libwayland-client.so.0 \
82       --add-needed ${lib.getLib libxkbcommon}/lib/libxkbcommon.so.0 \
83       --add-needed ${lib.getLib libGL}/lib/libEGL.so.1 \
84       --add-needed ${lib.getLib libGL}/lib/libGL.so.1 \
85       --add-needed ${lib.getLib vulkan-loader}/lib/libvulkan.so.1 \
86       --add-needed ${lib.getLib libuuid}/lib/libuuid.so.1
87   '';
89   passthru = {
90     tests.testVersion = testers.testVersion { package = wlx-overlay-s; };
92     updateScript = nix-update-script { };
93   };
95   meta = {
96     description = "Wayland/X11 desktop overlay for SteamVR and OpenXR, Vulkan edition";
97     homepage = "https://github.com/galister/wlx-overlay-s";
98     license = lib.licenses.gpl3Only;
99     maintainers = with lib.maintainers; [ Scrumplex ];
100     platforms = lib.platforms.linux;
101     broken = stdenv.hostPlatform.isAarch64;
102     mainProgram = "wlx-overlay-s";
103   };