about summary refs log tree commit diff
path: root/packages/lampray.nix
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2024-07-14 01:25:42 +0300
committerAzat Bahawi <azat@bahawi.net>2024-07-14 01:25:42 +0300
commitc174c67e3206ea2bb3f565a048b9961d602d93ed (patch)
treea51fedaa4681f4f80e6cb24769c2cb55b30893c7 /packages/lampray.nix
parent2024-07-14 (diff)
2024-07-14
Diffstat (limited to '')
-rw-r--r--packages/lampray.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/lampray.nix b/packages/lampray.nix
index 876bf60..e9caa13 100644
--- a/packages/lampray.nix
+++ b/packages/lampray.nix
@@ -6,9 +6,12 @@
   fetchFromGitHub,
   lib,
   lz4,
+  makeWrapper,
   ninja,
+  p7zip,
   pkg-config,
   stdenv,
+  zenity,
 }:
 stdenv.mkDerivation {
   pname = "lampray";
@@ -24,6 +27,7 @@ stdenv.mkDerivation {
   nativeBuildInputs = [
     autoPatchelfHook
     cmake
+    makeWrapper
     ninja
     pkg-config
   ];
@@ -34,10 +38,17 @@ stdenv.mkDerivation {
     lz4
   ];
 
+  postPatch = ''
+    substituteInPlace Lampray/Control/lampConfig.cpp \
+      --replace-fail '/usr/libexec/p7zip/7z.so' '${p7zip.lib}/lib/p7zip/7z.so'
+  '';
+
   installPhase = ''
     runHook preInstall
 
     install -Dm755 Lampray $out/bin/lampray
+    wrapProgram $out/bin/lampray \
+      --prefix PATH : "${lib.makeBinPath [ zenity ]}"
 
     runHook postInstall
   '';
@@ -54,5 +65,7 @@ stdenv.mkDerivation {
     ];
     platforms = [ "x86_64-linux" ];
     maintainers = with maintainers; [ azahi ];
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    mainProgram = "lampray";
   };
 }

Consider giving Nix/NixOS a try! <3