push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
diff --git a/notifypy/os_notifiers/macos.py b/notifypy/os_notifiers/macos.py
index 68731fb..53fcee3 100644
--- a/notifypy/os_notifiers/macos.py
+++ b/notifypy/os_notifiers/macos.py
@@ -75,7 +75,7 @@ class MacOSNotifier(BaseNotifier):
def _find_installed_afplay():
"""Function to find the path for afplay"""
try:
- run_which_for_aplay = subprocess.check_output(["which", "afplay"])
+ run_which_for_aplay = subprocess.check_output(["@which@", "afplay"])
return run_which_for_aplay.decode("utf-8")
except subprocess.CalledProcessError:
logger.exception("Unable to find aplay.")

View File

@@ -0,0 +1,94 @@
{
lib,
stdenv,
buildPythonPackage,
pythonOlder,
fetchFromGitHub,
replaceVars,
alsa-utils,
libnotify,
which,
poetry-core,
jeepney,
loguru,
pytest,
dbus,
coreutils,
}:
buildPythonPackage rec {
pname = "notify-py";
version = "0.3.43";
format = "pyproject";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "ms7m";
repo = "notify-py";
tag = "v${version}";
hash = "sha256-4PJ/0dLG3bWDuF1G/qUmvNaIUFXgPP2S/0uhZz86WRA=";
};
patches =
lib.optionals stdenv.hostPlatform.isLinux [
# hardcode paths to aplay and notify-send
(replaceVars ./linux-paths.patch {
aplay = "${alsa-utils}/bin/aplay";
notifysend = "${libnotify}/bin/notify-send";
})
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# hardcode path to which
(replaceVars ./darwin-paths.patch {
which = "${which}/bin/which";
})
];
nativeBuildInputs = [
poetry-core
];
pythonRelaxDeps = [ "loguru" ];
propagatedBuildInputs = [ loguru ] ++ lib.optionals stdenv.hostPlatform.isLinux [ jeepney ];
nativeCheckInputs = [ pytest ] ++ lib.optionals stdenv.hostPlatform.isLinux [ dbus ];
checkPhase =
if stdenv.hostPlatform.isDarwin then
''
# Tests search for "afplay" binary which is built in to macOS and not available in nixpkgs
mkdir $TMP/bin
ln -s ${coreutils}/bin/true $TMP/bin/afplay
PATH="$TMP/bin:$PATH" pytest
''
else if stdenv.hostPlatform.isLinux then
''
dbus-run-session \
--config-file=${dbus}/share/dbus-1/session.conf \
pytest
''
else
''
pytest
'';
# GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name
# org.freedesktop.Notifications was not provided by any .service files
doCheck = false;
pythonImportsCheck = [ "notifypy" ];
meta = with lib; {
description = "Cross-platform desktop notification library for Python";
mainProgram = "notifypy";
homepage = "https://github.com/ms7m/notify-py";
changelog = "https://github.com/ms7m/notify-py/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [
austinbutler
dotlambda
];
};
}

View File

@@ -0,0 +1,22 @@
diff --git a/notifypy/os_notifiers/linux.py b/notifypy/os_notifiers/linux.py
index 5882481..e26eaaf 100644
--- a/notifypy/os_notifiers/linux.py
+++ b/notifypy/os_notifiers/linux.py
@@ -10,7 +10,7 @@ try:
from jeepney.io.blocking import open_dbus_connection
from shutil import which
- NOTIFY = which('notify-send') # alternatively: from ctypes.util import find_library
+ NOTIFY = '@notifysend@' # alternatively: from ctypes.util import find_library
if NOTIFY:
logger.info("libnotify found, using it for notifications")
@@ -22,7 +22,7 @@ try:
else:
raise ImportError
- APLAY = which('aplay')
+ APLAY = '@aplay@'
if APLAY == None:
logger.debug("aplay binary not installed.. audio will not work!")