2020-12-26 22:03:24 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2023-03-17 18:19:47 +00:00
|
|
|
, fetchpatch2
|
2021-05-09 15:16:33 +00:00
|
|
|
, docbook-xsl-nons
|
2022-12-17 23:28:29 +00:00
|
|
|
, docutils
|
|
|
|
, gi-docgen
|
2021-05-09 15:16:33 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, gtk-doc
|
|
|
|
, libxslt
|
2020-12-26 22:03:24 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
2021-05-09 15:16:33 +00:00
|
|
|
, vala
|
2020-12-26 22:03:24 +00:00
|
|
|
, wrapGAppsHook
|
|
|
|
, glib
|
|
|
|
, gsound
|
|
|
|
, json-glib
|
2021-05-09 15:16:33 +00:00
|
|
|
, libgudev
|
|
|
|
, dbus
|
2020-12-26 22:03:24 +00:00
|
|
|
}:
|
|
|
|
|
2021-09-12 02:44:44 +00:00
|
|
|
let
|
|
|
|
themes = fetchFromGitLab {
|
|
|
|
domain = "source.puri.sm";
|
|
|
|
owner = "Librem5";
|
|
|
|
repo = "feedbackd-device-themes";
|
2023-03-05 10:06:57 +00:00
|
|
|
rev = "v0.1.0";
|
|
|
|
sha256 = "sha256-YK9fJ3awmhf1FAhdz95T/POivSO93jsNApm+u4OOZ80=";
|
2021-09-12 02:44:44 +00:00
|
|
|
};
|
|
|
|
in
|
2020-12-26 22:03:24 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-09 15:16:33 +00:00
|
|
|
pname = "feedbackd";
|
2023-05-23 00:05:56 +00:00
|
|
|
version = "0.2.0";
|
2021-05-09 15:16:33 +00:00
|
|
|
|
2022-12-17 23:28:29 +00:00
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
2020-12-26 22:03:24 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "source.puri.sm";
|
|
|
|
owner = "Librem5";
|
|
|
|
repo = "feedbackd";
|
2021-05-09 15:16:33 +00:00
|
|
|
rev = "v${version}";
|
2023-05-23 00:05:56 +00:00
|
|
|
hash = "sha256-l5rfMx3ElW25A5WVqzfKBp57ebaNC9msqV7mvnwv10s=";
|
2022-12-17 23:28:29 +00:00
|
|
|
fetchSubmodules = true;
|
2020-12-26 22:03:24 +00:00
|
|
|
};
|
|
|
|
|
2022-12-17 23:28:29 +00:00
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2020-12-26 22:03:24 +00:00
|
|
|
nativeBuildInputs = [
|
2021-05-09 15:16:33 +00:00
|
|
|
docbook-xsl-nons
|
2022-12-17 23:28:29 +00:00
|
|
|
docutils # for rst2man
|
|
|
|
gi-docgen
|
2021-05-09 15:16:33 +00:00
|
|
|
gobject-introspection
|
|
|
|
gtk-doc
|
|
|
|
libxslt
|
2020-12-26 22:03:24 +00:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
vala
|
2021-05-09 15:16:33 +00:00
|
|
|
wrapGAppsHook
|
2020-12-26 22:03:24 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
gsound
|
|
|
|
json-glib
|
2021-05-09 15:16:33 +00:00
|
|
|
libgudev
|
2020-12-26 22:03:24 +00:00
|
|
|
];
|
|
|
|
|
2021-10-04 18:57:15 +00:00
|
|
|
mesonFlags = [
|
2022-12-17 23:28:29 +00:00
|
|
|
"-Dgtk_doc=true"
|
2021-10-04 18:57:15 +00:00
|
|
|
"-Dman=true"
|
|
|
|
];
|
2021-05-09 15:16:33 +00:00
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2021-05-09 15:16:33 +00:00
|
|
|
dbus
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-05-01 06:03:42 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
sed "s|/usr/libexec/|$out/libexec/|" < $src/debian/feedbackd.udev > $out/lib/udev/rules.d/90-feedbackd.rules
|
2021-09-12 02:44:44 +00:00
|
|
|
cp ${themes}/data/* $out/share/feedbackd/themes/
|
2021-05-01 06:03:42 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-17 23:28:29 +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
|
|
|
|
'';
|
|
|
|
|
2020-12-26 22:03:24 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A daemon to provide haptic (and later more) feedback on events";
|
|
|
|
homepage = "https://source.puri.sm/Librem5/feedbackd";
|
|
|
|
license = licenses.gpl3Plus;
|
2022-02-13 02:03:18 +00:00
|
|
|
maintainers = with maintainers; [ pacman99 tomfitzhenry ];
|
2020-12-26 22:03:24 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|