1 { lib, stdenv, fetchFromGitHub, fetchpatch
2 , lua, cairo, librsvg, cmake, imagemagick, pkg-config, gdk-pixbuf
3 , xorg, libstartup_notification, libxdg_basedir, libpthreadstubs
4 , xcb-util-cursor, makeWrapper, pango, gobject-introspection
5 , which, dbus, nettools, git, doxygen
6 , xmlto, docbook_xml_dtd_45, docbook_xsl, findXMLCatalogs
7 , libxkbcommon, xcbutilxrm, hicolor-icon-theme
10 , gtk3Support ? false, gtk3 ? null
13 # needed for beautiful.gtk to work
14 assert gtk3Support -> gtk3 != null;
17 luaEnv = lua.withPackages(ps: [ ps.lgi ps.ldoc ]);
20 stdenv.mkDerivation rec {
24 src = fetchFromGitHub {
28 sha256 = "1i7ajmgbsax4lzpgnmkyv35x8vxqi0j84a14k6zys4blx94m9yjf";
32 # Pull upstream fix for -fno-common toolchain support:
33 # https://github.com/awesomeWM/awesome/pull/3065
35 name = "fno-common-prerequisite.patch";
36 url = "https://github.com/awesomeWM/awesome/commit/c5202a48708585cc33528065af8d1b1d28b1a6e0.patch";
37 sha256 = "0sv36xf0ibjcm63gn9k3bl039sqavb2b5i6d65il4bdclkc0n08b";
40 name = "fno-common.patch";
41 url = "https://github.com/awesomeWM/awesome/commit/d256d9055095f27a33696e0aeda4ee20ed4fb1a0.patch";
42 sha256 = "1n3y4wnjra8blss7642jgpxnm9n92zhhjj541bb9i60m4b7bgfzz";
52 xmlto docbook_xml_dtd_45
53 docbook_xsl findXMLCatalogs
58 outputs = [ "out" "doc" ];
60 FONTCONFIG_FILE = toString fontsConf;
62 propagatedUserEnvPkgs = [ hicolor-icon-theme ];
63 buildInputs = [ cairo librsvg dbus gdk-pixbuf
64 git luaEnv libpthreadstubs libstartup_notification
65 libxdg_basedir lua nettools pango xcb-util-cursor
66 xorg.libXau xorg.libXdmcp xorg.libxcb xorg.libxshmfence
67 xorg.xcbutil xorg.xcbutilimage xorg.xcbutilkeysyms
68 xorg.xcbutilrenderutil xorg.xcbutilwm libxkbcommon
70 ++ lib.optional gtk3Support gtk3;
73 #"-DGENERATE_MANPAGES=ON"
74 "-DOVERRIDE_VERSION=${version}"
75 ] ++ lib.optional lua.pkgs.isLuaJIT "-DLUA_LIBRARY=${lua}/lib/libluajit-5.1.so"
78 GI_TYPELIB_PATH = "${pango.out}/lib/girepository-1.0";
79 # LUA_CPATH and LUA_PATH are used only for *building*, see the --search flags
80 # below for how awesome finds the libraries it needs at runtime.
81 LUA_CPATH = "${luaEnv}/lib/lua/${lua.luaversion}/?.so";
82 LUA_PATH = "${luaEnv}/share/lua/${lua.luaversion}/?.lua;;";
85 # Don't use wrapProgram or the wrapper will duplicate the --search
86 # arguments every restart
87 mv "$out/bin/awesome" "$out/bin/.awesome-wrapped"
88 makeWrapper "$out/bin/.awesome-wrapped" "$out/bin/awesome" \
89 --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
90 --add-flags '--search ${luaEnv}/lib/lua/${lua.luaversion}' \
91 --add-flags '--search ${luaEnv}/share/lua/${lua.luaversion}' \
92 --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"
94 wrapProgram $out/bin/awesome-client \
95 --prefix PATH : "${which}/bin"
103 description = "Highly configurable, dynamic window manager for X";
104 homepage = "https://awesomewm.org/";
105 license = licenses.gpl2Plus;
106 maintainers = with maintainers; [ lovek323 rasendubi ];
107 platforms = platforms.linux;