3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/misc/safeeyes/default.nix

75 lines
1.9 KiB
Nix
Raw Normal View History

{ lib, python3Packages, gobject-introspection, libappindicator-gtk3, libnotify, gtk3, gnome, xprintidle-ng, wrapGAppsHook, gdk-pixbuf, shared-mime-info, librsvg
2018-03-24 17:15:31 +00:00
}:
2021-04-23 17:50:29 +01:00
let inherit (python3Packages) python buildPythonApplication fetchPypi croniter;
2018-03-24 17:15:31 +00:00
in buildPythonApplication rec {
pname = "safeeyes";
2021-04-23 17:50:29 +01:00
version = "2.1.3";
2018-03-24 17:15:31 +00:00
namePrefix = "";
src = fetchPypi {
inherit pname version;
2021-04-23 17:50:29 +01:00
sha256 = "1b5w887hivmdrkm1ydbar4nmnks6grpbbpvxgf9j9s46msj03c9x";
2018-03-24 17:15:31 +00:00
};
2018-04-10 20:22:33 +01:00
buildInputs = [
gtk3
gobject-introspection
gnome.adwaita-icon-theme
gnome.adwaita-icon-theme
2018-04-10 20:22:33 +01:00
];
nativeBuildInputs = [
wrapGAppsHook
];
2018-03-24 17:15:31 +00:00
propagatedBuildInputs = with python3Packages; [
Babel
psutil
xlib
pygobject3
dbus-python
2021-04-23 17:50:29 +01:00
croniter
2018-03-24 17:15:31 +00:00
libappindicator-gtk3
2018-04-10 19:57:24 +01:00
libnotify
2018-03-24 17:15:31 +00:00
xprintidle-ng
];
# patch smartpause plugin
postPatch = ''
sed -i \
2018-04-04 21:15:16 +01:00
-e 's!xprintidle!xprintidle-ng!g' \
2018-03-24 17:15:31 +00:00
safeeyes/plugins/smartpause/plugin.py
sed -i \
2018-04-04 21:15:16 +01:00
-e 's!xprintidle!xprintidle-ng!g' \
2018-03-24 17:15:31 +00:00
safeeyes/plugins/smartpause/config.json
'';
2018-04-10 20:22:33 +01:00
preFixup = ''
gappsWrapperArgs+=(
2019-05-22 12:03:39 +01:00
--prefix XDG_DATA_DIRS : "${gdk-pixbuf}/share"
2018-04-10 20:22:33 +01:00
--prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
--prefix XDG_DATA_DIRS : "${librsvg}/share"
2018-03-24 17:15:31 +00:00
2018-04-10 20:22:33 +01:00
# safeeyes images
--prefix XDG_DATA_DIRS : "$out/lib/${python.libPrefix}/site-packages/usr/share"
)
mkdir -p $out/share/applications
cp -r safeeyes/platform/icons $out/share/
cp safeeyes/platform/safeeyes.desktop $out/share/applications/
2018-04-10 20:22:33 +01:00
'';
doCheck = false; # no tests
2018-03-24 17:15:31 +00:00
meta = {
homepage = "http://slgobinath.github.io/SafeEyes";
2018-03-24 17:15:31 +00:00
description = "Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder. A Free and Open Source Linux alternative to EyeLeo";
license = lib.licenses.gpl3;
2018-04-01 10:43:28 +01:00
maintainers = with lib.maintainers; [ srghma ];
2018-03-24 17:15:31 +00:00
platforms = lib.platforms.all;
};
}