btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / no / notion / package.nix
blob9ee84b130bf46762452f5c98d4ebba626273e720
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , fontconfig
5 , gettext
6 , groff
7 , libSM
8 , libX11
9 , libXext
10 , libXft
11 , libXinerama
12 , libXrandr
13 , lua
14 , makeWrapper
15 , pkg-config
16 , readline
17 , which
18 , xmessage
19 , xterm
22 stdenv.mkDerivation (finalAttrs: {
23   pname = "notion";
24   version = "4.0.2";
26   src = fetchFromGitHub {
27     owner = "raboof";
28     repo = "notion";
29     rev = finalAttrs.version;
30     hash = "sha256-u5KoTI+OcnQu9m8/Lmsmzr8lEk9tulSE7RRFhj1oXJM=";
31   };
33   # error: 'PATH_MAX' undeclared
34   postPatch = ''
35     sed 1i'#include <linux/limits.h>' -i mod_notionflux/notionflux/notionflux.c
36   '';
38   nativeBuildInputs = [
39     gettext
40     groff
41     lua
42     makeWrapper
43     pkg-config
44     which
45   ];
47   buildInputs = [
48     fontconfig
49     libSM
50     libX11
51     libXext
52     libXft
53     libXinerama
54     libXrandr
55     lua
56     readline
57   ];
59   outputs = [ "out" "man" ];
61   strictDeps = true;
63   buildFlags = [
64     "LUA_DIR=${lua}"
65     "X11_PREFIX=/no-such-path"
66   ];
68   makeFlags = [
69     "NOTION_RELEASE=${finalAttrs.version}"
70     "PREFIX=${placeholder "out"}"
71   ];
73   postInstall = ''
74     wrapProgram $out/bin/notion \
75       --prefix PATH ":" "${lib.makeBinPath [ xmessage xterm ]}" \
76   '';
78   meta = {
79     description = "Tiling tabbed window manager";
80     homepage = "https://notionwm.net";
81     license = lib.licenses.lgpl21;
82     mainProgram = "notion";
83     maintainers = with lib.maintainers; [ jfb AndersonTorres raboof ];
84     platforms = lib.platforms.linux;
85   };