depot/third_party/nixpkgs/pkgs/applications/misc/safeeyes/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

78 lines
1.6 KiB
Nix

{ lib
, python3
, fetchPypi
, alsa-utils
, gobject-introspection
, libappindicator-gtk3
, libnotify
, wlrctl
, gtk3
, safeeyes
, testers
, xprintidle
, xprop
, wrapGAppsHook3
}:
with python3.pkgs;
buildPythonApplication rec {
pname = "safeeyes";
version = "2.1.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-65U/j6P6X4JzhL0aEOnzKa/Al6SYprOOxix2dtcusJQ=";
};
postPatch = ''
substituteInPlace setup.py --replace "root_dir = sys.prefix" "root_dir = '/'"
'';
nativeBuildInputs = [
wrapGAppsHook3
gobject-introspection
];
buildInputs = [
gtk3
libappindicator-gtk3
libnotify
];
propagatedBuildInputs = [
babel
psutil
xlib
pygobject3
dbus-python
croniter
];
# Prevent double wrapping, let the Python wrapper use the args in preFixup.
dontWrapGApps = true;
postInstall = ''
mv $out/lib/python*/site-packages/share $out/share
'';
preFixup = ''
makeWrapperArgs+=(
"''${gappsWrapperArgs[@]}"
--prefix PATH : ${lib.makeBinPath [ alsa-utils wlrctl xprintidle xprop ]}
)
'';
doCheck = false; # no tests
passthru.tests.version = testers.testVersion { package = safeeyes; };
meta = with lib; {
homepage = "http://slgobinath.github.io/SafeEyes";
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 = licenses.gpl3;
maintainers = with maintainers; [ srghma ];
platforms = platforms.linux;
mainProgram = "safeeyes";
};
}