2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, zig
|
|
|
|
, wayland
|
|
|
|
, pkg-config
|
|
|
|
, scdoc
|
|
|
|
, xwayland
|
|
|
|
, wayland-protocols
|
2023-01-11 07:51:40 +00:00
|
|
|
, wlroots_0_16
|
2021-05-20 23:08:51 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, pixman
|
|
|
|
, udev
|
|
|
|
, libevdev
|
2021-07-03 03:11:41 +00:00
|
|
|
, libinput
|
2021-05-20 23:08:51 +00:00
|
|
|
, libGL
|
2022-02-10 20:34:41 +00:00
|
|
|
, libX11
|
|
|
|
, xwaylandSupport ? true
|
2021-04-15 00:37:46 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "river";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.2.1";
|
2021-04-15 00:37:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-01-26 04:04:25 +00:00
|
|
|
owner = "riverwm";
|
2021-05-03 20:48:10 +00:00
|
|
|
repo = pname;
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-eIW8NNhacAM/7gZCUHCmiySANLenfcaCRTUkoJUZRPQ=";
|
2021-04-15 00:37:46 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
nativeBuildInputs = [ zig wayland xwayland scdoc pkg-config ];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
wayland-protocols
|
2023-01-11 07:51:40 +00:00
|
|
|
wlroots_0_16
|
2021-05-20 23:08:51 +00:00
|
|
|
libxkbcommon
|
|
|
|
pixman
|
|
|
|
udev
|
|
|
|
libevdev
|
2021-07-03 03:11:41 +00:00
|
|
|
libinput
|
2021-05-20 23:08:51 +00:00
|
|
|
libGL
|
2022-02-10 20:34:41 +00:00
|
|
|
] ++ lib.optional xwaylandSupport libX11;
|
2021-04-15 00:37:46 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
|
2021-04-15 00:37:46 +00:00
|
|
|
preBuild = ''
|
|
|
|
export HOME=$TMPDIR
|
|
|
|
'';
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2021-04-15 00:37:46 +00:00
|
|
|
installPhase = ''
|
2021-05-20 23:08:51 +00:00
|
|
|
runHook preInstall
|
2022-02-10 20:34:41 +00:00
|
|
|
zig build -Drelease-safe -Dcpu=baseline ${lib.optionalString xwaylandSupport "-Dxwayland"} -Dman-pages --prefix $out install
|
2022-12-02 08:20:57 +00:00
|
|
|
install contrib/river.desktop -Dt $out/share/wayland-sessions
|
2021-05-20 23:08:51 +00:00
|
|
|
runHook postInstall
|
2021-05-03 20:48:10 +00:00
|
|
|
'';
|
2021-04-15 00:37:46 +00:00
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
/* Builder patch install dir into river to get default config
|
2022-02-10 20:34:41 +00:00
|
|
|
When installFlags is removed, river becomes half broken.
|
|
|
|
See https://github.com/riverwm/river/blob/7ffa2f4b9e7abf7d152134f555373c2b63ccfc1d/river/main.zig#L56
|
2021-05-20 23:08:51 +00:00
|
|
|
*/
|
2021-04-15 00:37:46 +00:00
|
|
|
installFlags = [ "DESTDIR=$(out)" ];
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
passthru.providedSessions = ["river"];
|
|
|
|
|
2021-04-15 00:37:46 +00:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/ifreund/river";
|
2021-05-20 23:08:51 +00:00
|
|
|
description = "A dynamic tiling wayland compositor";
|
2021-04-15 00:37:46 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2023-01-11 07:51:40 +00:00
|
|
|
maintainers = with maintainers; [ fortuneteller2k adamcstephens ];
|
2021-04-15 00:37:46 +00:00
|
|
|
};
|
|
|
|
}
|