Merge pull request #181628 from SuperSamus/caffeine-ng

This commit is contained in:
Sandro 2022-07-30 19:37:46 +02:00 committed by GitHub
commit 20fd9ba68c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 28 deletions

View file

@ -1,53 +1,85 @@
{ gdk-pixbuf, glib, gobject-introspection, gtk3, lib, libnotify,
procps, xset, xautolock, xscreensaver, python3Packages, wrapGAppsHook
{ buildPythonApplication
, fetchPypi
, gobject-introspection
, gtk3
, lib
, libappindicator-gtk3
, libnotify
, click
, dbus-python
, ewmh
, pulsectl
, pygobject3
, pyxdg
, setproctitle
, python3
, procps
, xset
, xautolock
, xscreensaver
, xfce
, glib
, setuptools-scm
, wrapGAppsHook
}:
python3Packages.buildPythonApplication rec {
let
click_7 = click.overridePythonAttrs (old: rec {
version = "7.1.2";
src = old.src.override {
inherit version;
sha256 = "d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a";
};
});
in buildPythonApplication rec {
pname = "caffeine-ng";
version = "3.5.1";
version = "4.0.2";
src = python3Packages.fetchPypi{
src = fetchPypi {
inherit pname version;
sha256="0akzldqvxnqngpj1s6y2phgj7ch8wfm02j6z2drqvsbvaadw0jbm";
sha256 = "sha256-umIjXJ0et6Pi5Ejj96Q+ZhiKS+yj7bsgb4uQW6Ym6rU=";
};
nativeBuildInputs = [ wrapGAppsHook glib ];
nativeBuildInputs = [ wrapGAppsHook glib setuptools-scm ];
buildInputs = [
gdk-pixbuf gobject-introspection libnotify gtk3
python3Packages.setuptools-scm
libappindicator-gtk3
libnotify
gobject-introspection
gtk3
];
pythonPath = with python3Packages; [
dbus-python docopt ewmh pygobject3 pyxdg
setproctitle pulsectl
pythonPath = [
click_7
dbus-python
ewmh
pulsectl
pygobject3
pyxdg
setproctitle
];
doCheck = false; # There are no tests.
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'
'';
postInstall = ''
mkdir -p $out/share
cp -r share $out/
cp -r caffeine/assets/icons $out/share/icons
cp -r caffeine/assets/icons $out/share/
# autostart file
cp -r $out/lib/python*/site-packages/etc $out/etc/
ln -s $out/${python3.sitePackages}/etc $out/etc
glib-compile-schemas --strict $out/share/glib-2.0/schemas
for i in $(find $out -name "*.desktop"); do
substituteInPlace $i --replace /usr $out
done
gappsWrapperArgs+=(
--prefix PATH : ${lib.makeBinPath [ procps xautolock xscreensaver xfce.xfconf xset ]}
)
'';
meta = with lib; {
mainProgram = "caffeine";
maintainers = with maintainers; [ marzipankaiser ];
description = "Status bar application to temporarily inhibit screensaver and sleep mode";
homepage = "https://github.com/caffeine-ng/caffeine-ng";
homepage = "https://codeberg.org/WhyNotHugo/caffeine-ng";
license = licenses.gpl3;
platforms = platforms.linux;
};

View file

@ -34362,7 +34362,7 @@ with pkgs;
caffeWithCuda = caffe.override { cudaSupport = true; };
caffeine-ng = callPackage ../tools/X11/caffeine-ng {};
caffeine-ng = python3Packages.callPackage ../tools/X11/caffeine-ng {};
cntk = callPackage ../applications/science/math/cntk {
stdenv = gcc7Stdenv;