summary refs log tree commit diff
path: root/pkgs/by-name/no/notion/package.nix
blob: 9ee84b130bf46762452f5c98d4ebba626273e720 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{ lib
, stdenv
, fetchFromGitHub
, fontconfig
, gettext
, groff
, libSM
, libX11
, libXext
, libXft
, libXinerama
, libXrandr
, lua
, makeWrapper
, pkg-config
, readline
, which
, xmessage
, xterm
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "notion";
  version = "4.0.2";

  src = fetchFromGitHub {
    owner = "raboof";
    repo = "notion";
    rev = finalAttrs.version;
    hash = "sha256-u5KoTI+OcnQu9m8/Lmsmzr8lEk9tulSE7RRFhj1oXJM=";
  };

  # error: 'PATH_MAX' undeclared
  postPatch = ''
    sed 1i'#include <linux/limits.h>' -i mod_notionflux/notionflux/notionflux.c
  '';

  nativeBuildInputs = [
    gettext
    groff
    lua
    makeWrapper
    pkg-config
    which
  ];

  buildInputs = [
    fontconfig
    libSM
    libX11
    libXext
    libXft
    libXinerama
    libXrandr
    lua
    readline
  ];

  outputs = [ "out" "man" ];

  strictDeps = true;

  buildFlags = [
    "LUA_DIR=${lua}"
    "X11_PREFIX=/no-such-path"
  ];

  makeFlags = [
    "NOTION_RELEASE=${finalAttrs.version}"
    "PREFIX=${placeholder "out"}"
  ];

  postInstall = ''
    wrapProgram $out/bin/notion \
      --prefix PATH ":" "${lib.makeBinPath [ xmessage xterm ]}" \
  '';

  meta = {
    description = "Tiling tabbed window manager";
    homepage = "https://notionwm.net";
    license = lib.licenses.lgpl21;
    mainProgram = "notion";
    maintainers = with lib.maintainers; [ jfb AndersonTorres raboof ];
    platforms = lib.platforms.linux;
  };
})