aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/misc/clipmenu/default.nix
blob: 3227792d6a2f2e2a74e6a6817420285c1b970033 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ clipnotify, makeWrapper, xsel, dmenu, util-linux, gawk, stdenv, fetchFromGitHub, fetchpatch, lib }:
let
  runtimePath = lib.makeBinPath [ clipnotify xsel dmenu util-linux gawk ];
in
stdenv.mkDerivation rec {
  pname = "clipmenu";
  version = "6.1.0";

  src = fetchFromGitHub {
    owner  = "cdown";
    repo   = "clipmenu";
    rev    = version;
    sha256 = "0ddj5xcwrdb2qvrndvhv8j6swcqc8dvv5i00pqk35rfk5mrl4hwv";
  };
  
  patches = [
    (fetchpatch {
      url = "https://github.com/cdown/clipmenu/commit/443b58583ef216e2405e4a38d401f7c36386d21e.patch";
      sha256 = "12m4rpw7jbr31c919llbsmn8dcf7yh9aijln4iym6h2lylzqzzdz";
    })
  ];
  
  makeFlags = [ "PREFIX=$(out)" ];
  buildInputs = [ makeWrapper ];
  nativeBuildInputs = [ xsel clipnotify ];

  installPhase = ''
    for bin in $out/bin/*; do
      wrapProgram "$bin" --prefix PATH : "${runtimePath}"
    done
  '';

  meta = with stdenv.lib; {
    description = "Clipboard management using dmenu";
    inherit (src.meta) homepage;
    maintainers = with maintainers; [ jb55 ];
    license = licenses.publicDomain;
  };
}