speakersafetyd: init at 0.1.9 (#281305)
This commit is contained in:
parent
9cd0771098
commit
0d565b02fa
1 changed files with 47 additions and 0 deletions
47
pkgs/by-name/sp/speakersafetyd/package.nix
Normal file
47
pkgs/by-name/sp/speakersafetyd/package.nix
Normal file
|
@ -0,0 +1,47 @@
|
|||
{ stdenv
|
||||
, lib
|
||||
, rustPlatform
|
||||
, fetchCrate
|
||||
, pkg-config
|
||||
, alsa-lib
|
||||
, rust
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "speakersafetyd";
|
||||
version = "0.1.9";
|
||||
|
||||
src = fetchCrate {
|
||||
inherit pname version;
|
||||
hash = "sha256-I1fL1U4vqKxPS1t6vujMTdi/JAAOCcPkvUqv6FqkId4=";
|
||||
};
|
||||
cargoHash = "sha256-Adwct+qFhUsOIao8XqNK2zcn13DBlQNA+X4aRFeIAXM=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
buildInputs = [ alsa-lib ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace speakersafetyd.service --replace "/usr" "$out"
|
||||
substituteInPlace Makefile --replace "target/release" "target/${rust.lib.toRustTargetSpec stdenv.hostPlatform}/$cargoBuildType"
|
||||
# creating files in /var does not make sense in a nix package
|
||||
substituteInPlace Makefile --replace 'install -dDm0755 $(DESTDIR)/$(VARDIR)/lib/speakersafetyd/blackbox' ""
|
||||
'';
|
||||
|
||||
installFlags = [
|
||||
"BINDIR=$(out)/bin"
|
||||
"UNITDIR=$(out)/lib/systemd/system"
|
||||
"UDEVDIR=$(out)/lib/udev/rules.d"
|
||||
"SHAREDIR=$(out)/share"
|
||||
"TMPFILESDIR=$(out)/lib/tmpfiles.d"
|
||||
];
|
||||
|
||||
dontCargoInstall = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "A userspace daemon written in Rust that implements an analogue of the Texas Instruments Smart Amp speaker protection model";
|
||||
homepage = "https://github.com/AsahiLinux/speakersafetyd";
|
||||
maintainers = with maintainers; [ yuka ];
|
||||
license = licenses.mit;
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue