3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/feedreaders/rss2email/default.nix

62 lines
1.8 KiB
Nix
Raw Normal View History

2020-12-07 10:04:55 +00:00
{ pythonPackages, fetchurl, fetchpatch, lib, nixosTests }:
2017-04-05 02:00:21 +01:00
with pythonPackages;
buildPythonApplication rec {
pname = "rss2email";
2020-08-31 16:34:31 +01:00
version = "3.12.2";
2017-04-05 02:00:21 +01:00
2020-08-02 14:15:09 +01:00
propagatedBuildInputs = [ feedparser html2text ];
checkInputs = [ beautifulsoup4 ];
2017-04-05 02:00:21 +01:00
src = fetchurl {
url = "mirror://pypi/r/rss2email/${pname}-${version}.tar.gz";
2020-08-31 16:34:31 +01:00
sha256 = "12w6x80wsw6xm17fxyymnl45aavsagg932zw621wcjz154vjghjr";
2017-04-05 02:00:21 +01:00
};
2020-12-07 10:04:55 +00:00
patches = [
(fetchpatch {
name = "rss2email-feedparser6.patch";
url = "https://github.com/rss2email/rss2email/pull/149/commits/338343c92f956c31ff5249ef4bcf7aeea81f687e.patch";
sha256 = "0h8b3g9332vdrkqbh6lp00k97asrhmlxi13zghrgc78ia13czy3z";
})
(fetchpatch {
name = "rss2email-feedparser6-test.patch";
url = "https://github.com/rss2email/rss2email/pull/149/commits/8c99651eced3f29f05ba2c0ca02abb8bb9a18967.patch";
sha256 = "1scljak6xyqxlilg3j39v4qm9a9jks1bnvnrh62hyf3g53yw2xlg";
})
];
outputs = [ "out" "man" "doc" ];
postPatch = ''
# sendmail executable is called from PATH instead of sbin by default
sed -e 's|/usr/sbin/sendmail|sendmail|' \
-i rss2email/config.py
'';
2017-04-05 02:00:21 +01:00
postInstall = ''
install -Dm 644 r2e.1 $man/share/man/man1/r2e.1
2017-04-05 02:00:21 +01:00
# an alias for better finding the manpage
ln -s -T r2e.1 $man/share/man/man1/rss2email.1
# copy documentation
mkdir -p $doc/share/doc/rss2email
2019-09-01 00:56:28 +01:00
cp AUTHORS COPYING CHANGELOG README.rst $doc/share/doc/rss2email/
2017-04-05 02:00:21 +01:00
'';
2019-09-01 00:56:28 +01:00
postCheck = ''
env PATH=$out/bin:$PATH python ./test/test.py
'';
2017-04-05 02:00:21 +01:00
meta = with lib; {
description = "A tool that converts RSS/Atom newsfeeds to email";
homepage = "https://pypi.python.org/pypi/rss2email";
2017-04-05 02:00:21 +01:00
license = licenses.gpl2;
2020-08-02 14:15:09 +01:00
maintainers = with maintainers; [ jb55 Profpatsch ekleog ];
2017-04-05 02:00:21 +01:00
};
passthru.tests = {
smoke-test = nixosTests.rss2email;
};
2017-04-05 02:00:21 +01:00
}