nixpkgs/pkgs/by-name/dw/dwl/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

133 lines
2.9 KiB
Nix
Raw Normal View History

2024-07-27 16:57:02 +02:00
{
lib,
fetchFromGitea,
installShellFiles,
libX11,
libinput,
libxcb,
libxkbcommon,
pixman,
pkg-config,
stdenv,
testers,
2024-07-27 16:57:02 +02:00
wayland,
wayland-protocols,
wayland-scanner,
2024-07-27 16:57:02 +02:00
wlroots,
writeText,
xcbutilwm,
xwayland,
# Boolean flags
2024-07-27 16:57:02 +02:00
enableXWayland ? true,
withCustomConfigH ? (configH != null),
# Configurable options
configH ?
if conf != null then
lib.warn ''
conf parameter is deprecated;
use configH instead
'' conf
else
null,
# Deprecated options
# Remove them before next version of either Nixpkgs or dwl itself
2024-07-27 16:57:02 +02:00
conf ? null,
2021-02-10 02:47:13 +01:00
}:
# If we set withCustomConfigH, let's not forget configH
assert withCustomConfigH -> (configH != null);
2023-04-16 22:47:20 +02:00
stdenv.mkDerivation (finalAttrs: {
2021-02-10 02:47:13 +01:00
pname = "dwl";
2024-07-27 19:37:41 +02:00
version = "0.6";
2021-02-10 02:47:13 +01:00
src = fetchFromGitea {
domain = "codeberg.org";
owner = "dwl";
repo = "dwl";
2023-04-16 22:47:20 +02:00
rev = "v${finalAttrs.version}";
2024-07-27 19:37:41 +02:00
hash = "sha256-fygUzEi4bgopesvHByfpatkLFYI98qozJOUBNM2t9Mg=";
2021-02-10 02:47:13 +01:00
};
nativeBuildInputs = [
installShellFiles
pkg-config
wayland-scanner
];
2024-07-27 16:57:02 +02:00
buildInputs =
[
libinput
libxcb
libxkbcommon
pixman
wayland
wayland-protocols
wlroots
]
++ lib.optionals enableXWayland [
libX11
xcbutilwm
xwayland
];
2021-02-10 02:47:13 +01:00
2024-07-27 16:57:02 +02:00
outputs = [
"out"
"man"
];
2021-02-10 02:47:13 +01:00
2024-07-27 16:57:02 +02:00
postPatch =
let
configFile =
if lib.isDerivation configH || builtins.isPath configH then
configH
else
writeText "config.h" configH;
2024-07-27 16:57:02 +02:00
in
lib.optionalString withCustomConfigH "cp ${configFile} config.h";
2021-02-10 02:47:13 +01:00
makeFlags =
[
"PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
"WAYLAND_SCANNER=wayland-scanner"
"PREFIX=$(out)"
"MANDIR=$(man)/share/man"
]
++ lib.optionals enableXWayland [
''XWAYLAND="-DXWAYLAND"''
''XLIBS="xcb xcb-icccm"''
];
strictDeps = true;
# required for whitespaces in makeFlags
__structuredAttrs = true;
passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
# `dwl -v` emits its version string to stderr and returns 1
command = "dwl -v 2>&1; return 0";
};
};
2021-02-10 02:47:13 +01:00
meta = {
homepage = "https://codeberg.org/dwl/dwl";
2021-02-10 02:47:13 +01:00
description = "Dynamic window manager for Wayland";
longDescription = ''
dwl is a compact, hackable compositor for Wayland based on wlroots. It is
intended to fill the same space in the Wayland world that dwm does in X11,
primarily in terms of philosophy, and secondarily in terms of
functionality. Like dwm, dwl is:
- Easy to understand, hack on, and extend with patches
- One C source file (or a very small number) configurable via config.h
- Tied to as few external dependencies as possible
'';
license = lib.licenses.gpl3Only;
maintainers = [ lib.maintainers.AndersonTorres ];
inherit (wayland.meta) platforms;
2023-11-27 02:17:53 +01:00
mainProgram = "dwl";
2021-02-10 02:47:13 +01:00
};
})
2021-02-10 02:47:13 +01:00
# TODO: custom patches from upstream website