2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitLab
|
2021-05-20 23:08:51 +00:00
|
|
|
, docbook-xsl-nons
|
|
|
|
, 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
|
2021-02-05 17:12:51 +00:00
|
|
|
, wrapGAppsHook
|
|
|
|
, glib
|
|
|
|
, gsound
|
|
|
|
, json-glib
|
2021-05-20 23:08:51 +00:00
|
|
|
, libgudev
|
|
|
|
, dbus
|
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";
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "v0.0.20220523";
|
|
|
|
sha256 = "sha256-RyUZj+tpJSYhyoK+E98CTIoHwXwBdB1YHVnO5821exo=";
|
2022-02-21 08:47:16 +00:00
|
|
|
};
|
|
|
|
in
|
2021-02-05 17:12:51 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-05-20 23:08:51 +00:00
|
|
|
pname = "feedbackd";
|
|
|
|
# Not an actual upstream project release,
|
|
|
|
# only a Debian package release that is tagged in the upstream repo
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "0.0.0+git20220520";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
outputs = [ "out" "dev" ]
|
|
|
|
# remove if cross-compiling gobject-introspection works
|
|
|
|
++ lib.optionals (stdenv.buildPlatform == stdenv.hostPlatform) [ "devdoc" ];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "source.puri.sm";
|
|
|
|
owner = "Librem5";
|
|
|
|
repo = "feedbackd";
|
2021-05-20 23:08:51 +00:00
|
|
|
rev = "v${version}";
|
2022-06-16 17:23:12 +00:00
|
|
|
hash = "sha256-4ftPC6LnX0kKFYVyH85yCH43B3YjuaZM5rzr8TGgZvc=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-05-20 23:08:51 +00:00
|
|
|
docbook-xsl-nons
|
|
|
|
gobject-introspection
|
|
|
|
gtk-doc
|
|
|
|
libxslt
|
2021-02-05 17:12:51 +00:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
vala
|
2021-05-20 23:08:51 +00:00
|
|
|
wrapGAppsHook
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
gsound
|
|
|
|
json-glib
|
2021-05-20 23:08:51 +00:00
|
|
|
libgudev
|
2021-02-05 17:12:51 +00:00
|
|
|
];
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Dgtk_doc=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
|
|
|
|
"-Dman=true"
|
|
|
|
# TODO(mindavi): introspection broken due to https://github.com/NixOS/nixpkgs/issues/72868
|
|
|
|
# can be removed if cross-compiling gobject-introspection works.
|
|
|
|
"-Dintrospection=${if (stdenv.buildPlatform == stdenv.hostPlatform) then "enabled" else "disabled"}"
|
|
|
|
];
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
dbus
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2021-05-03 20:48:10 +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
|
2022-02-21 08:47:16 +00:00
|
|
|
cp ${themes}/data/* $out/share/feedbackd/themes/
|
2021-05-03 20:48:10 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +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-20 05:27:41 +00:00
|
|
|
maintainers = with maintainers; [ pacman99 tomfitzhenry ];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|