nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 apprise,
4 babel,
5 buildPythonPackage,
6 click,
7 cryptography,
8 fetchPypi,
9 gntp,
10 installShellFiles,
11 markdown,
12 paho-mqtt,
13 pytest-mock,
14 pytestCheckHook,
15 pyyaml,
16 requests,
17 requests-oauthlib,
18 setuptools,
19 stdenv,
20 terminal-notifier,
21 testers,
22}:
23
24buildPythonPackage (finalAttrs: {
25 pname = "apprise";
26 version = "1.9.7";
27 pyproject = true;
28
29 src = fetchPypi {
30 inherit (finalAttrs) pname version;
31 hash = "sha256-L3PMHgJk+xGf25t83oLo/eQKD1MayIXYxvDPD24TrsI=";
32 };
33
34 postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
35 substituteInPlace apprise/plugins/macosx.py \
36 --replace-fail "/opt/homebrew/bin/terminal-notifier" "${lib.getExe' terminal-notifier "terminal-notifier"}"
37 '';
38
39 nativeBuildInputs = [ installShellFiles ];
40
41 build-system = [
42 babel
43 setuptools
44 ];
45
46 dependencies = [
47 click
48 cryptography
49 markdown
50 pyyaml
51 requests
52 requests-oauthlib
53 ];
54
55 nativeCheckInputs = [
56 gntp
57 paho-mqtt
58 pytest-mock
59 pytestCheckHook
60 ];
61
62 postInstall = ''
63 installManPage packaging/man/apprise.1
64 '';
65
66 pythonImportsCheck = [ "apprise" ];
67
68 passthru = {
69 tests.version = testers.testVersion {
70 package = apprise;
71 version = "v${finalAttrs.version}";
72 };
73 };
74
75 meta = {
76 description = "Push Notifications that work with just about every platform";
77 homepage = "https://appriseit.com/";
78 changelog = "https://github.com/caronc/apprise/releases/tag/v${finalAttrs.version}";
79 license = lib.licenses.bsd2;
80 maintainers = with lib.maintainers; [ getchoo ];
81 mainProgram = "apprise";
82 };
83})