Unverified Commit ccc07541 authored by Thiago Kenji Okada's avatar Thiago Kenji Okada Committed by GitHub
Browse files

Merge pull request #327430 from lucasew/20240715-i3pystatus

i3pystatus: unstable-2020-06-12 -> 3.35-unstable-2024-06-13, fix tests, move to by-name
parents 7ffbecde ef1a647f
Loading
Loading
Loading
Loading
+98 −0
Original line number Diff line number Diff line
{ lib
, fetchFromGitHub
, libpulseaudio
, libnotify
, gobject-introspection
, python3Packages
, extraLibs ? [] }:
{
  lib,
  fetchFromGitHub,
  libpulseaudio,
  libnotify,
  gobject-introspection,
  python3Packages,
  unstableGitUpdater,
  fetchpatch2,
  extraLibs ? [ ],
}:

python3Packages.buildPythonApplication rec {
  # i3pystatus moved to rolling release:
  # https://github.com/enkore/i3pystatus/issues/584
  version = "unstable-2020-06-12";
  version = "3.35-unstable-2024-06-13";
  pname = "i3pystatus";
  pyproject = true;
  build-system = [ python3Packages.setuptools ];

  src = fetchFromGitHub {
    owner = "enkore";
    repo = "i3pystatus";
    rev = "dad5eb0c5c8a2ecd20c37ade4732586c6e53f44b";
    sha256 = "18ygvkl92yr69kxsym57k1mc90asdxpz4b943i61qr0s4fc5n4mq";
    rev = "f3c539ad78ad1c54fc36e8439bf3905a784ccb34";
    sha256 = "3AGREY+elHQk8kaoFp8AHEzk2jNC/ICGYPh2hXo2G/w=";
  };

  nativeBuildInputs = [
    gobject-introspection
  patches = [
    # absolutifies the path to the test data in buds test so it can be run from anywhere
    (fetchpatch2 {
      # https://github.com/enkore/i3pystatus/pull/869
      url = "https://github.com/enkore/i3pystatus/commit/7a39c3527566411eb1b3e4f79191839ac4b0424e.patch";
      hash = "sha256-kSf2Nrypw8CCHC7acDkQXI27178HA3NJlyRWkHyYOGs=";
    })
  ];

  buildInputs = [ libpulseaudio libnotify ];
  nativeBuildInputs = [ gobject-introspection ];

  propagatedBuildInputs = with python3Packages; [
    keyring colour netifaces psutil basiciw pygobject3
  ] ++ extraLibs;
  buildInputs = [
    libpulseaudio
    libnotify
  ];

  nativeCheckInputs = [ python3Packages.pytestCheckHook ];

  checkInputs = [ python3Packages.requests ];

  propagatedBuildInputs =
    with python3Packages;
    [
      keyring
      colour
      netifaces
      psutil
      basiciw
      pygobject3
    ]
    ++ extraLibs;

  makeWrapperArgs = [
    # LC_TIME != C results in locale.Error: unsupported locale setting
    "--set" "LC_TIME" "C"
    "--suffix" "LD_LIBRARY_PATH" ":" "${lib.makeLibraryPath [ libpulseaudio ]}"
    "--set"
    "LC_TIME"
    "C"
    "--suffix"
    "LD_LIBRARY_PATH"
    ":"
    "${lib.makeLibraryPath [ libpulseaudio ]}"
  ];

  postPatch = ''
@@ -45,18 +78,21 @@ python3Packages.buildPythonApplication rec {
      ''${makeWrapperArgs[@]}
  '';

  # no tests in tarball
  doCheck = false;
  passthru.updateScript = unstableGitUpdater { };

  meta = with lib; {
  meta = {
    mainProgram = "i3pystatus";
    homepage = "https://github.com/enkore/i3pystatus";
    description = "Complete replacement for i3status";
    longDescription = ''
      i3pystatus is a growing collection of python scripts for status output compatible
      to i3status / i3bar of the i3 window manager.
    '';
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = [ maintainers.igsha ];
    license = lib.licenses.mit;
    platforms = lib.platforms.linux;
    maintainers = with lib.maintainers; [
      igsha
      lucasew
    ];
  };
}
+0 −2
Original line number Diff line number Diff line
@@ -31431,8 +31431,6 @@ with pkgs;
  i3nator = callPackage ../tools/misc/i3nator { };
  i3pystatus = callPackage ../applications/window-managers/i3/pystatus.nix { };
  i3status = callPackage ../applications/window-managers/i3/status.nix { };
  i3status-rust = callPackage ../applications/window-managers/i3/status-rust.nix { };