about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/X11/xnotify/default.nix
blob: cdd7d54b529452cd51a66dea840118245936c81e (plain) (blame)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{ lib
, stdenv
, fetchFromGitHub
, writeText
, fontconfig
, imlib2
, libX11
, libXft
, libXinerama
, conf ? null
}:

stdenv.mkDerivation rec {
  pname = "xnotify";
  version = "0.9.3";

  src = fetchFromGitHub {
    owner = "phillbush";
    repo = "xnotify";
    rev = "v${version}";
    hash = "sha256-RfnmiAEFTPqQZursyVPDIZ6J3KBouvaaxyhTc1liqBc=";
  };

  buildInputs = [
    fontconfig
    imlib2
    libX11
    libXft
    libXinerama
  ];

  postPatch = with lib;
    let
      configFile =
        if isDerivation conf || builtins.isPath conf
        then conf else writeText "config.h" conf;
    in
    optionalString (conf != null) "cp ${configFile} config.h";

  makeFlags = [ "PREFIX=$(out)" ];

  meta = with lib; {
    description = "A tool to read notifications from stdin and pop them up on the screen";
    longDescription = ''
      XNotify displays a notification on the screen. XNotify receives a
      notification specification in stdin and shows a notification for the user
      on the screen.
    '';
    homepage = "https://github.com/phillbush/xnotify";
    license = licenses.mit;
    maintainers = with maintainers; [ azahi ];
    platforms = platforms.unix;
    mainProgram = "xnotify";
  };
}