Merge pull request #245011 from aacebedo/aacebedo/refactor_swayosd

swayosd: refactor build to install all files
This commit is contained in:
Sandro 2023-07-23 19:35:53 +02:00 committed by GitHub
commit 7e6d24c640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 2 deletions

View file

@ -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";

View file

@ -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,