biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / window-managers / awesome / default.nix
blob3c377d011bd3487f2d05c6b123000ede23d8077f
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
8 , asciidoctor
9 , fontsConf
10 , gtk3Support ? false, gtk3 ? null
13 # needed for beautiful.gtk to work
14 assert gtk3Support -> gtk3 != null;
16 let
17   luaEnv = lua.withPackages(ps: [ ps.lgi ps.ldoc ]);
20 stdenv.mkDerivation rec {
21   pname = "awesome";
22   version = "4.3";
24   src = fetchFromGitHub {
25     owner = "awesomewm";
26     repo = "awesome";
27     rev = "v${version}";
28     sha256 = "1i7ajmgbsax4lzpgnmkyv35x8vxqi0j84a14k6zys4blx94m9yjf";
29   };
31   patches = [
32     # Pull upstream fix for -fno-common toolchain support:
33     #   https://github.com/awesomeWM/awesome/pull/3065
34     (fetchpatch {
35       name = "fno-common-prerequisite.patch";
36       url = "https://github.com/awesomeWM/awesome/commit/c5202a48708585cc33528065af8d1b1d28b1a6e0.patch";
37       sha256 = "0sv36xf0ibjcm63gn9k3bl039sqavb2b5i6d65il4bdclkc0n08b";
38     })
39     (fetchpatch {
40       name = "fno-common.patch";
41       url = "https://github.com/awesomeWM/awesome/commit/d256d9055095f27a33696e0aeda4ee20ed4fb1a0.patch";
42       sha256 = "1n3y4wnjra8blss7642jgpxnm9n92zhhjj541bb9i60m4b7bgfzz";
43     })
44   ];
46   nativeBuildInputs = [
47     cmake
48     doxygen
49     imagemagick
50     makeWrapper
51     pkg-config
52     xmlto docbook_xml_dtd_45
53     docbook_xsl findXMLCatalogs
54     asciidoctor
55     gobject-introspection
56   ];
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
69                   xcbutilxrm ]
70                   ++ lib.optional gtk3Support gtk3;
72   cmakeFlags = [
73     #"-DGENERATE_MANPAGES=ON"
74     "-DOVERRIDE_VERSION=${version}"
75   ] ++ lib.optional lua.pkgs.isLuaJIT "-DLUA_LIBRARY=${lua}/lib/libluajit-5.1.so"
76   ;
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;;";
84   postInstall = ''
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"
96   '';
98   passthru = {
99     inherit lua;
100   };
102   meta = with lib; {
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;
108   };