Merge pull request #192804 from lukegb/ntfy

ntfy: fix on Darwin
This commit is contained in:
Luke Granger-Brown 2022-10-02 23:59:35 +01:00 committed by GitHub
commit e0b437e584
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 15 deletions

View file

@ -74,7 +74,6 @@ buildPythonPackage rec {
];
meta = with lib; {
broken = stdenv.isDarwin;
description = "Slack Developer Kit for Python";
homepage = "https://slack.dev/python-slack-sdk/";
license = with licenses; [ mit ];

View file

@ -1,15 +1,18 @@
{ lib
, python39
, stdenv
, python
, fetchFromGitHub
, fetchpatch
, withXmpp ? !stdenv.isDarwin
, withMatrix ? true
, withSlack ? true
, withEmoji ? true
, withPid ? true
, withDbus ? stdenv.isLinux
}:
let
python = python39.override {
packageOverrides = self: super: {
ntfy-webpush = self.callPackage ./webpush.nix { };
};
};
ntfy-webpush = python.pkgs.callPackage ./webpush.nix { };
in python.pkgs.buildPythonApplication rec {
pname = "ntfy";
version = "2.7.0";
@ -27,16 +30,22 @@ in python.pkgs.buildPythonApplication rec {
mock
];
propagatedBuildInputs = with python.pkgs; [
propagatedBuildInputs = with python.pkgs; ([
requests ruamel-yaml appdirs
sleekxmpp dnspython
emoji
psutil
matrix-client
dbus-python
ntfy-webpush
] ++ (lib.optionals withXmpp [
sleekxmpp dnspython
]) ++ (lib.optionals withMatrix [
matrix-client
]) ++ (lib.optionals withSlack [
slack-sdk
];
]) ++ (lib.optionals withEmoji [
emoji
]) ++ (lib.optionals withPid [
psutil
]) ++ (lib.optionals withDbus [
dbus-python
]));
patches = [
# Fix Slack integration no longer working.
@ -55,6 +64,12 @@ in python.pkgs.buildPythonApplication rec {
})
];
postPatch = ''
# We disable the Darwin specific things because it relies on pyobjc, which we don't have.
substituteInPlace setup.py \
--replace "':sys_platform == \"darwin\"'" "'darwin'"
'';
checkPhase = ''
HOME=$(mktemp -d) ${python.interpreter} setup.py test
'';

View file

@ -9516,7 +9516,7 @@ with pkgs;
# ntfsprogs are merged into ntfs-3g
ntfsprogs = pkgs.ntfs3g;
ntfy = callPackage ../tools/misc/ntfy {};
ntfy = callPackage ../tools/misc/ntfy { python = python39; };
ntfy-sh = callPackage ../tools/misc/ntfy-sh { };