nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 82 lines 1.9 kB view raw
1{ 2 lib, 3 python3Packages, 4 fetchPypi, 5 fetchpatch2, 6 nixosTests, 7}: 8 9python3Packages.buildPythonApplication rec { 10 pname = "rss2email"; 11 version = "3.14"; 12 pyproject = true; 13 14 src = fetchPypi { 15 inherit pname version; 16 hash = "sha256-RwORS2PHquxBZLNKqCJtR5XX4SHqPCb/Fn+Y68dfI/g="; 17 }; 18 19 patches = [ 20 (fetchpatch2 { 21 name = "html2text-2024.2.25-compat.patch"; 22 url = "https://github.com/rss2email/rss2email/commit/b5c0e78006c2db6929b5ff50e8529de58a00412a.patch"; 23 hash = "sha256-edmsi3I0acx5iF9xoAS9deSexqW2UtWZR/L7CgeZs/M="; 24 }) 25 (fetchpatch2 { 26 name = "use-poetry-core.patch"; 27 url = "https://github.com/rss2email/rss2email/commit/183a17aefe4eb66f898cf088519b1e845559f2bd.patch"; 28 hash = "sha256-SoWahlOJ7KkaHMwOrKIBgwEz8zJQrSXVD1w2wiV1phE="; 29 }) 30 ]; 31 32 outputs = [ 33 "out" 34 "man" 35 "doc" 36 ]; 37 38 postPatch = '' 39 # sendmail executable is called from PATH instead of sbin by default 40 substituteInPlace rss2email/config.py \ 41 --replace-fail '/usr/sbin/sendmail' 'sendmail' 42 ''; 43 44 build-system = with python3Packages; [ 45 poetry-core 46 ]; 47 48 dependencies = with python3Packages; [ 49 feedparser 50 html2text 51 ]; 52 53 postInstall = '' 54 install -Dm 644 r2e.1 $man/share/man/man1/r2e.1 55 # an alias for better finding the manpage 56 ln -s -T r2e.1 $man/share/man/man1/rss2email.1 57 58 # copy documentation 59 mkdir -p $doc/share/doc/rss2email 60 cp AUTHORS COPYING CHANGELOG README.rst $doc/share/doc/rss2email/ 61 ''; 62 63 nativeCheckInputs = [ 64 python3Packages.unittestCheckHook 65 ]; 66 67 unittestFlagsArray = [ 68 "-s" 69 "test" 70 ]; 71 72 meta = with lib; { 73 description = "Tool that converts RSS/Atom newsfeeds to email"; 74 homepage = "https://pypi.python.org/pypi/rss2email"; 75 license = licenses.gpl2; 76 maintainers = with maintainers; [ ekleog ]; 77 mainProgram = "r2e"; 78 }; 79 passthru.tests = { 80 smoke-test = nixosTests.rss2email; 81 }; 82}