jql: 8.0.0 -> 8.0.2 (#362884)
[NixPkgs.git] / pkgs / applications / window-managers / awesome / default.nix
blob2e60bcf41e68ee533b0836c00d60ff4cc0a3f306
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchpatch,
6   lua,
7   cairo,
8   librsvg,
9   cmake,
10   imagemagick,
11   pkg-config,
12   gdk-pixbuf,
13   xorg,
14   libstartup_notification,
15   libxdg_basedir,
16   libpthreadstubs,
17   xcb-util-cursor,
18   makeWrapper,
19   pango,
20   gobject-introspection,
21   which,
22   dbus,
23   nettools,
24   git,
25   doxygen,
26   xmlto,
27   docbook_xml_dtd_45,
28   docbook_xsl,
29   findXMLCatalogs,
30   libxkbcommon,
31   xcbutilxrm,
32   hicolor-icon-theme,
33   asciidoctor,
34   fontsConf,
35   gtk3Support ? false,
36   gtk3 ? null,
39 # needed for beautiful.gtk to work
40 assert gtk3Support -> gtk3 != null;
42 let
43   luaEnv = lua.withPackages (ps: [
44     ps.lgi
45     ps.ldoc
46   ]);
49 stdenv.mkDerivation rec {
50   pname = "awesome";
51   version = "4.3";
53   src = fetchFromGitHub {
54     owner = "awesomewm";
55     repo = "awesome";
56     rev = "v${version}";
57     sha256 = "1i7ajmgbsax4lzpgnmkyv35x8vxqi0j84a14k6zys4blx94m9yjf";
58   };
60   patches = [
61     # Pull upstream fix for -fno-common toolchain support:
62     #   https://github.com/awesomeWM/awesome/pull/3065
63     (fetchpatch {
64       name = "fno-common-prerequisite.patch";
65       url = "https://github.com/awesomeWM/awesome/commit/c5202a48708585cc33528065af8d1b1d28b1a6e0.patch";
66       sha256 = "0sv36xf0ibjcm63gn9k3bl039sqavb2b5i6d65il4bdclkc0n08b";
67     })
68     (fetchpatch {
69       name = "fno-common.patch";
70       url = "https://github.com/awesomeWM/awesome/commit/d256d9055095f27a33696e0aeda4ee20ed4fb1a0.patch";
71       sha256 = "1n3y4wnjra8blss7642jgpxnm9n92zhhjj541bb9i60m4b7bgfzz";
72     })
73   ];
75   nativeBuildInputs = [
76     cmake
77     doxygen
78     imagemagick
79     makeWrapper
80     pkg-config
81     xmlto
82     docbook_xml_dtd_45
83     docbook_xsl
84     findXMLCatalogs
85     asciidoctor
86     gobject-introspection
87   ];
89   outputs = [
90     "out"
91     "doc"
92   ];
94   FONTCONFIG_FILE = toString fontsConf;
96   propagatedUserEnvPkgs = [ hicolor-icon-theme ];
97   buildInputs = [
98     cairo
99     librsvg
100     dbus
101     gdk-pixbuf
102     git
103     luaEnv
104     libpthreadstubs
105     libstartup_notification
106     libxdg_basedir
107     lua
108     nettools
109     pango
110     xcb-util-cursor
111     xorg.libXau
112     xorg.libXdmcp
113     xorg.libxcb
114     xorg.libxshmfence
115     xorg.xcbutil
116     xorg.xcbutilimage
117     xorg.xcbutilkeysyms
118     xorg.xcbutilrenderutil
119     xorg.xcbutilwm
120     libxkbcommon
121     xcbutilxrm
122   ] ++ lib.optional gtk3Support gtk3;
124   cmakeFlags = [
125     #"-DGENERATE_MANPAGES=ON"
126     "-DOVERRIDE_VERSION=${version}"
127   ] ++ lib.optional lua.pkgs.isLuaJIT "-DLUA_LIBRARY=${lua}/lib/libluajit-5.1.so";
129   GI_TYPELIB_PATH = "${pango.out}/lib/girepository-1.0";
130   # LUA_CPATH and LUA_PATH are used only for *building*, see the --search flags
131   # below for how awesome finds the libraries it needs at runtime.
132   LUA_CPATH = "${luaEnv}/lib/lua/${lua.luaversion}/?.so";
133   LUA_PATH = "${luaEnv}/share/lua/${lua.luaversion}/?.lua;;";
135   postInstall = ''
136     # Don't use wrapProgram or the wrapper will duplicate the --search
137     # arguments every restart
138     mv "$out/bin/awesome" "$out/bin/.awesome-wrapped"
139     makeWrapper "$out/bin/.awesome-wrapped" "$out/bin/awesome" \
140       --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
141       --add-flags '--search ${luaEnv}/lib/lua/${lua.luaversion}' \
142       --add-flags '--search ${luaEnv}/share/lua/${lua.luaversion}' \
143       --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"
145     wrapProgram $out/bin/awesome-client \
146       --prefix PATH : "${which}/bin"
147   '';
149   passthru = {
150     inherit lua;
151   };
153   meta = with lib; {
154     description = "Highly configurable, dynamic window manager for X";
155     homepage = "https://awesomewm.org/";
156     license = licenses.gpl2Plus;
157     maintainers = with maintainers; [
158       lovek323
159       rasendubi
160     ];
161     platforms = platforms.linux;
162   };