mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
python3Packages.notify-py: hardcode paths to aplay, notify-send, and which
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
{ lib, stdenv, buildPythonPackage, fetchFromGitHub, isPy3k, coreutils, alsa-utils
|
||||
, libnotify, which, jeepney, loguru, pytestCheckHook }:
|
||||
{ lib
|
||||
, stdenv
|
||||
, buildPythonPackage
|
||||
, isPy3k
|
||||
, fetchFromGitHub
|
||||
, substituteAll
|
||||
, alsa-utils
|
||||
, libnotify
|
||||
, which
|
||||
, jeepney
|
||||
, loguru
|
||||
, pytestCheckHook
|
||||
, coreutils
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "notify-py";
|
||||
@@ -14,15 +26,28 @@ buildPythonPackage rec {
|
||||
sha256 = "1n35adwsyhz304n4ifnsz6qzkymwhyqc8sg8d76qv5psv2xsnzlf";
|
||||
};
|
||||
|
||||
propagatedNativeBuildInputs = [ which ]
|
||||
++ lib.optionals stdenv.isLinux [ alsa-utils libnotify ];
|
||||
patches = lib.optionals stdenv.isLinux [
|
||||
# hardcode paths to aplay and notify-send
|
||||
(substituteAll {
|
||||
src = ./linux-paths.patch;
|
||||
aplay = "${alsa-utils}/bin/aplay";
|
||||
notifysend = "${libnotify}/bin/notify-send";
|
||||
})
|
||||
] ++ lib.optionals stdenv.isDarwin [
|
||||
# hardcode path to which
|
||||
(substituteAll {
|
||||
src = ./darwin-paths.patch;
|
||||
which = "${which}/bin/which";
|
||||
})
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [ loguru ]
|
||||
++ lib.optionals stdenv.isLinux [ jeepney ];
|
||||
|
||||
checkInputs = [ coreutils pytestCheckHook ];
|
||||
checkInputs = [ pytestCheckHook ];
|
||||
|
||||
# Tests search for "afplay" binary which is built in to MacOS and not available in nixpkgs
|
||||
preCheck = ''
|
||||
preCheck = lib.optionalString stdenv.isDarwin ''
|
||||
mkdir $TMP/bin
|
||||
ln -s ${coreutils}/bin/true $TMP/bin/afplay
|
||||
export PATH="$TMP/bin:$PATH"
|
||||
@@ -31,9 +56,9 @@ buildPythonPackage rec {
|
||||
pythonImportsCheck = [ "notifypy" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Python Module for sending cross-platform desktop notifications on Windows, macOS, and Linux.";
|
||||
homepage = "https://github.com/ms7m/notify-py/";
|
||||
description = "Cross-platform desktop notification library for Python";
|
||||
homepage = "https://github.com/ms7m/notify-py";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ austinbutler ];
|
||||
maintainers = with maintainers; [ austinbutler dotlambda ];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user