nixpkgs/pkgs/by-name/sa/safeeyes/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

79 lines
1.5 KiB
Nix

{ lib
, python3
, fetchPypi
, alsa-utils
, gobject-introspection
, libnotify
, wlrctl
, gtk3
, safeeyes
, testers
, xprintidle
, xprop
, wrapGAppsHook3
}:
with python3.pkgs;
buildPythonApplication rec {
pname = "safeeyes";
version = "2.2.2";
src = fetchPypi {
inherit pname version;
hash = "sha256-k/CNxLScZDCXiwJhP5qh5HD5VUKlOLaYV8ICYgz6NKI=";
};
postPatch = ''
substituteInPlace setup.py --replace "root_dir = sys.prefix" "root_dir = '/'"
'';
nativeBuildInputs = [
wrapGAppsHook3
gobject-introspection
];
buildInputs = [
gtk3
libnotify
];
propagatedBuildInputs = [
babel
psutil
xlib
pygobject3
dbus-python
croniter
setuptools
packaging
];
# 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";
};
}