forked from mirrors/nixpkgs
4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
93 lines
3 KiB
Nix
93 lines
3 KiB
Nix
{ lib, stdenv, fetchFromGitHub, luaPackages, cairo, librsvg, cmake, imagemagick, pkgconfig, gdk-pixbuf
|
|
, xorg, libstartup_notification, libxdg_basedir, libpthreadstubs
|
|
, xcb-util-cursor, makeWrapper, pango, gobject-introspection
|
|
, which, dbus, nettools, git, doxygen
|
|
, xmlto, docbook_xml_dtd_45, docbook_xsl, findXMLCatalogs
|
|
, libxkbcommon, xcbutilxrm, hicolor-icon-theme
|
|
, asciidoctor
|
|
, fontsConf
|
|
, gtk3Support ? false, gtk3 ? null
|
|
}:
|
|
|
|
# needed for beautiful.gtk to work
|
|
assert gtk3Support -> gtk3 != null;
|
|
|
|
stdenv.mkDerivation rec {
|
|
lgi = luaPackages.lgi;
|
|
lua = luaPackages.lua;
|
|
ldoc = luaPackages.ldoc;
|
|
pname = "awesome";
|
|
version = "4.3";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "awesomewm";
|
|
repo = "awesome";
|
|
rev = "v${version}";
|
|
sha256 = "1i7ajmgbsax4lzpgnmkyv35x8vxqi0j84a14k6zys4blx94m9yjf";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
doxygen
|
|
imagemagick
|
|
makeWrapper
|
|
pkgconfig
|
|
xmlto docbook_xml_dtd_45
|
|
docbook_xsl findXMLCatalogs
|
|
asciidoctor
|
|
ldoc
|
|
];
|
|
|
|
outputs = [ "out" "doc" ];
|
|
|
|
FONTCONFIG_FILE = toString fontsConf;
|
|
|
|
propagatedUserEnvPkgs = [ hicolor-icon-theme ];
|
|
buildInputs = [ cairo librsvg dbus gdk-pixbuf gobject-introspection
|
|
git lgi libpthreadstubs libstartup_notification
|
|
libxdg_basedir lua nettools pango xcb-util-cursor
|
|
xorg.libXau xorg.libXdmcp xorg.libxcb xorg.libxshmfence
|
|
xorg.xcbutil xorg.xcbutilimage xorg.xcbutilkeysyms
|
|
xorg.xcbutilrenderutil xorg.xcbutilwm libxkbcommon
|
|
xcbutilxrm ]
|
|
++ stdenv.lib.optional gtk3Support gtk3;
|
|
|
|
cmakeFlags = [
|
|
#"-DGENERATE_MANPAGES=ON"
|
|
"-DOVERRIDE_VERSION=${version}"
|
|
] ++ stdenv.lib.optional luaPackages.isLuaJIT "-DLUA_LIBRARY=${lua}/lib/libluajit-5.1.so"
|
|
;
|
|
|
|
GI_TYPELIB_PATH = "${pango.out}/lib/girepository-1.0";
|
|
# LUA_CPATH and LUA_PATH are used only for *building*, see the --search flags
|
|
# below for how awesome finds the libraries it needs at runtime.
|
|
LUA_CPATH = "${lgi}/lib/lua/${lua.luaversion}/?.so";
|
|
LUA_PATH = "${lgi}/share/lua/${lua.luaversion}/?.lua;;";
|
|
|
|
postInstall = ''
|
|
# Don't use wrapProgram or the wrapper will duplicate the --search
|
|
# arguments every restart
|
|
mv "$out/bin/awesome" "$out/bin/.awesome-wrapped"
|
|
makeWrapper "$out/bin/.awesome-wrapped" "$out/bin/awesome" \
|
|
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
|
|
--add-flags '--search ${lgi}/lib/lua/${lua.luaversion}' \
|
|
--add-flags '--search ${lgi}/share/lua/${lua.luaversion}' \
|
|
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"
|
|
|
|
wrapProgram $out/bin/awesome-client \
|
|
--prefix PATH : "${which}/bin"
|
|
'';
|
|
|
|
passthru = {
|
|
inherit lua;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Highly configurable, dynamic window manager for X";
|
|
homepage = "https://awesomewm.org/";
|
|
license = licenses.gpl2Plus;
|
|
maintainers = with maintainers; [ lovek323 rasendubi ];
|
|
platforms = platforms.linux;
|
|
};
|
|
}
|