2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2021-05-20 23:08:51 +00:00
|
|
|
, docbook-xsl-nons
|
2023-03-08 16:32:21 +00:00
|
|
|
, docutils
|
|
|
|
, gi-docgen
|
2021-05-20 23:08:51 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, gtk-doc
|
|
|
|
, libxslt
|
2021-02-05 17:12:51 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
2021-05-20 23:08:51 +00:00
|
|
|
, vala
|
2024-05-15 15:35:15 +00:00
|
|
|
, wrapGAppsHook3
|
2021-02-05 17:12:51 +00:00
|
|
|
, glib
|
|
|
|
, gsound
|
|
|
|
, json-glib
|
2021-05-20 23:08:51 +00:00
|
|
|
, libgudev
|
|
|
|
, dbus
|
2024-09-19 14:19:46 +00:00
|
|
|
, gmobile
|
|
|
|
, umockdev
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
|
|
|
|
2022-02-21 08:47:16 +00:00
|
|
|
let
|
|
|
|
themes = fetchFromGitLab {
|
|
|
|
domain = "source.puri.sm";
|
|
|
|
owner = "Librem5";
|
|
|
|
repo = "feedbackd-device-themes";
|
2024-09-19 14:19:46 +00:00
|
|
|
rev = "v0.4.0";
|
|
|
|
hash = "sha256-kY/+DyRxKEUzq7ctl6Va14AKUCpWU7NRQhJOwhtkJp8=";
|
2022-02-21 08:47:16 +00:00
|
|
|
};
|
|
|
|
in
|
2024-09-19 14:19:46 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "feedbackd";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.4.1";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "source.puri.sm";
|
|
|
|
owner = "Librem5";
|
|
|
|
repo = "feedbackd";
|
2024-09-19 14:19:46 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-ta14DYqkid8Cp8fx9ZMGOOJroCBszN9/VrTN6mrpTZg=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
docbook-xsl-nons
|
2023-03-08 16:32:21 +00:00
|
|
|
docutils # for rst2man
|
|
|
|
gi-docgen
|
2021-05-20 23:08:51 +00:00
|
|
|
gobject-introspection
|
|
|
|
gtk-doc
|
|
|
|
libxslt
|
2021-02-05 17:12:51 +00:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
vala
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
gsound
|
|
|
|
json-glib
|
2021-05-20 23:08:51 +00:00
|
|
|
libgudev
|
2024-09-19 14:19:46 +00:00
|
|
|
gmobile
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
mesonFlags = [
|
2023-03-08 16:32:21 +00:00
|
|
|
"-Dgtk_doc=true"
|
2022-06-16 17:23:12 +00:00
|
|
|
"-Dman=true"
|
2024-09-19 14:19:46 +00:00
|
|
|
# Make compiling work when doCheck = false
|
|
|
|
"-Dtests=${lib.boolToString finalAttrs.finalPackage.doCheck}"
|
2022-06-16 17:23:12 +00:00
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
dbus
|
2024-09-19 14:19:46 +00:00
|
|
|
umockdev
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib/udev/rules.d
|
2024-09-19 14:19:46 +00:00
|
|
|
sed "s|/usr/libexec/|$out/libexec/|" < $src/data/90-feedbackd.rules > $out/lib/udev/rules.d/90-feedbackd.rules
|
2022-02-21 08:47:16 +00:00
|
|
|
cp ${themes}/data/* $out/share/feedbackd/themes/
|
2021-05-03 20:48:10 +00:00
|
|
|
'';
|
|
|
|
|
2023-03-08 16:32:21 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Daemon to provide haptic (and later more) feedback on events";
|
2021-02-05 17:12:51 +00:00
|
|
|
homepage = "https://source.puri.sm/Librem5/feedbackd";
|
|
|
|
license = licenses.gpl3Plus;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [ pacman99 ];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
2024-09-19 14:19:46 +00:00
|
|
|
})
|