2024-07-27 16:57:02 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchFromGitea,
|
|
|
|
installShellFiles,
|
|
|
|
libX11,
|
|
|
|
libinput,
|
|
|
|
libxcb,
|
|
|
|
libxkbcommon,
|
|
|
|
pixman,
|
|
|
|
pkg-config,
|
2024-07-27 19:18:23 +02:00
|
|
|
stdenv,
|
|
|
|
testers,
|
2024-07-27 16:57:02 +02:00
|
|
|
wayland,
|
|
|
|
wayland-protocols,
|
2024-07-27 19:18:23 +02:00
|
|
|
wayland-scanner,
|
2024-07-27 16:57:02 +02:00
|
|
|
wlroots,
|
|
|
|
writeText,
|
|
|
|
xcbutilwm,
|
|
|
|
xwayland,
|
2024-07-27 19:18:23 +02:00
|
|
|
# Boolean flags
|
2024-07-27 16:57:02 +02:00
|
|
|
enableXWayland ? true,
|
2024-07-27 19:18:23 +02:00
|
|
|
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
|
|
|
}:
|
|
|
|
|
2024-07-27 19:18:23 +02: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
|
|
|
|
2024-03-16 16:50:36 +01:00
|
|
|
src = fetchFromGitea {
|
|
|
|
domain = "codeberg.org";
|
|
|
|
owner = "dwl";
|
2023-01-25 13:32:40 +01:00
|
|
|
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
|
|
|
};
|
|
|
|
|
2023-01-25 13:32:40 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
pkg-config
|
2023-04-23 12:18:55 +02:00
|
|
|
wayland-scanner
|
2023-01-25 13:32:40 +01:00
|
|
|
];
|
2022-01-31 22:51:36 +01:00
|
|
|
|
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 =
|
2024-07-27 19:18:23 +02:00
|
|
|
if lib.isDerivation configH || builtins.isPath configH then
|
|
|
|
configH
|
|
|
|
else
|
|
|
|
writeText "config.h" configH;
|
2024-07-27 16:57:02 +02:00
|
|
|
in
|
2024-07-27 19:18:23 +02:00
|
|
|
lib.optionalString withCustomConfigH "cp ${configFile} config.h";
|
2021-02-10 02:47:13 +01:00
|
|
|
|
2024-07-27 19:18:23 +02: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"''
|
|
|
|
];
|
2023-04-23 12:18:55 +02:00
|
|
|
|
2024-07-27 19:18:23 +02:00
|
|
|
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
|
|
|
|
2023-01-25 13:32:40 +01:00
|
|
|
meta = {
|
2024-07-27 19:18:23 +02:00
|
|
|
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
|
|
|
|
'';
|
2023-01-25 13:32:40 +01:00
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
maintainers = [ lib.maintainers.AndersonTorres ];
|
2022-01-31 22:51:36 +01:00
|
|
|
inherit (wayland.meta) platforms;
|
2023-11-27 02:17:53 +01:00
|
|
|
mainProgram = "dwl";
|
2021-02-10 02:47:13 +01:00
|
|
|
};
|
2023-01-25 13:32:40 +01:00
|
|
|
})
|
2021-02-10 02:47:13 +01:00
|
|
|
# TODO: custom patches from upstream website
|