2018-10-27 10:33:43 +01:00
|
|
|
{ pythonPackages, fetchurl, lib, nixosTests }:
|
2017-04-05 02:00:21 +01:00
|
|
|
|
|
|
|
with pythonPackages;
|
|
|
|
|
|
|
|
buildPythonApplication rec {
|
|
|
|
pname = "rss2email";
|
2018-10-27 10:33:43 +01:00
|
|
|
version = "3.9"; # TODO: on next bump, the manpage will be updated.
|
|
|
|
# Update nixos/modules/services/mail/rss2email.nix to point to it instead of
|
|
|
|
# to the online r2e.1
|
2017-04-05 02:00:21 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ feedparser beautifulsoup4 html2text ];
|
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 13:41:18 +01:00
|
|
|
url = "mirror://pypi/r/rss2email/${pname}-${version}.tar.gz";
|
2017-04-05 02:00:21 +01:00
|
|
|
sha256 = "02wj9zhmc2ym8ba1i0z9pm1c622z2fj7fxwagnxbvpr1402ahmr5";
|
|
|
|
};
|
|
|
|
|
2018-02-15 12:19:48 +00:00
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
2018-02-15 12:36:24 +00:00
|
|
|
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 = ''
|
2018-02-15 12:19:48 +00:00
|
|
|
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
|
2018-02-15 12:19:48 +00:00
|
|
|
ln -s -T r2e.1 $man/share/man/man1/rss2email.1
|
|
|
|
|
|
|
|
# copy documentation
|
|
|
|
mkdir -p $doc/share/doc/rss2email
|
|
|
|
cp AUTHORS COPYING CHANGELOG README $doc/share/doc/rss2email/
|
2017-04-05 02:00:21 +01:00
|
|
|
'';
|
|
|
|
|
2018-02-15 12:19:48 +00:00
|
|
|
# The tests currently fail, see
|
|
|
|
# https://github.com/rss2email/rss2email/issues/14
|
|
|
|
# postCheck = ''
|
|
|
|
# env PYTHONPATH=.:$PYTHONPATH 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.";
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://pypi.python.org/pypi/rss2email;
|
2017-04-05 02:00:21 +01:00
|
|
|
license = licenses.gpl2;
|
2018-02-12 06:18:12 +00:00
|
|
|
maintainers = with maintainers; [ jb55 Profpatsch ];
|
2017-04-05 02:00:21 +01:00
|
|
|
};
|
2018-10-27 10:33:43 +01:00
|
|
|
passthru.tests = {
|
|
|
|
smoke-test = nixosTests.rss2email;
|
|
|
|
};
|
2017-04-05 02:00:21 +01:00
|
|
|
}
|