diff --git a/pkgs/tools/X11/caffeine-ng/default.nix b/pkgs/tools/X11/caffeine-ng/default.nix index 66103ba6f8dc..90292e8beda9 100644 --- a/pkgs/tools/X11/caffeine-ng/default.nix +++ b/pkgs/tools/X11/caffeine-ng/default.nix @@ -1,77 +1,63 @@ -{ 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; + + patches = [ + ./fix-build.patch + ]; + + postPatch = '' + echo "${version}" > version + ''; postInstall = '' - cp -r share $out/ - cp -r caffeine/assets/icons $out/share/ - - # autostart file - ln -s $out/${python3.sitePackages}/etc $out/etc - - glib-compile-schemas --strict $out/share/glib-2.0/schemas + 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; }; diff --git a/pkgs/tools/X11/caffeine-ng/fix-build.patch b/pkgs/tools/X11/caffeine-ng/fix-build.patch new file mode 100644 index 000000000000..cf075451138f --- /dev/null +++ b/pkgs/tools/X11/caffeine-ng/fix-build.patch @@ -0,0 +1,24 @@ +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( diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7ddb3b603f83..7907722d9db9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -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;