niri: update package

* Install more files from upstream.
* Use upstream Cargo.lock.
* Use `rustPlatform.bindgenHook`.
This commit is contained in:
Gabriel Arazas 2024-01-01 13:52:50 +08:00
parent 8255d8ec01
commit ef5b55f08b
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -4,14 +4,17 @@
, pkg-config
, pipewire
, udev
, clang
, libclang
, libxkbcommon
, libinput
, systemd
, wayland
, mesa
, seatd
# Session script dependencies.
, makeBinaryWrapper
, coreutils
, dbus
}:
rustPlatform.buildRustPackage rec {
@ -26,12 +29,12 @@ rustPlatform.buildRustPackage rec {
};
nativeBuildInputs = [
makeBinaryWrapper
pkg-config
clang
rustPlatform.bindgenHook
];
buildInputs = [
libclang.lib
libinput
libxkbcommon
mesa
@ -42,19 +45,32 @@ rustPlatform.buildRustPackage rec {
wayland
];
env.LIBCLANG_PATH = "${libclang.lib}/lib";
cargoLock = {
lockFile = ./Cargo.lock;
lockFile = "${src}/Cargo.lock";
outputHashes = {
"smithay-0.3.0" = "sha256-Eqs4wqogdld6MHOXQ2NRFCgJH4RHf4mYWFdjRVUVxsk=";
};
};
postPatch = ''
patchShebangs ./resources/niri-session
'';
postInstall = ''
install -Dm0755 resources/niri-session -t $out/libexec
makeWrapper $out/libexec/niri-session \
--prefix PATH ':' '${lib.makeBinPath [ coreutils systemd dbus ]}'
install -Dm0644 resources/niri.desktop -t $out/share/applications
install -Dm0644 resources/niri-portals.conf -t $out/share/xdg-desktop-portal
install -Dm0644 resources/niri{-shutdown.target,.service} -t $out/share/systemd
'';
meta = with lib; {
homepage = "https://github.com/YaLTeR/niri";
description = "Scrollable tiling window manager";
license = licenses.gpl3Plus;
mainProgram = "niri";
maintainers = with maintainers; [ foo-dogsquared ];
platforms = platforms.linux;
};