19 buildPythonPackage rec {
24 disabled = pythonOlder "3.6";
26 src = fetchFromGitHub {
29 rev = "refs/tags/v${version}";
30 hash = "sha256-4PJ/0dLG3bWDuF1G/qUmvNaIUFXgPP2S/0uhZz86WRA=";
34 lib.optionals stdenv.hostPlatform.isLinux [
35 # hardcode paths to aplay and notify-send
37 src = ./linux-paths.patch;
38 aplay = "${alsa-utils}/bin/aplay";
39 notifysend = "${libnotify}/bin/notify-send";
42 ++ lib.optionals stdenv.hostPlatform.isDarwin [
43 # hardcode path to which
45 src = ./darwin-paths.patch;
46 which = "${which}/bin/which";
54 pythonRelaxDeps = [ "loguru" ];
56 propagatedBuildInputs = [ loguru ] ++ lib.optionals stdenv.hostPlatform.isLinux [ jeepney ];
58 nativeCheckInputs = [ pytest ] ++ lib.optionals stdenv.hostPlatform.isLinux [ dbus ];
61 if stdenv.hostPlatform.isDarwin then
63 # Tests search for "afplay" binary which is built in to macOS and not available in nixpkgs
65 ln -s ${coreutils}/bin/true $TMP/bin/afplay
66 PATH="$TMP/bin:$PATH" pytest
68 else if stdenv.hostPlatform.isLinux then
71 --config-file=${dbus}/share/dbus-1/session.conf \
79 # GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name
80 # org.freedesktop.Notifications was not provided by any .service files
83 pythonImportsCheck = [ "notifypy" ];
86 description = "Cross-platform desktop notification library for Python";
87 mainProgram = "notifypy";
88 homepage = "https://github.com/ms7m/notify-py";
89 changelog = "https://github.com/ms7m/notify-py/releases/tag/v${version}";
90 license = licenses.mit;
91 maintainers = with maintainers; [