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 , pkg-config
, pipewire , pipewire
, udev , udev
, clang
, libclang
, libxkbcommon , libxkbcommon
, libinput , libinput
, systemd , systemd
, wayland , wayland
, mesa , mesa
, seatd , seatd
# Session script dependencies.
, makeBinaryWrapper
, coreutils
, dbus
}: }:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
@ -26,12 +29,12 @@ rustPlatform.buildRustPackage rec {
}; };
nativeBuildInputs = [ nativeBuildInputs = [
makeBinaryWrapper
pkg-config pkg-config
clang rustPlatform.bindgenHook
]; ];
buildInputs = [ buildInputs = [
libclang.lib
libinput libinput
libxkbcommon libxkbcommon
mesa mesa
@ -42,19 +45,32 @@ rustPlatform.buildRustPackage rec {
wayland wayland
]; ];
env.LIBCLANG_PATH = "${libclang.lib}/lib";
cargoLock = { cargoLock = {
lockFile = ./Cargo.lock; lockFile = "${src}/Cargo.lock";
outputHashes = { outputHashes = {
"smithay-0.3.0" = "sha256-Eqs4wqogdld6MHOXQ2NRFCgJH4RHf4mYWFdjRVUVxsk="; "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; { meta = with lib; {
homepage = "https://github.com/YaLTeR/niri"; homepage = "https://github.com/YaLTeR/niri";
description = "Scrollable tiling window manager"; description = "Scrollable tiling window manager";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;
mainProgram = "niri";
maintainers = with maintainers; [ foo-dogsquared ]; maintainers = with maintainers; [ foo-dogsquared ];
platforms = platforms.linux; platforms = platforms.linux;
}; };