2021-06-06 07:54:09 +00:00
|
|
|
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, isPy3k, coreutils, alsaUtils
|
|
|
|
, libnotify, which, jeepney, loguru, pytestCheckHook }:
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2021-06-06 07:54:09 +00:00
|
|
|
pname = "notify-py";
|
|
|
|
version = "0.3.3";
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ms7m";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "1n35adwsyhz304n4ifnsz6qzkymwhyqc8sg8d76qv5psv2xsnzlf";
|
2020-10-07 09:15:18 +00:00
|
|
|
};
|
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
propagatedNativeBuildInputs = [ which ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ alsaUtils libnotify ];
|
|
|
|
propagatedBuildInputs = [ loguru ]
|
|
|
|
++ lib.optionals stdenv.isLinux [ jeepney ];
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
checkInputs = [ coreutils pytestCheckHook ];
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2021-06-06 07:54:09 +00:00
|
|
|
# Tests search for "afplay" binary which is built in to MacOS and not available in nixpkgs
|
|
|
|
preCheck = ''
|
|
|
|
mkdir $TMP/bin
|
|
|
|
ln -s ${coreutils}/bin/true $TMP/bin/afplay
|
|
|
|
export PATH="$TMP/bin:$PATH"
|
2020-10-07 09:15:18 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "notifypy" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-06-06 07:54:09 +00:00
|
|
|
description = "Python Module for sending cross-platform desktop notifications on Windows, macOS, and Linux.";
|
2020-10-07 09:15:18 +00:00
|
|
|
homepage = "https://github.com/ms7m/notify-py/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ austinbutler ];
|
|
|
|
};
|
|
|
|
}
|