nixpkgs/pkgs/applications/window-managers/hikari/default.nix

76 lines
1.8 KiB
Nix
Raw Normal View History

2020-06-03 15:09:25 +01:00
{ stdenv, fetchzip,
pkgconfig, bmake,
cairo, glib, libevdev, libinput, libxkbcommon, linux-pam, pango, pixman,
libucl, wayland, wayland-protocols, wlroots,
features ? {
gammacontrol = true;
layershell = true;
screencopy = true;
xwayland = true;
}
}:
let
pname = "hikari";
2020-08-18 21:36:51 +01:00
version = "2.1.2";
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";
2020-08-18 21:36:51 +01:00
sha256 = "1qzbwc8dgsvp5jb4faapcrg9npsl11gq8jvhbbk2h7hj52c5lgmv";
2020-06-03 15:09:25 +01:00
};
nativeBuildInputs = [ pkgconfig bmake ];
buildInputs = [
cairo
glib
libevdev
libinput
libxkbcommon
linux-pam
pango
pixman
libucl
wayland
wayland-protocols
wlroots
];
enableParallelBuilding = true;
# Must replace GNU Make by bmake
buildPhase = with stdenv.lib; concatStringsSep " " (
[ "bmake" "-j$NIX_BUILD_CORES" "PREFIX=$out" ]
++ optional stdenv.isLinux "WITH_POSIX_C_SOURCE=YES"
++ mapAttrsToList (feat: enabled:
optionalString enabled "WITH_${toUpper feat}=YES"
) features
);
# 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.
patchPhase = ''
substituteInPlace Makefile --replace '4555' '555'
'';
installPhase = ''
bmake \
PREFIX=$out \
install
runHook postInstall
'';
meta = with stdenv.lib; {
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 ];
};
}