2021-06-25 17:47:52 +01:00
|
|
|
{ lib, stdenv, fetchzip, fetchpatch,
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config, bmake,
|
2020-06-03 15:09:25 +01:00
|
|
|
cairo, glib, libevdev, libinput, libxkbcommon, linux-pam, pango, pixman,
|
2021-04-09 12:28:24 +01:00
|
|
|
libucl, wayland, wayland-protocols, wlroots, mesa,
|
2020-06-03 15:09:25 +01:00
|
|
|
features ? {
|
|
|
|
gammacontrol = true;
|
|
|
|
layershell = true;
|
|
|
|
screencopy = true;
|
|
|
|
xwayland = true;
|
|
|
|
}
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "hikari";
|
2021-06-26 23:20:55 +01:00
|
|
|
version = "2.3.1";
|
2020-06-03 15:09:25 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://hikari.acmelabs.space/releases/${pname}-${version}.tar.gz";
|
2021-06-26 23:20:55 +01:00
|
|
|
sha256 = "sha256-o6YsUATcWHSuAEfU7WnwxKNxRNuBt069qCv0FKDWStg=";
|
2020-06-03 15:09:25 +01:00
|
|
|
};
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config bmake ];
|
2020-06-03 15:09:25 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cairo
|
|
|
|
glib
|
|
|
|
libevdev
|
|
|
|
libinput
|
|
|
|
libxkbcommon
|
|
|
|
linux-pam
|
|
|
|
pango
|
|
|
|
pixman
|
|
|
|
libucl
|
2021-04-09 12:28:24 +01:00
|
|
|
mesa # for libEGL
|
2020-06-03 15:09:25 +01:00
|
|
|
wayland
|
|
|
|
wayland-protocols
|
|
|
|
wlroots
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-04-11 14:46:02 +01:00
|
|
|
makeFlags = with lib; [ "PREFIX=$(out)" ]
|
2020-06-03 15:09:25 +01:00
|
|
|
++ optional stdenv.isLinux "WITH_POSIX_C_SOURCE=YES"
|
|
|
|
++ mapAttrsToList (feat: enabled:
|
|
|
|
optionalString enabled "WITH_${toUpper feat}=YES"
|
2021-04-11 14:46:02 +01:00
|
|
|
) features;
|
2020-06-03 15:09:25 +01:00
|
|
|
|
2021-04-28 07:24:32 +01: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-03 15:09:25 +01:00
|
|
|
substituteInPlace Makefile --replace '4555' '555'
|
2021-04-28 07:24:32 +01:00
|
|
|
|
|
|
|
sed -i 's@<drm_fourcc.h>@<libdrm/drm_fourcc.h>@' src/*.c
|
2020-06-03 15:09:25 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-06-03 15:09:25 +01: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 ];
|
|
|
|
};
|
|
|
|
}
|