2021-08-05 21:33:18 +00:00
|
|
|
{ lib, stdenv, fetchzip
|
|
|
|
, pkg-config, bmake
|
|
|
|
, cairo, glib, libevdev, libinput, libxkbcommon, linux-pam, pango, pixman
|
|
|
|
, libucl, wayland, wayland-protocols, wlroots, mesa
|
|
|
|
, features ? {
|
2020-06-18 07:06:33 +00:00
|
|
|
gammacontrol = true;
|
|
|
|
layershell = true;
|
|
|
|
screencopy = true;
|
|
|
|
xwayland = true;
|
|
|
|
}
|
|
|
|
}:
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-06-18 07:06:33 +00:00
|
|
|
pname = "hikari";
|
2023-03-08 16:32:21 +00:00
|
|
|
version = "2.3.3";
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://hikari.acmelabs.space/releases/${pname}-${version}.tar.gz";
|
2023-03-08 16:32:21 +00:00
|
|
|
sha256 = "sha256-5Ug0U3ESC5F/gj7bahnLYkeY/weSCj0QASwdFuWwdMI=";
|
2020-06-18 07:06:33 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config bmake ];
|
2020-06-18 07:06:33 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cairo
|
|
|
|
glib
|
|
|
|
libevdev
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
|
|
|
linux-pam
|
|
|
|
pango
|
|
|
|
pixman
|
|
|
|
libucl
|
2021-04-26 19:14:03 +00:00
|
|
|
mesa # for libEGL
|
2020-06-18 07:06:33 +00:00
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
wlroots
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-04-17 00:35:05 +00:00
|
|
|
makeFlags = with lib; [ "PREFIX=$(out)" ]
|
2020-06-18 07:06:33 +00:00
|
|
|
++ optional stdenv.isLinux "WITH_POSIX_C_SOURCE=YES"
|
|
|
|
++ mapAttrsToList (feat: enabled:
|
|
|
|
optionalString enabled "WITH_${toUpper feat}=YES"
|
2021-04-17 00:35:05 +00:00
|
|
|
) features;
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Can't suid in nix store
|
|
|
|
# Run hikari as root (it will drop privileges as early as possible), or create
|
|
|
|
# a systemd unit to give it the necessary permissions/capabilities.
|
2020-06-18 07:06:33 +00:00
|
|
|
substituteInPlace Makefile --replace '4555' '555'
|
2021-05-03 20:48:10 +00:00
|
|
|
|
|
|
|
sed -i 's@<drm_fourcc.h>@<libdrm/drm_fourcc.h>@' src/*.c
|
2020-06-18 07:06:33 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-06-18 07:06:33 +00:00
|
|
|
description = "Stacking Wayland compositor which is actively developed on FreeBSD but also supports Linux";
|
|
|
|
homepage = "https://hikari.acmelabs.space";
|
|
|
|
license = licenses.bsd2;
|
|
|
|
platforms = platforms.linux ++ platforms.freebsd;
|
|
|
|
maintainers = with maintainers; [ jpotier ];
|
|
|
|
};
|
|
|
|
}
|