2019-05-22 12:03:39 +01:00
|
|
|
{ gdk-pixbuf, glib, gobject-introspection, gtk3, lib, libnotify,
|
2020-10-05 22:45:13 +01:00
|
|
|
procps, xset, xautolock, xscreensaver, python3Packages, wrapGAppsHook
|
2019-05-08 20:31:56 +01:00
|
|
|
}:
|
|
|
|
|
2019-09-01 19:29:41 +01:00
|
|
|
python3Packages.buildPythonApplication rec {
|
2019-05-08 20:31:56 +01:00
|
|
|
pname = "caffeine-ng";
|
|
|
|
version = "3.4.2";
|
|
|
|
|
2019-09-01 19:29:41 +01:00
|
|
|
src = python3Packages.fetchPypi{
|
2019-05-08 20:31:56 +01:00
|
|
|
inherit pname version;
|
|
|
|
sha256="05k8smjlfjcccgmp8qi04l7106k46fs4p8fl5bdqqjwv6pwl7y4w";
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ wrapGAppsHook glib ];
|
2020-10-05 22:45:13 +01:00
|
|
|
buildInputs = [
|
|
|
|
gdk-pixbuf gobject-introspection libnotify gtk3
|
2021-06-03 11:09:11 +01:00
|
|
|
python3Packages.setuptools-scm
|
2019-09-05 16:44:55 +01:00
|
|
|
];
|
2019-09-01 19:29:41 +01:00
|
|
|
pythonPath = with python3Packages; [
|
2019-05-08 20:31:56 +01:00
|
|
|
dbus-python docopt ewmh pygobject3 pyxdg
|
2020-10-05 22:45:13 +01:00
|
|
|
setproctitle
|
2019-05-08 20:31:56 +01:00
|
|
|
];
|
|
|
|
|
2019-09-01 19:28:08 +01:00
|
|
|
doCheck = false; # There are no tests.
|
|
|
|
|
2020-10-05 22:45:13 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace caffeine/inhibitors.py \
|
|
|
|
--replace 'os.system("xset' 'os.system("${xset}/bin/xset' \
|
|
|
|
--replace 'os.system("xautolock' 'os.system("${xautolock}/bin/xautolock' \
|
|
|
|
--replace 'os.system("pgrep' 'os.system("${procps}/bin/pgrep' \
|
|
|
|
--replace 'os.system("xscreensaver-command' 'os.system("${xscreensaver}/bin/xscreensaver-command'
|
|
|
|
'';
|
|
|
|
|
2019-11-11 22:37:58 +00:00
|
|
|
postInstall = ''
|
2019-05-08 20:31:56 +01:00
|
|
|
mkdir -p $out/share
|
|
|
|
cp -r share $out/
|
2019-11-11 22:37:58 +00:00
|
|
|
# autostart file
|
|
|
|
cp -r $out/lib/python*/site-packages/etc $out/etc/
|
2019-05-08 20:31:56 +01:00
|
|
|
glib-compile-schemas --strict $out/share/glib-2.0/schemas
|
2019-11-11 22:37:58 +00:00
|
|
|
for i in $(find $out -name "*.desktop"); do
|
|
|
|
substituteInPlace $i --replace /usr $out
|
|
|
|
done
|
2019-05-08 20:31:56 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-05-22 18:13:04 +01:00
|
|
|
mainProgram = "caffeine";
|
2019-05-08 20:31:56 +01:00
|
|
|
maintainers = with maintainers; [ marzipankaiser ];
|
|
|
|
description = "Status bar application to temporarily inhibit screensaver and sleep mode";
|
|
|
|
homepage = "https://github.com/caffeine-ng/caffeine-ng";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|