diff --git a/pkgs/applications/window-managers/sway/osd.nix b/pkgs/applications/window-managers/sway/osd.nix index 2b210efedb9d..b2a7b17b4315 100644 --- a/pkgs/applications/window-managers/sway/osd.nix +++ b/pkgs/applications/window-managers/sway/osd.nix @@ -3,14 +3,20 @@ , fetchFromGitHub , pkg-config , wrapGAppsHook +, cargo +, coreutils , gtk-layer-shell , libevdev , libinput , libpulseaudio +, meson +, ninja +, rustc +, stdenv , udev }: -rustPlatform.buildRustPackage { +stdenv.mkDerivation rec { pname = "swayosd"; version = "unstable-2023-07-18"; @@ -21,11 +27,20 @@ rustPlatform.buildRustPackage { hash = "sha256-MJuTwEI599Y7q+0u0DMxRYaXsZfpksc2csgnK9Ghp/E="; }; - cargoHash = "sha256-pExpzQwuHREhgkj+eZ8drBVsh/B3WiQBBh906O6ymFw="; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-pExpzQwuHREhgkj+eZ8drBVsh/B3WiQBBh906O6ymFw="; + }; nativeBuildInputs = [ wrapGAppsHook pkg-config + meson + rustc + cargo + ninja + rustPlatform.cargoSetupHook ]; buildInputs = [ @@ -36,6 +51,16 @@ rustPlatform.buildRustPackage { udev ]; + patches = [ + ./swayosd_systemd_paths.patch + ]; + + postPatch = '' + substituteInPlace data/udev/99-swayosd.rules \ + --replace /bin/chgrp ${coreutils}/bin/chgrp \ + --replace /bin/chmod ${coreutils}/bin/chmod + ''; + meta = with lib; { description = "A GTK based on screen display for keyboard shortcuts"; homepage = "https://github.com/ErikReider/SwayOSD"; diff --git a/pkgs/applications/window-managers/sway/swayosd_systemd_paths.patch b/pkgs/applications/window-managers/sway/swayosd_systemd_paths.patch new file mode 100644 index 000000000000..189c761e9d36 --- /dev/null +++ b/pkgs/applications/window-managers/sway/swayosd_systemd_paths.patch @@ -0,0 +1,24 @@ +diff --git a/data/meson.build b/data/meson.build +index fc687a5..68decdf 100644 +--- a/data/meson.build ++++ b/data/meson.build +@@ -1,5 +1,6 @@ + datadir = get_option('datadir') + sysconfdir = get_option('sysconfdir') ++libdir = get_option('libdir') + + # LICENSE + install_data( +@@ -41,11 +42,7 @@ configure_file( + + # Systemd service unit + systemd = dependency('systemd', required: false) +-if systemd.found() +- systemd_service_install_dir = systemd.get_variable(pkgconfig :'systemdsystemunitdir') +-else +- systemd_service_install_dir = join_paths(libdir, 'systemd', 'system') +-endif ++systemd_service_install_dir = join_paths(libdir, 'systemd', 'system') + + configure_file( + configuration: conf_data,