about summary refs log tree commit diff
path: root/pkgs/tools/wayland
diff options
context:
space:
mode:
authorAtemu <atemu.main@gmail.com>2024-05-30 19:03:38 +0200
committerGitHub <noreply@github.com>2024-05-30 19:03:38 +0200
commit5e96c69cb13f21c69afe8b9e11aa795f3e928fdb (patch)
treea0234b9029e4d924fded054bd68a3a2e86b79d18 /pkgs/tools/wayland
parentd57327020ea59db0e1d4c628e9b8d0fc319f7802 (diff)
parente153bc88e94d554d2d7e4c42efddf506dab8ea9b (diff)
Merge pull request #309414 from Atemu/wluma-install-auxillary-files-and-manpage
marked-man: init at 2.1.0, wluma: use upstream Makefile's install command
Diffstat (limited to 'pkgs/tools/wayland')
-rw-r--r--pkgs/tools/wayland/wluma/default.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/tools/wayland/wluma/default.nix b/pkgs/tools/wayland/wluma/default.nix
index edc751fec5117..94201db4a395f 100644
--- a/pkgs/tools/wayland/wluma/default.nix
+++ b/pkgs/tools/wayland/wluma/default.nix
@@ -1,7 +1,10 @@
 { lib
+, stdenv
 , fetchFromGitHub
 , makeWrapper
 , rustPlatform
+, marked-man
+, coreutils
 , vulkan-loader
 , wayland
 , pkg-config
@@ -22,6 +25,19 @@ rustPlatform.buildRustPackage rec {
     sha256 = "sha256-Ow3SjeulYiHY9foXrmTtLK3F+B3+DrtDjBUke3bJeDw=";
   };
 
+  postPatch = ''
+    substituteInPlace Makefile --replace \
+      'target/release/$(BIN)' \
+      'target/${stdenv.hostPlatform.rust.cargoShortTarget}/release/$(BIN)'
+
+    # Needs chmod and chgrp
+    substituteInPlace 90-wluma-backlight.rules --replace \
+      'RUN+="/bin/' 'RUN+="${coreutils}/bin/'
+
+    substituteInPlace wluma.service --replace \
+      'ExecStart=/usr/bin/wluma' 'ExecStart=${placeholder "out"}/bin/wluma'
+  '';
+
   cargoLock = {
     lockFile = ./Cargo.lock;
   };
@@ -30,6 +46,7 @@ rustPlatform.buildRustPackage rec {
     makeWrapper
     pkg-config
     rustPlatform.bindgenHook
+    marked-man
   ];
 
   buildInputs = [
@@ -39,6 +56,12 @@ rustPlatform.buildRustPackage rec {
     dbus
   ];
 
+  postBuild = ''
+    make docs
+  '';
+
+  dontCargoInstall = true;
+  installFlags = [ "PREFIX=${placeholder "out"}" ];
   postInstall = ''
     wrapProgram $out/bin/wluma \
       --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ wayland ]}"