nixpkgs/pkgs/by-name/fe/feedbackd/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

117 lines
2.3 KiB
Nix

{
lib,
stdenv,
fetchFromGitLab,
docbook-xsl-nons,
docutils,
gi-docgen,
gobject-introspection,
gtk-doc,
libxslt,
meson,
ninja,
pkg-config,
vala,
wrapGAppsHook3,
glib,
gsound,
json-glib,
libgudev,
dbus,
gmobile,
umockdev,
}:
let
themes = fetchFromGitLab {
domain = "source.puri.sm";
owner = "Librem5";
repo = "feedbackd-device-themes";
rev = "v0.4.0";
hash = "sha256-kY/+DyRxKEUzq7ctl6Va14AKUCpWU7NRQhJOwhtkJp8=";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "feedbackd";
version = "0.4.1";
outputs = [
"out"
"dev"
"devdoc"
];
src = fetchFromGitLab {
domain = "source.puri.sm";
owner = "Librem5";
repo = "feedbackd";
rev = "v${finalAttrs.version}";
hash = "sha256-ta14DYqkid8Cp8fx9ZMGOOJroCBszN9/VrTN6mrpTZg=";
};
depsBuildBuild = [
pkg-config
];
nativeBuildInputs = [
docbook-xsl-nons
docutils # for rst2man
gi-docgen
gobject-introspection
gtk-doc
libxslt
meson
ninja
pkg-config
vala
wrapGAppsHook3
];
buildInputs = [
glib
gsound
json-glib
libgudev
gmobile
];
mesonFlags = [
"-Dgtk_doc=true"
"-Dman=true"
# Make compiling work when doCheck = false
"-Dtests=${lib.boolToString finalAttrs.finalPackage.doCheck}"
];
nativeCheckInputs = [
dbus
umockdev
];
doCheck = true;
postInstall = ''
mkdir -p $out/lib/udev/rules.d
sed "s|/usr/libexec/|$out/libexec/|" < $src/data/90-feedbackd.rules > $out/lib/udev/rules.d/90-feedbackd.rules
cp ${themes}/data/* $out/share/feedbackd/themes/
'';
postFixup = ''
# Move developer documentation to devdoc output.
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
if [[ -d "$out/share/doc" ]]; then
find -L "$out/share/doc" -type f -regex '.*\.devhelp2?' -print0 \
| while IFS= read -r -d ''' file; do
moveToOutput "$(dirname "''${file/"$out/"/}")" "$devdoc"
done
fi
'';
meta = with lib; {
description = "Daemon to provide haptic (and later more) feedback on events";
homepage = "https://source.puri.sm/Librem5/feedbackd";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ pacman99 ];
platforms = platforms.linux;
};
})