Unverified Commit 7514c56c authored by Emily's avatar Emily Committed by GitHub
Browse files

Merge pull request #222176 from SuperSamus/caffeine-ng

caffeine-ng: 4.0.2 -> 4.2.0
parents 2cd6171b a03a8db8
Loading
Loading
Loading
Loading
+30 −43
Original line number Diff line number Diff line
{ buildPythonApplication
, fetchPypi
{ fetchFromGitea
, meson
, ninja
, pkg-config
, scdoc
, gobject-introspection
, gtk3
, lib
, libappindicator-gtk3
, libayatana-appindicator
, libnotify
, click
, dbus-python
, ewmh
, pulsectl
, pygobject3
, pyxdg
, setproctitle
, python3
, python3Packages
, procps
, xset
, xautolock
, xscreensaver
, xfce
, glib
, setuptools-scm
, wrapGAppsHook
}:

let
  click_7 = click.overridePythonAttrs (old: rec {
    version = "7.1.2";
    src = old.src.override {
      inherit version;
      hash = "sha256-0rUlXHxjSbwb0eWeCM0SrLvWPOZJ8liHVXg6qU37axo=";
    };
    disabledTests = [ "test_bytes_args" ]; # https://github.com/pallets/click/commit/6e05e1fa1c2804
  });
in buildPythonApplication rec {
python3Packages.buildPythonApplication rec {
  pname = "caffeine-ng";
  version = "4.0.2";
  format = "setuptools";
  version = "4.2.0";
  format = "other";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-umIjXJ0et6Pi5Ejj96Q+ZhiKS+yj7bsgb4uQW6Ym6rU=";
  src = fetchFromGitea {
    domain = "codeberg.org";
    owner = "WhyNotHugo";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-uYzLRZ+6ZgIwhSuJWRBpLYHgonX7sFXgUZid0V26V0Q=";
  };

  nativeBuildInputs = [ wrapGAppsHook glib gobject-introspection setuptools-scm ];
  nativeBuildInputs = [ gobject-introspection meson ninja pkg-config wrapGAppsHook ];

  buildInputs = [
    libappindicator-gtk3
    libayatana-appindicator
    libnotify
    gtk3
  ];

  pythonPath = [
    click_7
  pythonPath = with python3Packages; [
    click
    dbus-python
    ewmh
    pulsectl
    pygobject3
    pyxdg
    scdoc
    setproctitle
  ];

  doCheck = false; # There are no tests.
  dontWrapGApps = true;
  strictDeps = false;

  postInstall = ''
    cp -r share $out/
    cp -r caffeine/assets/icons $out/share/
  patches = [
    ./fix-build.patch
  ];

    # autostart file
    ln -s $out/${python3.sitePackages}/etc $out/etc
  postPatch = ''
    echo "${version}" > version
  '';

    glib-compile-schemas --strict $out/share/glib-2.0/schemas
  postInstall = ''
    glib-compile-schemas $out/share/glib-2.0/schemas
  '';

  preFixup = ''
@@ -86,6 +72,7 @@ in buildPythonApplication rec {
    maintainers = with maintainers; [ marzipankaiser ];
    description = "Status bar application to temporarily inhibit screensaver and sleep mode";
    homepage = "https://codeberg.org/WhyNotHugo/caffeine-ng";
    changelog = "https://codeberg.org/WhyNotHugo/caffeine-ng/src/tag/v${version}/CHANGELOG.rst";
    license = licenses.gpl3;
    platforms = platforms.linux;
  };
+24 −0
Original line number Diff line number Diff line
diff --git a/meson.build b/meson.build
index 3e4f9ea..5b82861 100644
--- a/meson.build
+++ b/meson.build
@@ -2,10 +2,6 @@ project(
     'caffeine-ng',
     version: run_command('./scripts/read_version.sh', check: true).stdout().strip(),
     meson_version: '>=0.63.0',
-    default_options: [
-      # The default can yield broken results.
-      'python.install_env=auto'
-    ]
 )
 
 dependency('pygobject-3.0')
@@ -82,7 +78,7 @@ configure_file(
 
 install_data(
   'share/applications/caffeine.desktop',
-  install_dir: '/etc/xdg/autostart',
+  install_dir: join_paths(get_option('sysconfdir'), 'xdg/autostart'),
 )
 
 install_data(
+1 −1
Original line number Diff line number Diff line
@@ -39547,7 +39547,7 @@ with pkgs;
  caffeWithCuda = caffe.override { cudaSupport = true; };
  caffeine-ng = python3Packages.callPackage ../tools/X11/caffeine-ng { };
  caffeine-ng = callPackage ../tools/X11/caffeine-ng { };
  cntk = callPackage ../applications/science/math/cntk {
    stdenv = gcc7Stdenv;